Pages

Wednesday, December 8, 2010

How to configure DHCP server

DHCP eliminate the need to manually assign or change IP addresses repeatedly. DHCP server configured to provide IP address to clients in the network. In solaris 9 or 10, DHCP server configuration file is stored in /etc/inet/dhcpsvc.conf file. This file was /etc/default/dhcp on prior Solaris 9 OS. Here are tips to work with DHCP server.

  1. To start configure a host as DHCP server, use dhcpconfig command. You can specify what kind of datastore will be used (SUNWfiles, SUNWbinfiles or SUNWnisplus). In this example you will specify SUNWfiles (ascii file) as datastore type, and will save datastore file in /var/dhcp.
    root@solaris-sunray # /usr/sbin/dhcpconfig -D -r SUNWfiles -p /var/dhcp
    Created DHCP configuration file.
    Created dhcptab.
    Added "Locale" macro to dhcptab.
    Added server macro to dhcptab - voyin.
    DHCP server started
  2. Specify the network that will be serviced by this DHCP server. In this example DHCP server will serve 192.168.1.0 network. You can specify the network with dhcpconfig or pntadm command.
    root@solaris-sunray # /usr/sbin/dhcpconfig -N 192.168.1.0
    or
    root@solaris-sunray # pntadm -C 192.168.1.0
  3. To manage DHCP network table use pntadm command. You can add/modify/delete/view an entry of DHCP network table. In this example you add an entry 192.168.1.1 to network 192.168.1.0.
    IP address 192.168.1.1 will be used by client. If you have 10 clients, you should make 10 entries.
    root@solaris-sunray # ptadm -r SUNWfiles -p /var/dhcp -A 192.168.1.1 192.168.1.0
  4. View the entry that you just added. You can specify a macro with dhtadm command.(covered in different tips)
    root@solaris-sunray # pntadm -P 192.168.1.0
    Client ID Flags Client IP Server IP Lease Expiration Macro Comment
    00 00 192.168.1.1 192.168.1.242 Zero UNKNOWN
  5. Modify the value of entry you just added. For example you will change entry 192.168.1.1 to 192.168.1.51
     root@solaris-sunray # pntadm -M 192.168.1.1 -n 192.168.1.51 192.168.1.0
        root@solaris-sunray # pntadm -P 192.168.1.0 Client ID Flags Client IP Server   IP Lease   
        Expiration Macro Comment

        00 00 192.168.1.51 192.168.1.242 Zero
  1. Delete the entry that you no longer use. In example below you remove 192.168.1.1
    root@solaris-sunray # pntadm -D 192.168.1.51 192.168.1.0
    root@solaris-sunray # pntadm -P 192.168.1.0
    Client ID Flags Client IP Server IP Lease Expiration Macro Comment
  2. List DHCP network that you have, and delete DHCP network that you will no longer use. In this example you will remove network 192.168.1.0
    root@solaris-sunray # pntadm -L
    192.168.1.0
    root@solaris-sunray # pntadm -R 192.168.1.0

No comments:

Post a Comment