!!! Do you know that Sun decided to defer Solaris on Intel ? For more information : go Save Solaris x86

Set up Solaris as a DHCP client

This article is from Solaris On Intel Mailing List.

This practise was done on Solaris 2.7

Setting up a DHCP client is not difficult. However, it sometimes may take you time to configure out where the problem is, and it turns out that the problem is at the DHCP server, not the client. Hope that it only happens to me, who have not prepared enough knowledge of DHCP before installing a DHCP client.

1.Two important files

Assuming your Solaris box have only one NIC, and your NIC has been detected and plumbed sucessfully, now you need to have to create two files : /etc/hostname.nic-name and /etc/dhcp.nic-name.

Take care : the part hostname. and dhcp. should be "hostname." and "dhcp.". Don't replace them by any name. And nic-name is the driver name for your NIC.

For example, in my Solaris box, I use a 3Com 3c509 network card, then its driver name will be elx0. Then the two corresponding file will be /etc/hostname.elx0, and /etc/dhcp.elx0. You can create these files by

#touch /etc/hostname.elx0 #touch /etc/dhcp.elx0 Then, when booting, you will see a message similar to Starting DHCP on primary interface elx0 It seems very easy. I don't know how easy to you, but the first time I installed, I could get the ip address from the DHCP server, but my Solaris box always reported : "hostname: unknown", and in the /etc/hosts of the Solaris client, I had one line:

.... 192.168.3.100 unknown # Added by DHCP

The problem here is the DHCP server should allocate the parameter "Hostname". After adding the hostname parameter to the DHCP server, everything seems ok, at least to me. In /etc/hosts, you will see the line
.... 192.168.3.100 neptune_100 # Added by DHCP

If you want to use Windows NT 4 as DHCP server, look at Windows NT problems and fixes for NT DHCP server when allocating names ( DHCP option 12 ) to clients.

2.Checking the parameters for the DHCP client

You can check the parameters the client receives by using dhcpinfo ( Be sure that /sbin is in your PATH, or you should use /sbin/dhcpinfo).. This command has many options, but for the sake of simplicity, ( and I assumed that our Solaris box has only one nic ), we can use it as

#dhcpinfo option-name

with option-name is the name of the option that the DHCP server allocates to this client.

For a small network, the following options may be enough :
- Default router : option name is Router - DNS server : option name is DNSserv
- Domain name : option name is DNSdmain - Hostname : option name is Hostname

#dhcpinfo Router
192.168.3.56

#dhcpinfo DNSserv
206.109.1.1
206.109.7.65
Use 'man dhcptags' to find all possible default option names.

3. How about /etc/resolv.conf with DHCP ?

We already know that /etc/resolv.conf supports domain name and nameserver in the case of using static ip address. How about it for DHCP client ? If DHCP server supports domain name and/or name servers:
*If /etc/resolv.conf exists, it will be overwritten with new values.
*If it does not exist, it will be created.