Find the linux interface gateway
AniOct 2 2012 — edited Oct 3 2012HI,
I want to find the gateway of interface bondeth4. From ifconfig o/p i can see that the ip is showing "10.217.49.23", & from /etc/sysconfig/network-scripts/ifcfg-bondeth4 the gateway is 10.217.202.1. But from route o/p the gateway is showing default gateway i.e 10.217.198.1. if u can help me to find out the current gateway of bondeth4
Regards,
Ani
bondeth4 Link encap:Ethernet HWaddr 00:1B:21:89:94:A8
inet addr:10.217.49.23 Bcast:10.217.63.255 Mask:255.255.240.0
inet6 addr: fe80::21b:21ff:fe89:94a8/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:22633138275 errors:0 dropped:0 overruns:0 frame:0
TX packets:191215659214 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1359571459915 (1.2 TiB) TX bytes:289246386937191 (263.0 TiB)
===================================================================
[root@xxxxxxxx network-scripts]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.218.9.17 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
10.217.201.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
*10.217.202.0 0.0.0.0 255.255.255.0 U 0 0 0 bondeth4*
10.217.199.0 0.0.0.0 255.255.255.0 U 0 0 0 bondib0
10.217.198.0 0.0.0.0 255.255.255.0 U 0 0 0 bondeth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 bondib0
0.0.0.0 10.217.198.1 0.0.0.0 UG 0 0 0 bondeth0
[root@xxxxxxxx network-scripts]#
==========================================================
[root@xxxxxxxx network-scripts]# cat ifcfg-bondeth4
#### DO NOT REMOVE THESE LINES ####
#### %GENERATED BY CELL% ####
DEVICE=bondeth4
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
IPADDR=10.217.49.23
NETMASK=255.255.240.0
#NETWORK=10.217.198.0
#BROADCAST=10.217.198.255
#BONDING_OPTS="mode=active-backup miimon=100 downdelay=5000 updelay=5000 num_grat_arp=100"
BONDING_OPTS="mode=802.3ad miimon=100 lacp_rate=1"
IPV6INIT=no
GATEWAY=10.217.202.1
[root@xxxxxxxx network-scripts]#
================================================================
[root@xxxxxxxx network-scripts]# netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.218.9.17 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
10.217.201.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
*10.217.202.0 0.0.0.0 255.255.255.0 U 0 0 0 bondeth4*
10.217.199.0 0.0.0.0 255.255.255.0 U 0 0 0 bondib0
10.217.198.0 0.0.0.0 255.255.255.0 U 0 0 0 bondeth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 bondib0
0.0.0.0 10.217.198.1 0.0.0.0 UG 0 0 0 bondeth0
[root@xxxxxxxx network-scripts]#