SLAC CPE Software Engineering Group
Stanford Linear Accelerator Center
System Admin

DHCP Changes

SLAC Detailed
SLAC Computing
Software Home
Software Detailed
 

 

Modified: 09-Nov-2012

 


Our production DHCP servers are mccsrv01 and mccsrv02.  All changes should be made on mccsrv01 and checked for syntax errors with the "service dhcpd configtest", before restarting the DHCP server: "service dhcpd restart".  Monitor the log file to confirm there were no errors and that the DHCP server started successfully.  If this is successful then copy the dhcpd.conf file to mccsrv02 and restart the DHCP server on mccsrv02

  • scp /etc/dhcpd.conf mccsrv02:/etc/
  • ssh mccsrv02 service dhcpd restart

-Check the syslog file to make sure the DHCP servers started successfully

 


Emergency MAC Changes:

###############################################################
- This script is only to be used in case of emergency -
and you cannot get in touch with Jingchen x4661, Ken x2558,
or Shashi x3539.
################################################################

 

DHCP Server Script:

There is a dhcp-monitor that is running on mccsrv01.  This dhcp monitor will wake up every 10 seconds and check if the file: /u1/lcls/sys/dhcp/dhcp-changes is present.  If the file is present then it will copy over the file and get all the information: WHO, WHY, Host, New MAC address. This script will verify the hostname and that the MAC address is in the proper format and then make the changes.  Once the changes are made it will check the Syntax of the dhcpd.conf file and restart the DHCP server if Syntax is OK.  It will then verify the DHCP server started successfully.  If the Syntax fails it will revert back to the original dhcpd.conf file.  If the DHCP server does not restart properly, it will revert back to the original dhcpd.conf file and restart the DHCP services.  All of this information will be writen to a "Results" file and scp'd back to /u1/lcls/sys/dhcp/dhcp-results where the originating script, chg-DHCP, will cat out this file for the user.  This Results file will also be sent to the system admins.

 

USER Script:

The User will run the chg-DHCP script to create the change file: /u1/lcls/sys/dhcp/dhcp-changes


  1. login to lcls-builder as softegr
    1. Type: chg-DHCP
      1. Follow the directions
        1. Type your UNIX ID
        2. The Reason for the change
        3. Hostname you are changing
        4. New MAC address (remember to use colons)
      2. Now wait until you get the results
        1. This can take over 30 seconds
         

See the session below:


 

Example:

[softegr@lcls-builder ~]$ chg-DHCP

###############################################################
- This script is only to be used in case of emergency -
and you cannot get in touch with Jingchen x4661, Ken x2558,
or Shashi x3539.
################################################################

This script will allow the user to change the MAC address in the DHCP file

Who are you? (ex: brobeck) (UNIX ID)-> brobeck

Why are you making this MAC change? -> changing MAC of sunray70

Please enter the hostname -> sunray70

Enter the new MAC address: (xx:xx:xx:xx:xx:xx):-> 00:21:28:90:1C:BE

DHCP file has been created.
Waiting on DHCP server to read file
This can take up to 30 seconds

Please be patient...
Waiting..................

BEFORE:

host sunray70
{
fixed-address 172.27.24.80;
hardware ethernet 00:21:28:90:1C:BF;
}

AFTER:

host sunray70
{
fixed-address 172.27.24.80;
hardware ethernet 00:21:28:90:1C:BE;
}


-------------------------------

Syntax: OK -restarting DHCP server
mccsrv01 DHCP server has restarted successfully

Copying DHCP file to mccsrv02
Restarting DHCP server on mccsrv02
mccsrv02 DHCP server has restarted successfully

------ Change file below -------

brobeck
changing MAC of sunray70
sunray70
00:21:28:90:1C:BE




 

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: 09-Nov-2012