dhcp server issues

Rick Stevens rstevens at vitalstream.com
Thu Jun 10 22:37:22 UTC 2004


cfh wrote:
> I have a Linux computer (call it g1) that acts as a gateway router to the Internet for a internal LAN.  The computer has three Ethernet cards, only two are used at this time.  Eth0 gets it's IP and gateway from a dhcp server in the internal LAN and eth2 gets its IP and gateway info from my ISP's dhcp server.  The problem is that eth0 comes up first and the routing table gets the gateway that the other computers on the LAN get, which is Linux computer (g1).  Then eth2 comes up and gets it's IP from the service provider, but the routing table is not updated with the ISP assigned gateway because it already got it's gateway IP from the internal dhcp server.    I need  the routing table on g1 to be updated with the gateway IP from the ISP so it can find the Internet.  I know I could make eth0 the external card so it gets assigned the ISP gateway first, but other issues make that undesirable.  Any ideas on how to handle this? Is there a way to make the internal dhcp server not gi
v!
> e a gateway IP to a specific machine (g1).

First, please format your messages using plain text and 72 characters
per line.  It makes it awful hard to read when they run on like that.

It rather depends on which DHCP server you have on the internal LAN.
Most can be configured to not send whatever you wish.

Is there a reason you have your gateway machine set up to take a
DHCP address?  That's generally considered bad form.  A gateway is
the anchor point of your network and it really should have a fixed
address on your LAN so the other machines can use it.

By convention, the gateway is either the first or last usable address in
a subnet.  If you're using the normal 192.168/16 internal network, make
eth0 a fixed address of 192.168.0.1 and tell your internal DHCP server
that its pool is 192.168.0.2 through 192.168.255.254 (or whatever you
prefer).  Also tell the server that the gateway to hand off to the
clients is 192.168.0.1.  Simple and much, much cleaner.

If you set up eth0 like that, you can set up a default route in
/etc/sysconfig/network that specifies using eth2 as the outbound
interface even before it gets an IP.  Make your /etc/sysconfig/network
look like:

	NETWORKING=yes
	HOSTNAME=whatever.yourdomain.tld
	GATEWAYDEV=eth2

Voila!
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-    "Hello. My PID is Inigo Montoya.  You `kill -9'-ed my parent    -
-                     process.  Prepare to vi."                      -
----------------------------------------------------------------------





More information about the Redhat-install-list mailing list