For When You Can't Have The Real Thing
[ start | index | login ]
start > Sun > DHCP server

DHCP server

Created by dave. Last edited by dave, 11 years and 70 days ago. Viewed 9,536 times. #6
[diff] [history] [edit] [rdf]
labels
attachments

Creating a Sun DHCP Server

Comment:

The Sun GUI DHCP server on Solaris 9 is hopelessly broken. I have wasted a day of time trying to create a scope for the network 10.1.0.0/24, only to be told every time that it is missing a table for 10.0.0.0.

root@sun5:/tmp$ pntadm -A 10.1.0.6 -c "sun6-tn" -i 010003BA10DEA9 -m sun5 -y 10.1.0.0
pntadm: Table for 10.0.0.0 does not exist.

I am not trying to create a table for 10.0.0.0, I want one for 10.1.0.0/24. I've set /etc/netmasks, and nothing. This piece of junk obviously has some hard-coded assumptions about netmasks that are making it impossible to work with. Get the ISC dhcpd; in the long run, you'll be glad you did.

Using the dhcp manager:

  1. Set your X display.
  2. As root:
    # /usr/sadm/admin/bin/dhcpmgr
  3. Define your server options.
  4. Create a network to add leases to.
  5. Reservations:
    # pntadm -A $IPADDR -c "$COMMENT" -i $ID -m $MACRO -y $NETWORK
    where:
    ParameterMeaning
    -A $IPADDRadd the ipaddress $IPADDR as the reserved IP
    -c "$COMMENT"a comment describing this computer
    -i $IDthe client identifier, usually 01$MAC, where $MAC is the computer's ethernet address, without colons, any letters in the MAC must be CAPS
    -m $MACRO -ythe set of lease options to use (routers, DNS servers, lease timeouts etc), in most cases this defaults to the name of the dhcp server
    the -y parameter checks that the specified macro exists before adding the client defintion
    $NETWORKthe network to add this reservation to
    eg:
    # pntadm -A 10.0.1.7 -c "netra 7" -i 010003AB107785 -m sunserver -y 10.0.1.0
Doing Things Through The Command Line:

(This section heavilly based on >>this page.)

  1. 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
    Note that this step started the dhcp server for me before I wanted it started, so I had to manually stop it:
    # /etc/init.d/dhcp stop
  2. create a macro for our local network ( the one we will serve IP addresses for) in dhcptab
    # dhtadm -A -m 10.1.0.0 -d ':Broadcst=10.1.0.255:Subnet=255.255.255.0:MTU=1500:'
  3. Create the local network table
    # pntadm -C 10.1.0.0
  4. Add a reservation:
    # pntadm -A 10.1.0.6 -c "sun6-tn" -i 010003BA10DEA9 -m sun5 -y 10.1.0.0
    Repeat as desired.
  5. Add a nonreserved address:
    # pntadm -r SUNWfiles -p /var/dhcp -A 10.1.0.90 10.1.0.0
    Repeat as desired.
  6. Start your dhcp server:
    # /etc/init.d/dhcp start
Done!

More Comment: Note that this example is precisely the situation I was complaining about at the top of the page and it all works properly. It does create the table as /var/dhcp/SUNWfiles1_10_0_0_0 (not SUNWfiles1_10_1_0_0 as you might expect) but it does have the correct networking information inside it). How this might affect your ability to serve addresses in a neighbouring scope (ie another subnet of the 10/8 network) I don't know, but this method works for me. Overall, though, I'd personally stick with the ISC DHCPD wherever possible.

Clearly the problem is with the GUI administration tool's wizard not being able to create the correct table file for you when you enter a non-standard network base. This is probably a bug. (Question for any (or all) of my Sun readers -- how do I go about verifying/reporting this bug? dave@xdroop.com)

Update 0710.11:

Email from Catherine Button:

Having run into this problem myself, here's how I fixed it AND was able to use a whole bunch of different 10.x.x.x subnets on the dhcp server:

Change the netmasks file on the machine /etc/netmasks so that this entry is first:

10.0.0.0        255.255.255.0
AND ALSO change the netmasks file in NIS(nisplus)if you use that, even if it's not first in nsswitch.conf

Presto, gui works, file names back to normal.

Unconfirmed by me (our need for the Sun DHCP server has gone away), but useful to know for the future.
no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt