On Wed, 2006-10-11 at 13:27 -0700, Styma, Robert E (Robert) wrote: > I am working with a machine with two nic cards. One is connected > to the corporate network. This is eth0. The other was previously > not connected to anything. Everything worked fine. > > In setting the machine up for some work I will have to do, I did the > following: > 1. Plug a cable into the eth1 rj45 and into a small hub. > 2. Plug a laptop into that same small hub. > 3. Configure the laptop to IP address 192.168.55.55 with the gateway 192.168.55.50 > 4. Using system-config-network, I brought up eth1 as 192.168.55.50 with the > default gateway of 192.168.55.55 (the PC). That is all that is attached to the > other network. > > The problem is that when I reboot, or service network restart, the default > route ends up on eth1 (192.168.55.55). I can correct it by hand and everything > is OK. > > I have been googling the newsgroups and poking around in the ifcfg-eth* files > and have not seen a way to tell the system that the default route is on eth0. > > I must be missing something simple, can someone point me in the correct direction? > (nnn is to obscure our corporate network info) > > ifconfig -a > eth0 Link encap:Ethernet HWaddr 00:0C:76:FD:6F:17 > inet addr:nnn.nnn.36.86 Bcast:nnn.nnn.37.255 Mask:255.255.254.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:132036 errors:0 dropped:0 overruns:0 frame:0 > TX packets:133639 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:51419035 (49.0 Mb) TX bytes:96862625 (92.3 Mb) > Base address:0xa000 Memory:fb000000-fb020000 > > eth1 Link encap:Ethernet HWaddr 00:0C:76:FF:3A:51 > inet addr:192.168.55.50 Bcast:192.168.55.255 Mask:255.255.255.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:116 errors:0 dropped:0 overruns:0 frame:0 > TX packets:637 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:10202 (9.9 Kb) TX bytes:62796 (61.3 Kb) > Base address:0xb000 Memory:fa000000-fa020000 > > lo Link encap:Local Loopback > inet addr:127.0.0.1 Mask:255.0.0.0 > UP LOOPBACK RUNNING MTU:16436 Metric:1 > RX packets:42266 errors:0 dropped:0 overruns:0 frame:0 > TX packets:42266 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:0 > RX bytes:4674615 (4.4 Mb) TX bytes:4674615 (4.4 Mb) > > The following is how the routing looks after service network restart (or reboot). > Then the two commands fix the problem. > > netstat -r -n > Kernel IP routing table > Destination Gateway Genmask Flags MSS Window irtt Iface > 192.168.55.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 > nnn.nnn.36.0 0.0.0.0 255.255.254.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 192.168.55.55 0.0.0.0 UG 0 0 0 eth1 > [lcm-phx-07-n1.phx.lucent.com]: route del -net 0.0.0.0 gw 192.168.55.55 dev eth1 > [lcm-phx-07-n1.phx.lucent.com]: route add -net 0.0.0.0 gw nnn.nnn.36.1 dev eth0 > [lcm-phx-07-n1.phx.lucent.com]: netstat -r -n > Kernel IP routing table > Destination Gateway Genmask Flags MSS Window irtt Iface > 192.168.55.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 > nnn.nnn.36.0 0.0.0.0 255.255.254.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 nnn.nnn.36.1 0.0.0.0 UG 0 0 0 eth0 > > Robert E. Styma > Principal Engineer (DMTS) > Lucent Technologies, Phoenix > Email: stymar@xxxxxxxxxx / styma@xxxxxxxxxx > Phone: 623-582-7323 Cell: 602-478-0114 > Company: http://www.lucent.com > Personal: http://www.styma.org > Mine is set in /etc/sysconfig/network GATEWAY=148.197.29.254 but sometimes appears in all of the /etc/sysconfig/network-scripts/ifcfg-ethx's Don't think there is any harm in having it in all of them - provided it says the same thing! John