In my system I have eth0 (which may or may not be connected) and a modem on ppp0 (which always may be up or down).  The the case where both interfaces are up and ppp0 is the default route, I'd like to find a way to determine the gateway IP actual address of eth0.  I tried netstat -rn but in this configuration the output is:Kernel IP routing tableDestination     Gateway         Genmask         Flags   MSS Window  irtt Ifacexx.xx.xxx.xxx   0.0.0.0         255.255.255.255 UH        0 0          0 ppp0192.168.98.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo0.0.0.0         0.0.0.0         0.0.0.0         U         0 0          0 ppp0So how do I determine eth0's gateway address?  In the above case the actual gateway address is 192.168.98.1.
How to determine eth0 gateway address when it is not the default gateway?
linux;networking;ip;netstat
Assume eth0 is dhcp client interface.One of options is to check dhcp client lease files dhcpd.leasesPlace and name depend on system, some fedora box under /var/lib/dhclient/  are lease files, where interesting string is like that :  option routers 192.168.1.1;Another option, which worked for me on funtoo box: dhcpcd -U eth0prints nice table, ready to source in scriptsbroadcast_address=192.168.1.255dhcp_lease_time=86400dhcp_message_type=5dhcp_server_identifier=192.168.1.1domain_name_servers='192.168.1.1 192.168.1.101'ip_address=192.168.1.101network_number=192.168.1.0routers=192.168.1.1subnet_cidr=24subnet_mask=255.255.255.0There also another options like dhcping, dhclient -n according google and manpages, but they fails on my boxes, but may work for you.