SLAC CPE Software Engineering Group
Stanford Linear Accelerator Center
System Admin

MCC DHCP Configuration

SLAC Detailed
SLAC Computing
Software Home
Software Detailed
 

 

 

Programmers' Guides, Users' Guides

18-Jun-2012


DHCP Configuration

DHCP, Dynamic Host Configuration Protocal, implemented via dhcpd, automatically assigns IP and

other network configuration information (subnet mask, broadcast address) to computers on a network. IP addresses are either dynamically assigned from a range, or statically assigned by MAC address. A DHCP client will send out a broadcast request to the DHCP server requesting an address. The DHCP server will then issue a "lease" and assign it to that client. DHCP, a superset of BOOTP, provides service to both DHCP cleint and BOOTP cleints. DHCP reduces the ammount of time required to configure clients and allows one to move a computer to various networks and be configured with the appropriate IP address, gateway and subnet mask

 

DHCP Installation

mount -t nfs 134.79.151.39:/share1 /nfs/nas03
yum install dhcp

[root@lcls-srv20 ~]# rpm -qa | grep dhcp
dhcp-3.0.1-65.el4_8.1

DHCP daemon Setup

/sbin/chkconfig --list dhcpd
dhcpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off

/sbin/chkconfig dhcpd on

DHCP restart

service dhcpd restart

 

DHCP Server Configuration

dhcpd, DHCP daemon, is configured in /etc/dhcpd.conf.  A leases file is kept in /var/lib/dhcp/dhcpd.leases. 

[root@mccsrv01 ~]# cat /etc/dhcpd.conf

#Required for dhcp 3.0+ / RHEL4 +. Otherwise, dhcpd wont start.

ddns-update-style interim;    
#
shared-network "MCC-CTRLS_VLAN"
{
subnet 172.19.52.0 netmask 255.255.252.0
{

# default DNS to be used by DHCP clients

option domain-name-servers mcc-pep.slac.stanford.edu, mccdev-pep.slac.stanford.edu;                                                             
option domain-name "slac.stanford.edu";

# default gateway to be used by DHCP clients

option routers 172.19.55.1;

# default subnet mask to be used by DHCP clients
option subnet-mask 255.255.252.0;

# default broadcast address to be used by DHCP clients
option broadcast-address 172.19.55.255;
}

}

... more exmaples with comments...

The configuration file is visible to the public via

http://www.slac.stanford.edu/grp/cd/soft/unix/DHCP.html

DHCP Client Configuration

.... make entry here...

DHCP Test

First, test configuration file for syntax errors with the following command: /etc//init.d/dhcpd configtest, while monitoring /var/log/messages ( tail –f /var/log/messages ) for any error messages. It is important to test the configuration file if there is any change made, before restart dhcpd.

....make entry here...

When dhcpd is running it will generate entries in the file: /var/lib/dhcp/dhcpd.leases

DHCP monitoring

login mccsyslog

tail –f /var/log/messages | grep mccsrv

 

How to update DHCP service

1)  on mccsrv01, update /etc/dhcpd.conf

2) set up monitoring

login mccsyslog

tail –f /var/log/messages | grep mccsrv

3) on mccsrv01, service dhcpd restart

4) test:

unplug sunray63 (on Ken's desk) and plug, monitor

tail –f /var/log/messages | grep mccsrv

5) scp dhcpd.conf to mccsrv02 and restart dhcp on mccsrv02

Ken's Original Note

Test config on mccsrv01

Test config on mccsrv01

  • Install DHCP RPM:
    • yum install dhcp
  • Turn on DHCP
    • chkconfig dhcpd on
  •  Create /etc/dhcpd.conf file
    • Put:  “ddns-update-style interim; “   at top of file –required
  • Started DHCP server
    • service dhcp start
    • monitor /var/log/messages ( tail –F /var/log/messages )

DHCP Management:

  1. Always make changes on mccsrv01 
  2. Always make a copy of DHCP file.  (Remember mccsrv02 also has a copy)
  3. Edit dhcpd.conf file
    1. Bring up mccsyslog ( tail -F /var/log/messages )
    2. Restart dhcpd services ( service dhcpd restart )
      1. Monitor on syslog
  4. If dhcpd.conf file is correct then copy to mccsrv02 ( scp /etc/dhcpd.conf root@mccsrv02:/etc/  )
  5. Restart dhcp on mccsrv02  (  ssh root@mccsrv02 service dhcpd restart  )
    1. Monitor on syslog
 



 

Programmers' Guides, Users' Guides, Requirements, Design, Papers, Administration, How-To, Hardware, IOC, Database

 

[SLAC CPE Software Engineering Group][ SLAC Home Page]

 


Created by: Ken Brobeck  14-May-2010

Modified by Jingchen Zhou 31-Aug-2010