Tuesday, 11 February 2014

How to Configure & Setup DHCP server on AIX


The following examples show DHCP server setup on an AIX management server.

installing the dhcp server fileset on aix

Since DHCP and bootp use the same port, they cannot both run on an AIX management server. The DHCP server fileset is packaged with thebos.net.tcp.server AIX fileset and is installed by the AIX operating system installation.

To verify DHCP installation, enter:
lslpp -w /etc/dhcpsd.cnf
Output should be similar to:
File              Fileset              Type
-------------------------------------------
/etc/dhcpsd.cnf   bos.net.tcp.server   File

setting up dhcp on a non-nim server

To set up a DHCP server on an AIX management server that is not a NIM server:

  1. Configure the DHCP server configuration file by running:
    tail -50 /etc/dhcpsd.cnf
    leaseTimeDefault       0xffffffff
    leaseExpireInterval    1 year
    supportBOOTP           yes
    supportUnlistedClients yes
    network 30.0.0.0 255.255.255.0
    { #This network is used for SPs, BPAs and HMCs
    option 51 0xffffffff
    subnet 30.0.0.0 30.0.0.51-30.0.0.150
    }
  2. Configure an Ethernet interface on the CSM management server.
    For example:
    chdev -l en1 -a netaddr='30.0.0.1' -a netmask='255.255.255.0' -a state='up' 
    After configuring the Ethernet interface on CSM management server, verify the interface:
    netstat -in
    Output should be similar to:
    Name Mtu   Network  Address         Ipkts Ierrs Opkts Oerrs  Coll
    en0  1500  link#2   0.1.22.6c.6d.c8 865867837   0 358343036  0  0
    en0  1500  9.111.11 9.111.11.1      865867837   0 358343036  0  0
    en1  1500  link#3   0.1.22.b9.36.e  5064631     0 1575938    0  0
    en1  1500  30       30.0.0.1        5064631     0 1575938    0  0
    lo0  16896 link#1                   17395186    0 18161794   0  0
    lo0  16896 127      127.0.0.1       17395186    0 18161794   0  0
    lo0  16896 ::1                      17395186    0 18161794   0  0  
  3. Start up DHCP server on the AIX management server.
    For example:
    startsrc -s dhcpsd
  4. Verify that the DHCP server has started correctly:
    lssrc -ls dhcpsd | more 
    Log File:                  /usr/tmp/dhcpsd.log
    Log Level:                 0x806
    Client Expire Interval:    3600
    Reserve Expire Interval:   900
    Bad Addr Reclaim Interval: 4294967295
    Database Save Interval:    3600
    Output should be similar to:
    IP Address  Status  Duration  Time  Stamp   Client ID
    ----------  ------  --------  ----- ------- ---------
    30.0.0.51   Leased  Infinite  Apr 4  16:27  1-000d600b6297
    30.0.0.52   Leased  Infinite  Apr 4  16:25  1-000d600b78f3
    30.0.0.53   Leased  Infinite  Apr 4  15:30  1-a2e260017002
    30.0.0.54   Leased  Infinite  Apr 4  13:08  1-a2e260004002
    30.0.0.55   Leased  Infinite  Apr 4  12:06  1-a2e260005002
    30.0.0.56   Leased  Infinite  Apr 4  12:04  1-a2e260006002
    30.0.0.57   Free 
    30.0.0.58   Free 
    30.0.0.59   Free   

setting up dhcp on a nim server

To set up a DHCP server on an AIX management server that is a NIM server:

  1. Combining a DHCP server and a NIM master on one server requires that DHCP handle bootp requests and responses. You must first stop the bootpdaemon so that the dhcpsd daemon can bind to the port, as follows:
    ps -ef | grep bootp
    kill the bootp process
  2. Stop bootp from restarting by commenting out the following line in the/etc/inetd.conf file:
    #bootps dgram udp wait root /usr/sbin/bootpd bootpd /etc/bootptab 
  3. Stop and restart the inetd subsystem, as follows:
    refresh -s inetd
  4. List the NIM network objects that must be included in DHCP configuration file, as follows:
    lsnim -l m3_net  
    m3_net:     
    class       = networks     
    type        = ent     
    Nstate      = ready for use     
    prev_state  = ready for use     
    net_addr    = 9.111.111.0     
    snm         = 255.255.255.224     
    routing1    = default 9.111.111.30
  5. Modify the DHCP configuration file for service network and bootp requests, as follows:
    tail -50 /etc/dhcpsd.cnf
    leaseTimeDefault 0xffffffff
    leaseExpireInterval 1 year
    supportUnlistedClients yes
    network 30.0.0.0 255.255.255.0
    { #This network is used for SPs, BPAs and HMCs
    option 51 0xffffffff
    subnet 30.0.0.0 30.0.0.51-30.0.0.150
    }
    network 9.111.111.0 255.255.255.224  
    {  
    #This network is used as NIM m3_net network            
          subnet 9.111.111.0 9.111.111.1-9.111.111.12           
          {           
          option 1  255.255.255.224 #Netmask          
          option 3  9.111.111.30  #Gateway          
          option 6  9.111.1.1      #Domain Name Server IP
          }  
    }
  6. Start the DHCP server on the AIX management server. For example:
    startsrc -s dhcpsd
  7. Verify that the DHCP server has started correctly:
    lssrc -ls dhcpsd | more 
    
    Log File:                  /usr/tmp/dhcpsd.log 
    Log Level:                 0x806 
    Client Expire Interval:    3600 
    Reserve Expire Interval:   900 
    Bad Addr Reclaim Interval: 4294967295 
    Database Save Interval:    3600  
    
    IP Address      Status   Duration  Time Stamp  Client ID
    --------------- -------- --------  ----------- ---------
    30.0.0.51       Free
    30.0.0.52       Free
    30.0.0.53       Free
    30.0.0.54       Free
    30.0.0.55       Free
    30.0.0.56       Free

Setting up a DHCP server on an HMC

To set up a DHCP server on an HMC:

  1. Open the HMC GUI.
  2. Customize the Network Configuration.
  3. Select the Ethernet interface that is used for the DHCP server. You must select eth0 to be connected to service network, and this must be the adapter used as the DHCP server on the HMC.
  4. Click on the Details button.
  5. Click on the Enable DHCP server button.
  6. From the pull down window, select the network subnet.
  7. Click OK to finish.

0 blogger-disqus:

Post a Comment