How to configure a Solaris system as a DHCP server Intro This document provides a simple guide to configuring a Solaris system as a DHCP server using the software supplied with the operating system. The command line interface is used thoughout, no reference made to the Sun's GUI tool 'dhcpmgr'. This procedure was performed on a Solaris 9 system, though it is likely also applicable to Solaris 7 & 8. The dhcp server setup here serves a single network, makes no effort to register names in any naming service, and does not enable BOOTP.
Packages You should have the 3 basic DHCP packages installed; # pkginfo | grep system SUNWdhcsb system SUNWdhcsr system SUNWdhcsu
DHCP Binary File Format Data Module for BOOTP/DHCP Services BOOTP/DHCP Server Services, (Root) BOOTP/DHCP Server Services, (Usr)
Procedure 1. 2. 3. 4. 5.
Create basic DHCP configuration and dhcptab files Create a macro for the local network Create the local network table Add some entries to the network table Start the DHCP server
1. Basic DHCP Configuration Use dhcpconfig to setup dhcpsvc.conf and dhcptab, here we simply define the type of datastore (SUNWfiles = text files) and the location of datafiles; # dhcpconfig -D -r SUNWfiles -p /var/dhcp
2. Create a macro for the local network Here we create a macro for our local network ( the one we will serve IP addresses for) in dhcptab # dhtadm -A -m 192.9.200.0 -d ':Broadcst=192.9.200.255:Subnet=255.255.255.0:MTU=1500:'
3. Create the local network table # pntadm -C 192.9.200.0
4. Add some entries to the network table Here we define three local IP address that will be leased out by the dhcp server... # pntadm -r SUNWfiles -p /var/dhcp -A 192.9.200.201 192.9.200.0 # pntadm -r SUNWfiles -p /var/dhcp -A 192.9.200.202 192.9.200.0 # pntadm -r SUNWfiles -p /var/dhcp -A 192.9.200.203 192.9.200.0
5. Start the DHCP server Use the standard init.d boot script and watch /var/adm/messages for problems; # sh /etc/init.d/dhcp start
If you have problems stop the daemon and run it manually with the debug & verbose options; # /usr/lib/inet/in.dhcpd -dv 3fe143d6: Daemon Version: 3.5 3fe143d6: Maximum relay hops: 4 3fe143d6: Run mode is: DHCP Server Mode. 3fe143d6: Datastore resource: SUNWfiles
What is DHCP? DHCP is used to automatically configure network parameters on client workstations. Whilst it can be used to configure any and every known network parameter it is typically used simply to automatically allocate IP addresses and deliver static information such as the addresses of network routers and DNS servers. DHCP client support is present in most modern operating systems - include MS Windows, Linux, Solaris, HP-UX etc.
Additional sources and information http://docs.sun.com/app/docs/doc/816-0211/6m6nc673a?a=view http://wiki.xdroop.com/space/Sun/DHCP+server http://docs.sun.com/app/docs/doc/816-4554/dhcp-admin-124?a=view