08-04-2003
Setting up a DHCP client on Solaris
Introduction :
If you are trying to set up DHCP on a Solaris box, this could be just what you're looking for! For example, if you're trying to get your Sun workstation (or PC running Solaris x86) to talk to your cable modem, but your hostname gets set to "unknown", this document will tell you how to get round that.
Throughout this page, I'll assume that you're using le0 for your DHCP connection. Substitute hme0 (or whatever interface you do use) in the examples below.
Setting up a DHCP client
There are two ways of using DHCP:
DHCP has limited control
DHCP has full control
The first case may be where you want to set your own /etc/resolv.conf and so on, with a minimum of hassle.
The second case would be the normal situation, especially if your cable modem provider has a habit of changing DNS name server IP addresses on you (like mine does!), so I'll concentrate on that here. You'll need to change the DEFAULT_ADDR and INTERFACE variables as required.
The first thing to do is to create an empty /etc/hostname.le0; I use touch:
# touch /etc/hostname.le0
Another way of creating the file is to simply say:
# > /etc/hostname.le0
The latter method will work even if /etc/hostname.le0 already exists on your system. Creating this file ensures that the interface gets plumbed, ready for the DHCP software to do its stuff.
Next, you create /etc/dhcp.le0. This file can be empty if you want to accept the defaults, but may also contain one or both of these directives:
wait time, and
primary
By default, ifconfig will wait 30 seconds for the DHCP server to respond (after which time, the boot will continue, while the interface gets configured in the background). Specifying the wait directive tells ifconfig not to return until the DHCP has responded. time can be set to the special value of forever, with obvious meaning. I use a time value of 300, which seems to be long enough for my cable provider.
The primary directive indicates to ifconfig that the current interface is the primary one, if you have more than one interface under DHCP control. If you only have one interface under DHCP control, then it is automatically the primary one, so primary is redundant (although it's permissible).
With these files in place, subsequent reboots will place le0 under DHCP control: you're ready to play!
Actually, there's one snag: most (if not all) cable modem DHCP servers don't provide you with a hostname (even if they did, odds are it won't be one you want anyway!). This wouldn't be a problem, except that the boot scripts (/etc/init.d/rootusr in particular) try to be clever, and set your hostname to "unknown" in this case, which is not at all useful!
The trick is to change your hostname back to the right one, preferably without changing any of the supplied start up scripts, which are liable to be being stomped on when you upgrade or install a patch. You've also got to do it early enough in the boot process, so that rpcbind, sendmail and friends don't get confused by using the wrong hostname. I put this little script in to /etc/init.d/set_hostname, with a symbolic link to it from /etc/rc2.d/S70set_hostname to solve this problem.
With these modifications in place, reboot, and you'll be using your cable modem in no time!
so long...
greetings Preßy
10 More Discussions You Might Find Interesting
1. IP Networking
Hello all, I have this Intel Pentium 233/128 running Solaris 8. I also have a dhcp/router/dns running SuSElinux 7.2.(Sorry if it is out of topic here) My problem is that the Solaris box when it tries to configure the interface (elxl0) via dhcp it fails. It appears, according to the... (1 Reply)
Discussion started by: jdevarie
1 Replies
2. UNIX for Dummies Questions & Answers
When using DHCP how can I can my hostname. I vi all the hosts file and if still didn't work. So now my hostname is unknown and I want to change it. So if anyone out there can help me. Thank You (6 Replies)
Discussion started by: aojmoj
6 Replies
3. UNIX for Dummies Questions & Answers
HI,
New to Unix and I inherited a network that runs DHCP in manual configuration mode. Basically, in order for a machine to get an IP it has to have an entry in dhcpd.conf with its MAC address mapped to a hostname (the hostname then maps to an IP address listed in the DNS db file). If there is... (2 Replies)
Discussion started by: NJay
2 Replies
4. UNIX for Advanced & Expert Users
Last question for today!! :rolleyes:
In what file does the DHCP server keep its list of leases?
THANKS!!! :)
Maria from Maria (2 Replies)
Discussion started by: marjeg
2 Replies
5. Solaris
Can someone help me with this please. I am new to this:
I am trying to install Solaris 8 over the network using my DHCP. After I type the comman:
./add_install_client -d -e 8:0:20:7e:97:51
I would get something like this:
cleaning up preexisting install client "8:0:20:7e:97:51"... (0 Replies)
Discussion started by: aliban83
0 Replies
6. IP Networking
can I request for an ipaddress through dhcp client by sending ipaddress as input during the invokation of dhcpclient so that it requests the server for the same,instead of depending on the configuration file . (3 Replies)
Discussion started by: Gopi Krishna P
3 Replies
7. UNIX for Dummies Questions & Answers
Hi All,
I am trying to configure dhcp server on a linux host with eth0:1 which is using 192.168.1.10
I also want to restrict my DHCP client to just one Host adcnew222.
DHCP Server Host name - adcnew111
DHCP client name - adcnew222
My conf file is as follows on dhcp server :
... (2 Replies)
Discussion started by: sriram003
2 Replies
8. IP Networking
Dear Experts,
I have a TI DM8148 EVM board REV C, the EZSDK5.05 SW package, and DVRRDK1.09 SW package.
EZSDK5.05, DVRRDK1.09 both use Linux2.6.37, however, there are some modifications between these two kernels.
When I use uImage of DVRRDK1.09 to boot up EVM board, this board can be given a... (0 Replies)
Discussion started by: oobin168
0 Replies
9. IP Networking
Hi All ,
please view the set up below:
-------------------------------------------------------------------
| DHCP Server |-----------| ROUTER & |-----------| Clients |
| 192.168.99.1 | - -<eth1>| DHCP-RELAY|<eth2>-- | 192.168.88.X |
... (2 Replies)
Discussion started by: gdangoor
2 Replies
10. IP Networking
I have a DHCP thing on my HP printer. How can I find information on numbers for that? (2 Replies)
Discussion started by: teak
2 Replies
LEARN ABOUT LINUX
dhcpmgr
dhcpmgr(1M) System Administration Commands dhcpmgr(1M)
NAME
dhcpmgr - graphical interface for managing DHCP service
SYNOPSIS
/usr/sadm/admin/bin/dhcpmgr
DESCRIPTION
dhcpmgr is a graphical user interface which enables you to manage the Dynamic Host Configuration Protocol (DHCP) service on the local sys-
tem. It performs the functions of the dhcpconfig, dhtadm, and pntadm command line utilities. You must be root to use dhcpmgr. The dhcpmgr
Help, available from the Help menu, contains detailed information about using the tool.
USAGE
You can perform the following tasks using dhcpmgr:
Configure DHCP service
Use dhcpmgr to configure the DHCP daemon as a DHCP server, and select the data store to use for storing network configuration tables..
Configure BOOTP relay service
Use dhcpmgr to configure the DHCP daemon as a BOOTP relay.
Manage DHCP or BOOTP relay service
Use dhcpmgr to start, stop, enable, disable or unconfigure the DHCP service or BOOTP relay service, or change DHCP server parameters.
Manage DHCP addresses
Use dhcpmgr to add, modify, or delete IP addresses leased by the DHCP service.
Manage DHCP macros
Use dhcpmgr to add, modify or delete macros used to supply configuration parameters to DHCP clients.
Manage DHCP options
Use dhcpmgr to add, modify or delete options used to define parameters deliverable through DHCP.
Convert to a new DHCP data store
Use dhcpmgr to configure the DHCP server to use a different data store, and convert the DHCP data to the format used by the new data
store.
Move DHCP data to another server
Use dhcpmgr to export data from one Solaris DHCP server and import data onto another Solaris DHCP server.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
non-zero An error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWdhcm |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
SEE ALSO
dhcpconfig(1M), dhtadm(1M), pntadm(1M), in.dhcpd(1M), dhcpsvc.conf(4), dhcp_network(4), dhcptab(4), attributes(5), dhcp(5), dhcp_modules(5)
Solaris DHCP Service Developer's Guide
System Administration Guide: IP Services
SunOS 5.10 13 Mar 2001 dhcpmgr(1M)