[plug] default gateway on dhcp client
Michael Hunt
michael.j.hunt at usa.net
Mon Mar 4 15:29:00 WST 2002
This info here may also be useful to you. (I found it at
http://www.linux-mag.com/2000-04/networknirvana_05.html)
Client Configuration
How you configure the client side depends on your distribution. For example,
if you are running SuSE 6.3, then all you need to do is get into the network
configuration portion of yast and select the basic network configuration.
Pressing F3 sets auto-IP configuration, which gives you the choice of
configuring either DHCP or BOOTP (the Bootstrap Protocol). If you select
DHCP, changes will be made to the /etc/rc.config file by setting the
configuration parameters for the respective card to " dhcpclient". For
example, without DHCP you might have an entry like this:
IFCONFIG_0 = " 192.168.42.1
broadcast 192.168.42.255
netmask 255.255.255.0 up"
Once DHCP is configured, the entry would look something like this:
IFCONFIG_0 = " dhcpclient"
Note that you could have some of the interfaces configured to use DHCP, and
others with static addresses. When the system boots, the /etc/rc.d/network
script is called (for example, as /etc/rc.d/rc2.d/S05network). If it finds
that the IFCONFIG line for the respective card equals " dhcpclient", it will
skip the configuration of that interface. Later in the boot process, the
DHCP client script is started (for example, as /etc/rc.d/rc2.d/
S05dhclient). Now the client will try to get its configuration from the DHCP
server.
Other systems, like Caldera or Red Hat, have their own configuration tool
and change the appropriate file in /etc/sysconfig/network-scripts/. For
example, if you wanted to configure DHCP on your eth0 interface under Red
Hat, the filename ifcfg-eth0 would be changed. When done you would end up
with something like this:
DEVICE = eth0
IPADDR = 0.0.0.0
NETMASK = 255.255.255.0
NETWORK =
BROADCAST = 0.0.0.255
GATEWAY = none
ONBOOT = yes
DYNAMIC = dhcp
In most cases the default client configuration is sufficient (at least, in
my experience). If not, the client has its own configuration file:
/etc/dhclient.conf. If you have more than one interface on your system with
different network options, you need to group the options by interface. For
example, you might have something like this:
interface eth0
send dhcp-lease-time 3600;
request subnet-mask, broadcast-
address,time-offset, routers,
domain-name, domain-name-servers,
host-name;
require subnet-mask, domain-name-servers;
The send statement tells the client to send the particular option with the
specified value. These can be any of the options the server understands;
they are defined in detail in the dhcp-options(5) man page.
The request statement is a list of configuration options (not the values)
that the client requests that the server send. The key word is "request," as
the require statement says that the particular configuration option must be
sent by a server in order for the client to accept the server's response.
More information about the plug
mailing list