Linux Box Admin
Trusted Remote Administration
logo

Tilde
What's new
Articles
Micro HowTos
About
Contact







Index arrow Micro HowTos

index of all micro how-tos
arrow Daemons

DHCP
(2 votes)
Wednesday, 07 March 2007
   
    DHCP    
     
       
 

DHCP clients

The dhcp client in most distributions comes from the Internet Software Consortium (ISC). The program is dhclient and uses the /etc/dhclient.conf configuration file. The DHCP client will attempt to configure all network interfaces unless specified otherwise on the command line or in the configuration file.

To obtain an IP address lease for eth0:
dhclient eth0

To release the current IP lease:
dhclient -r eth0

Current lease information is stored in:
/var/lib/dhcp/dhclient.leases.

Some distributions use dhcpcd or pump as their dhcp client.

DHCP server

The ISC DHCP server is dhcpd. It implements the DHCP and BOOTP protocols.

The configuration file is:
/etc/dhcpd.conf

The lease file is:
/var/lib/dhcp/dhcpd.leases

Sample DHCP subnet configuration:
subnet 10.1.4.0 netmask 255.255.255.0 {
   range 10.1.4.100 10.1.4..250;
   default-lease-time 86400;
   max-lease-time 86400;
   option subnet-mask 255.255.255.0;
   option broadcast-address 10.1.4.255;
   option routers 10.1.4.1;
   option domain-name-servers 10.1.5.1, 10.1.5.2;
   option domain-name "foo.com";
}

Sample fixed IP assigned by MAC address:
host tk421 {
   hardware ethernet 00:00:45:12:EE:F4;
   fixed-address 10.1.4.99;
   option subnet-mask 255.255.255.0;
   option broadcast-address 10.1.4.255;
   option routers 10.1.4.1;
   option domain-name-servers 10.1.5.1, 10.1.5.2;
   option domain-name "foo.com";
}

   
       
         
 



Copyright © 2006,2007 Linux Box Admin.

 
My NHL fan blog