default gateway is not loaded from dhcp on boot
This is a long standing problem that has reared it's ugly head on me again recently. The problem only seems to occur when I set up a machine with 2 NICs. One card faces the outside world (throgh a cable modem or lan or something) and gets it's info via DHCP. The other faces a private internal network where it severs as a gateway and has a hard coded address. For example:
machine 1 - Bahamut (ipmasquerade, NFS)
eth0: 131.92.65.21/255.255.252.0 (picked up through DHCP)
default gw 131.92.64.1 (again, normally assigned through DHCP)
eth1: 192.168.0.1/255.255.255.0
default gw 192.168.0.1
machine 2 -summoner (dns, ldap,etc)
eth0: 192.168.0.5
default gw 192.168.0.1 (aka bahamut)
Ok, bahamut has been a linux workstation for like a year now. Every morning it boots up, gets an address via DHCP, resolves all it's routes and proceeds on it's merry little way. Then I add a second NIC. I use redhat-config-network to tell it eth0 gets it's info through dhcp, eth1 gets hard coded. For a little while all seems well until at some point I reboot.
On the reboot all hell breaks loose. The cards seem to get the right IPs, but as stuff starts to load things move to a crawl. NFS is the biggest killer. Not NFS mouts, but the NFS server daemon. Athough I don't know the innner workings of NFS well enough to know _why_ I can guess that it doesn't like not being able to resolve the netowrk addresses. NFS will hang the machine more or less critically. My home comptuer that does this will take ~6 hours to boot if left on it's own, bahamut seems to finally boot after 30 minutes(it's a much faster machine). Beyond this anything that needs to resolve network items (CUPS, Sendmail, ntpd) take 50-300 times longer to start.
I find that if I start the machine, then go into interactive startup life gets easier. I can supress most of the daemons, get to a prompt log in (slowly) and then enter a "route add default gateway x.x.x.x dev eth0" type command and everything pops back to lfie. Until I add the route myself though nothing will work. Netstat -ra will sit for an eternity trying to resolve routes before finally timing out. For a while I've had this in my home server's rc.local file, but the fact of the matter is any time the power goes out (lots of thunderstorms in the summer) I have to hand restart the machine.
So, has anyone else had this problem? Better yet, does anyone know how to solve this? Routing has been a real thorn in my side for about a year, but now it really needs to be solved. Bahamut is going to end up being a pretty critical machine, and this routing problem is going to be the death of me someday.
|