LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-16-2004, 10:21 PM   #1
sleepylight
Member
 
Registered: Apr 2004
Location: Joppa
Posts: 32

Rep: Reputation: 16
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.
 
Old 04-17-2004, 08:08 AM   #2
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
Things getting slow sounds like a resolving problem, although it normally does not take that long to overcome those types of problems.

For the routing problem, you don't want to set more than one default gateway. The internal interface settings on the router should not have a gateway set.

/etc/sysconfig/network-scripts/ifcfg-eth0
GATEWAY=131.92.64.1
DEFROUTE=yes

/etc/sysconfig/network-scripts/ifcfg-eth1
GATEWAY=



Maybe the the nfs problem is somehow related to the routing, you need to fix that and see what it does.


If the eth0 dhcp works right you should be able to ommit the gateway address.

Last edited by DavidPhillips; 04-17-2004 at 08:14 AM.
 
Old 04-20-2004, 08:51 PM   #3
sleepylight
Member
 
Registered: Apr 2004
Location: Joppa
Posts: 32

Original Poster
Rep: Reputation: 16
Talking

This was totally my problem. Thanks a million!!!! That's one more 800lbs gorilla off my back
 
Old 04-21-2004, 10:55 PM   #4
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
cool
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
default gateway setup on boot? compzoo Linux - Wireless Networking 11 07-01-2005 01:23 AM
sles 9.2 dhcp server not assigning default gateway pat45 Linux - Networking 1 05-07-2005 05:51 AM
default gateway not auto-negotiated with dhcp Aaron S Linux - Networking 5 03-30-2005 03:40 PM
create default gateway on boot dave bean Linux - Networking 2 02-29-2004 03:12 PM
how do I add script to set default gateway on boot for eth1 abg Linux - Networking 3 10-01-2003 05:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration