DamianDelCampo
MIS
Hi, I've just installed RH9 on a dual NIC Server and am trying to work out network configuration after installation. This is a home network I'm setting up for learning purposes & hypothetical questioning such as this as I try to understand how to parameters affect behaviour.
I have 2 interfaces which will plug directly into my gateway/router
Eth0 - 192.168.0.21/24
Eth1 - 192.168.0.22/24
Gtwy - 192.168.0.1/24
Eth1 actually isn't connected (plugged into dead port) but I don't believe it should affect my ultimate question (+ I will later reconfigure it to connect directly to a client pc on diff subnet and route to my GW via Eth0, but thats later)
I know that I can write a script and add it to a /etc/rc#.d dir to run at boot time to set ip & route as required but I'm asking now about the files used to give me the config I currently at boot.
My current default configuration
As you can see, it uses eth1 and even though eth0 is enabled/up it doesn't appear in the routing tables.
Why?[/color red]
I would have presumed eth0 and eth1 would both be in the table & that eth0 would have been used before eth1.
It appears to me from config files that both interfaces are setup almost identically, ie only diff is eth0/eth1 .21/.22 ip addr.
If I bring down eth1 and manually add eth0 to route, eth0 works as you would expect.
But as soon as I bring eth1 up, it dumps eth0 out of the picture.
The purpose of this post
What file/s are telling my system to use eth1 and not eth0??[/color red]
Why does eth0 not have an entry in route table?? - why is eth0 forgotten about when I up eth1?[/color red]
Any help in this matter greatly appreciated,
Thanks
I have 2 interfaces which will plug directly into my gateway/router
Eth0 - 192.168.0.21/24
Eth1 - 192.168.0.22/24
Gtwy - 192.168.0.1/24
Eth1 actually isn't connected (plugged into dead port) but I don't believe it should affect my ultimate question (+ I will later reconfigure it to connect directly to a client pc on diff subnet and route to my GW via Eth0, but thats later)
I know that I can write a script and add it to a /etc/rc#.d dir to run at boot time to set ip & route as required but I'm asking now about the files used to give me the config I currently at boot.
My current default configuration
Code:
[root@jasmine root]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:04:AC:53:F3:DA
inet addr:192.168.0.21 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:39 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
eth1 Link encap:Ethernet HWaddr 00:02:55:50:EA:FC
inet addr:192.168.0.22 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:3 dropped:0 overruns:0 carrier:3
lo .. the usual
[root@jasmine root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth1
[root@jasmine root]# ping -c 5 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
From 192.168.0.22 icmp_seq=1 Destination Host Unreachable
From 192.168.0.22 icmp_seq=2 Destination Host Unreachable
From 192.168.0.22 icmp_seq=3 Destination Host Unreachable
From 192.168.0.22 icmp_seq=4 Destination Host Unreachable
From 192.168.0.22 icmp_seq=5 Destination Host Unreachable
--- 192.168.0.1 ping statistics ---
5 packets transmitted, 0 received, +5 errors, 100% packet loss, time 4026ms
, pipe 3
Why?[/color red]
I would have presumed eth0 and eth1 would both be in the table & that eth0 would have been used before eth1.
It appears to me from config files that both interfaces are setup almost identically, ie only diff is eth0/eth1 .21/.22 ip addr.
Code:
[root@jasmine root]# more /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.0.21
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
TYPE=Ethernet
USERCTL=no
PEERDNS=no
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
[root@jasmine root]# more /etc/sysconfig/network-scripts/ifcfg-eth1
..
DEVICE=eth1
IPADDR=192.168.0.22
...
If I bring down eth1 and manually add eth0 to route, eth0 works as you would expect.
Code:
[root@jasmine root]# ifdown eth1
[root@jasmine root]# route add -net 192.168.0.0 netmask 255.255.255.0 dev eth0
[root@jasmine root]# route add default gateway 192.168.0.1
[root@jasmine root]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:04:AC:53:F3:DA
inet addr:192.168.0.21 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:21495 errors:0 dropped:0 overruns:0 frame:0
TX packets:22112 errors:0 dropped:0 overruns:0 carrier:0
eth1 Link encap:Ethernet HWaddr 00:02:55:50:EA:FC
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:3 dropped:0 overruns:0 carrier:3
lo .. the usual ..
[root@jasmine root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
But as soon as I bring eth1 up, it dumps eth0 out of the picture.
Code:
[root@jasmine root]# ifup eth1
[root@jasmine root]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:04:AC:53:F3:DA
inet addr:192.168.0.21 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:22783 errors:0 dropped:0 overruns:0 frame:0
TX packets:23375 errors:0 dropped:0 overruns:0 carrier:0
eth1 Link encap:Ethernet HWaddr 00:02:55:50:EA:FC
inet addr:192.168.0.22 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:8 dropped:0 overruns:0 carrier:8
lo .. usual..
[root@jasmine root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth1
The purpose of this post
What file/s are telling my system to use eth1 and not eth0??[/color red]
Why does eth0 not have an entry in route table?? - why is eth0 forgotten about when I up eth1?[/color red]
Any help in this matter greatly appreciated,
Thanks