Multiple network interfaces on RH 5.6
It looks like you have two default gateways defined. Can you post the output of the following files:
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/network-scripts/ifcfg-eth1
You probably don't need a gateway statement in your eth1 interface. You should define any needed routes for the secondary interface that in an /etc/sysconfig/network-scripts/route-eth1
file, using the format:
10.56.36.0/24 via 10.56.36.1 dev eth1
Charlie B
I'm an entrepreneur and small business owner who is working to get a software company off the ground. Until then, I work for a fortune 10 company in a leadership position. I blog regularly about start ups and software.
Updated on September 18, 2022Comments
-
Charlie B over 1 year
I have a Redhat 5.6 server with multiple network interfaces plugged into different network switch ports, mostly each on a different vlan/subnet. How do I know which interface is on which subnet?
As an example, eth0 is the primary interface and works fine. I plumbed up another IP from a different vlan on eth1, but I can't ping the gateway (and it is unpingable). I am told eth1 is plugged into a port on a different vlan (It is actually a heartbeat vlan for clustering). How do I test which controller is on a particular vlan?
eth1 (IP's changed):
[root@tsgxd3900 ~]# ifup eth1 Error: an inet prefix is expected rather than "GATEWAY<N>=10.56.35.1". Error: an inet prefix is expected rather than "NETMASK<N>=255.255.255.0". Error: an inet prefix is expected rather than "ADDRESS<N>=10.56.36.122". Error: an inet prefix is expected rather than "GATEWAY<N>=10.56.35.1". Error: an inet prefix is expected rather than "NETMASK<N>=255.255.255.0". Error: an inet prefix is expected rather than "ADDRESS<N>=10.56.38.35". [root@tsgxd3900 ~]# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.56.36.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 10.56.7.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1 0.0.0.0 10.56.7.1 0.0.0.0 UG 0 0 0 eth0 [root@tsgxd3900 ~]# ping 10.56.7.1 PING 10.56.7.1 (10.56.7.1) 56(84) bytes of data. 64 bytes from 10.56.7.1: icmp_seq=1 ttl=255 time=0.450 ms ^C --- 10.56.7.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.450/0.480/0.510/0.030 ms [root@tsgxd3900 ~]# ping 10.56.36.1 PING 10.56.36.1 (10.56.36.1) 56(84) bytes of data. From 10.56.36.122 icmp_seq=2 Destination Host Unreachable [root@tsgxd3900 ~]# ifconfig eth1 eth1 Link encap:Ethernet HWaddr B8:E3:B6:AB:1C:6D inet addr:10.56.36.122 Bcast:10.56.36.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:65 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:8435 (8.2 KiB) Interrupt:77
Adding some more information:
[root@tsgxd3900 ~]# cat /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=tsgxd3900 GATEWAY=10.56.7.1 [root@tsgxd3900 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 # NetXen Incorporated NX3031 Multifunction 1/10-Gigabit Server Adapter DEVICE=eth0 BOOTPROTO=static DHCPCLASS= HWADDR=78:E3:B5:0B:7C:6C IPADDR=10.56.7.243 NETMASK=255.255.255.0 ONBOOT=yes [root@tsgxd3900 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1 # NetXen Incorporated NX3031 Multifunction 1/10-Gigabit Server Adapter DEVICE=eth1 HWADDR=78:E3:B5:0B:7C:6D ONBOOT=yes BOOTPROTO=static IPADDR=10.56.36.122 NETMASK=255.255.255.0 HOTPLUG=no [root@tsgxd3900 ~]# cat /etc/sysconfig/network-scripts/route-eth1 GATEWAY<N>=10.56.35.1 NETMASK<N>=255.255.255.0 ADDRESS<N>=10.56.36.122 GATEWAY<N>=10.56.35.1 NETMASK<N>=255.255.255.0 ADDRESS<N>=10.56.38.35 [root@tsgxd3900 ~]#
-
ewwhite over 12 yearsSee my comment below about the format of the route-eth1 file. What you have there now should be changed.
-
-
Charlie B over 12 yearsWhat does that tell me? I can see the output of these commands, but I am not sure how to tell what subnet the ports are actually configured to? I also posted some updates to my question with the config file contents.
-
Rilindo over 12 yearsOkay, are you referring to the server or switch? If the server, then you can tell by IP and net mask, which in this case, it means that interface is configured with a /24 subnet. If you are talking about the switch, you'll have to ask you network administrator for more details about the port configuration. They can tell you that as well as what subnets configuration you should be using.