Quick HOWTO: Sun DHCP daemon

Sun’s own DHCP daemon is not often used for anything besides Jumpstart/PXE boot and SunRay’s presumably because it’s not as well documented and accepted as the ISC DHCP daemon. I recently had a need to quickly setup a DHCP server and serve out a range of IP adresses including DNS servers and a default router, all in all very basic. Here are my notes.

Setup DHCP in /var/dhcp using the SUNWfiles format

# dhcpconfig -D -r SUNWfiles -p /var/dhcp

We only want to serve DHCP requests on bge1

# /usr/sbin/dhcpconfig -P INTERFACES=bge1

Add new network

# dhcpconfig -N 172.22.2.0 -m 255.255.255.0 -t 172.22.2.1

Display dhcptab table

# dhtadm -P

Modify network/macro with various options

# dhtadm -M -m 172.22.2.0 -d ':Subnet=255.255.255.0:Router=172.22.2.1:Broadcst=172.22.2.255:DNSserv=8.8.8.8 8.8.4.4:LeaseTim=86400:' -g

Add one client IP

# pntadm -A 172.22.2.101 -c dhcp101 -m 172.22.2.0 172.22.2.0

Adding several client IPs

# for IP in 102 103 104 105 106 107 108 109 110
do
pntadm -A 172.22.2.${IP} -c dhcp${IP} -m 172.22.2.0 172.22.2.0
done

Delete client IP

# pntadm -D 172.22.2.107 172.22.2.0

Display DHCP network table

# pntadm -P 172.22.2.0

Documentation: Solaris System Administration Guide: IP Services > DHCP

This entry was posted in OpenSolaris, Solaris, Sun and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>