urls:
http://www.iana.org/assignments/bootp-dhcp-parameters
The job of DHCP is to allow the automatic assignment of IP addresses and host names to clients on a network when a client machine joins the network. It may also pass up to 117 pieces of information to the client such as the IP address of routers, client name and DNS domain name. Routers themselves may not be configured with DHCP. A DHCP server gives a client the hostname, network broadcast address, network subnet mask, or IP maximum transfer unit (MTU) if requested by a client attached to the same network as the server without having to be explicitly configured to do so.
Benefits of DHCP: DHCP allows a computer to be moved from one subnet to another without typing in a new IP address at the console, and allows automatic assignment of IPs when a new computer is added to the network. This is less work for the administrator and therefore lowers costs. Fewer IP addresses are necessary if some computers are not constantly on the network; they can have IP addresses assigned only when they are online. IP address assignment is flexible, and IPs can be assigned permanently or on a temporary basis. If a business changes ISPs, reassignment of IP addresses happens automatically. If IP addresses are set on a temporary basis, a variable lease time can be set for the client, which the client can renegotiate as it needs, and as the server allows. Once DHCP is configured on a server, there is no need for additional work. DHCP will automatically test to make sure there is no duplication of IP addresses. DHCP can be set to work only for specified clients whose MAC addresses it recognizes. DHCP servers can serve multiple subnets, as long as BOOTP relay routers are set up to pass along DHCP requests.
DHCP download process: When a DHCP client boots to level S on the network, the script /rcS.d/S30networks.sh starts dhcpagent if /etc/dhcp.<interface> exists. Dhcpagent then sends out a message of type DHCPDISCOVER. This packet is broadcast and will be picked up by a server configured either as a DHCP server or as a BOOTP relay. A BOOTP relay is a router which is configured to pass DHCP packets to a DHCP server, on another network. The server selects an IP address to pass to the client, then sends out three ARP requests on the network for a system with that IP address. If there is no response to the ARP requests, the server knows that the IP address is not already in use, and passes it to the client in a message of type DHCPOFFER. The client gets the IP address offer, then sends the server a DHCPACCEPT message, or a DHCPREQUEST message asking for configuration parameters. The server responds with DHCPACK, and the client then sends out one more ARP. Note that the ARP requests are NOT made when downloading a static IP so if your setup erroneously includes a static IP that is also a dynamic IP, you can end up with 2 machines with the same address if the dynamic IP is downloaded, and then the host with the static IP boots.
There may be more than one server on the network configured to download IP addresses to a client, but each must have a different range of IP addresses to assign. The first to respond to a DHCPDISCOVER message will assign the client's IP address.
The boot then finishes, as startup scripts use dhcpinfo to query dhcpagent for configuration parameters, and dhcpagent goes to sleep until just before the lease is due to expire. About a day before the lease is set to expire, dhcpagent can negotiate an extension on the lease with the server if the server allows it. The default lease length is 3 days, but can be changed by the administrator. If the lease extension is denied, the dhcpagent releases the IP address to the server and brings down the interface. When a system gets an IP address, it also gets a hostname, since the host name is just a human version of an IP address. It may be supplied from files, or from NIS+ (NIS is NOT supported in DHCP. You can run NIS with DHCP, but it will not provide configuration information to the DHCP server or client as the ASCII database files or NIS+ tables will do).
A host with multiple interfaces can have them all configured by DHCP. Only one of these interfaces is considered "primary", however, and then only that interface will receive global configuration parameters as the domain name, hostname or timezone. The word "primary" is put in the /etc/dhcp.<interface> file for the interface to be treated as the primary interface. It is not essential to do this, but reduces the possibility of errors when multiple interfaces repeatedly download the same information.
DHCP setup: DHCP clients and servers must both be set up in order to run DHCP. Setup is fairly complicated for the server, and extremely simple for the client. In both cases, a file or files controlling DHCP is set up and a daemon started. For clients the daemon dhcpagent starts: for servers it is in.dhcpd.
Dynamic DNS:
Dynamic DNS is an automated process that allows a DHCP server (which may be the same or a different host) to update a DNS server cache with the current hostname and IP address of a DHCP client. The client must be configured to provide its own hostname with an entry "inet <hostname>" in the file /etc/hostname.<interface>. The hostname is any hostname at all. It does not matter if the IP address is attached to a different hostname in the DHCP server's files. The hostname provided in the client's own /etc/hostname.<interface> file will be assigned to an IP address - usually the first available, unless a permanent address has been assigned that interface - and the system will acquire both. The client file /etc/default/dhcpagent must have the setting REQUEST_HOSTNAME=no commented out.
Jumpstart with DHCP:
Jumpstart with DHCP works mostly the way traditional
Jumpstart does. The difference is entirely in the initiation process that
traditionally begins with the client issuing a RARP. The DHCP server takes over
the process normally provided by the boot server in jumpstart, providing an IP
address as well as other boot parameters to the client. Once the client has an
IP address, the names and IP addresses of the configuration and install
servers, and the locations of the relevant files, Jumpstart proceeds exactly as
usual. A Solaris image or a flash image must be provided, and sysidcfg, rules
and
"profile" files must be supplied in the usual places. Only Ultra
workstations and X86 systems can currently be jumpstarted using DHCP jumpstart.
Jumpstart is no faster with DHCP initiation than with traditional initiation. The main value to using DHCP Jumpstart is that the initial packet sent out by the PROM is a dhcprequest, not a RARP packet. The dhcprequest packet may be picked up by a BOOTP server on the local link, and routed to a DHCP server on another network. In contrast, a RARP packet must be picked up by a Jumpstart server on the local link. Thus, for sites with numerous small networks, DHCP Jumpstart can save a lot of tedious configuration. Only PROMs running version 3.25 or higher of the PROM firmware can send the request for network installation with DHCP.
The second value of DHCP Jumpstart is that you do not need to add and delete specific clients as hosts are added to and removed from your networks, because DHCP will assign an IP address and hostname to a client regardless of its MAC address. DHCP Jumpstart provides support for machine classes of clients - in this class SUNW-Ultra5_10. On the DHCP server the command add_install_client can be run just once with the -d option and the machine type to set it up for Jumpstart. MAC addresses and hostnames need not be included in the add_install_client -d as they were for traditional Jumpstart, although it is possible to set up individual clients in this way for DHCP Jumpstart. As many machines as the server has IP addresses and names can be Jumpstarted, and these clients can be located on any network with a BOOTP server that routes to the DHCP server. Support for a particular MAC address can also be configured into the DHCP databases if a particular IP address and name are desired for that client. Otherwise clients receive randomly assigned IP addresses and their corresponding names from the DHCP servers.
The DHCP server can continue to be used to provide DHCP services to the clients once they have been installed - although additional parameters will be downloaded to the clients at boot time, these will be ignored if the client is not undergoing installation.
In DHCP Jumpstart, IP address, hostname and other boot parameters traditionally stored in /etc/ethers and /etc/bootparams are provided as DHCP parameters by a DHCP server. The client sends the dhcprequest packet when it is booted with the command "boot net:dhcp <sp> - <sp> install." This packet is picked up by a BOOTP relay or by a DHCP server on the local link, and an IP is downloaded to the client, along with a hostname and the parameters normally included in the /etc/bootparams file, such as the location of the sysidcfg file.
That information is used by the client to download its boot program and configuration files, and to begin the installation process, just as in traditional Jumpstart.
On the DHCP server, six new vendor parameters must be defined in the /etc/dhcp/inittab file, and assigned values in the network macro for the DHCP Jumpstart client's network. These vendor parameters are of type SUNW-Ultra5_10 for Ultra 5s and 10s. The parameters provide the names and IP addresses of the install and configuration servers and the location of the files on those servers. The standard parameters Router and BootSrvA providing the router IP for the route to the DHCP server's network and the IP address for the server holding the tftpboot programs for the client must also be defined for the network macro.
Client setup:
Create the file /etc/dhcp.<interface name> for each interface that should be configured by dhcp.
Reboot the system. If the file /etc/dhcp.<interface name> exists at boot time, the file /etc/rcS.d/S30networks.sh will use ifconfig to bring up the interface using DHCP, and will start dhcpagent.
OR
ifconfig <interface> dhcp start
Alternative set up: Initialize DHCP by answering "yes" to the question about DHCP clients during system installation
The daemon dhcpagent is configured by the file /etc/default/dhcpagent. It is not required that this file be configured, however, you probably want to uncomment the variable RELEASE_ON_SIGTERM=yes. This allows the client to relinquish its lease if it runs out and cannot be reconfirmed. The variable REQUEST_HOSTNAME=no must be commented out if you are using Dynamic DNS.
Server setup:
If you want to have one DHCP server providing IP addresses to multiple networks, you must set up a BOOTP relay, and set up a dhcp network file for every network to be served. If you want multiple servers on one network, set each up with a different range of IP addresses to assign.
Run dhcpmgr (GUI) or dhcpconfig (curses), which sets up the files:
/var/dhcp/<network IP with underscores> example: /var/dhcp/128_50_1_0
/var/dhcp/SUNWdhcptab. The dhcp network file may also be configured using pntadm, and the dhcptab file may be configured using dhtadm.
dhcpconfig should be run with the following options:
dhcpconfig -D -r SUNWfiles -p /var/dhcp
Commands:
pntadm writes to the file /var/dhcp/128_50_20_0 (or other).
Requires one of -C -A -M -D -P -R
-C <IP_address of network> creates the file /var/dhcp/128_50_20_0 (or other IP)
-A <IP_address to be assigned to client> <IP of network> Adds the client IP address to the file /var/dhcp/128_50_20_0.
-M <IP address to be assigned to client> <IP of network> Modify the client IP address
-D <macro name> <IP of network> Delete the entry for the named macro.
-P <IP_address of network> <IP of network> Display the table for the network named with time in date and hour format rather than seconds.
-R <IP address of network> <IP of network> Remove the file /var/dhcp/128_50_20_0 (or other).
-r <SUNWfiles|SUNWbinfiles||nisplus> override the resource type specified in /etc/default/dhcp for the client being specified, and use the type listed after r.
-p <pathname> override the default value for the path to the network file listed in /etc/default/dhcp, and instead use the value listed. This may either be a path beginning with / for files, or a nisplus directory resource name.
-m <macro_name> (?)
-f <flag, in names concatenated with a +, or numerical values as a single digit, added together.> flag to associate with the IP address listed for clients.
dhtadm writes to the file /var/dhcp/dhcptab.
Requires one of -C -A -M -D -R
-C <no argument> Create the file /var/dhcp/dhcptab
-A <no argument> Add a symbol or macro definition (must also use -s -m or -d)
-M <no argument> Modify a symbol or macro definition
-D <no argument> Delete a symbol or macro definition
-R <no argument> Remove the file /var/dhcp/dhcptab.
-s <symbol name> name of symbol
-d <definition> must be used with s or -m. defines the symbol with a list
of 5, comma separated, items surrounded by quotes:
context,code,type,granularity,maximum
-m <macro name> name of macro
-r <files|nisplus> override the resource type specified in /etc/default/dhcp for the client being specified, and use the type listed after r.
-p <pathname> override the default value for the path to the network file listed in /etc/default/dhcp, and instead use the value listed. This may either be a path beginning with / for files, or a nisplus directory resource name.
-e <symbol=value> sets the value of a symbol. Must be used with -m
dhcpconfig - configures a DHCP server
-D - create a DHCP server
-r <datastore> - specify the format in which data should be acquired: SUNWfiles,
SUNWbinfiles or SUNWnisplus. SUNWfiles is the ordinary ASCII
database files, SUNWbinfiles is binary files (faster, but hard to see
what's happening), SUNWnisplus is nisplus maps.
-p <location> - specify where the DHCP data should be placed. Default is
/var/dhcp. For nisplus, this is a NIS+ table name.
-L - list current dhcp_network files - use this when adding a network to serve.
EXAMPLES
Creating a symbol called "junk," contained in /var/dhcp/dhcptab.
dhtadm A s junk
d 'Site,220,ASCII,1,1' r
files p /var/dhcp
Adding a value to an existing macro called stuff:
dhtadm -M -m
stuff -e 'junk=nothing'
snoop udp dhcp - snoop dhcp packets used for troubleshooting DHCP (look for DHCPREQUEST and DHCPACK.
snoop port 67 same as snoop udp dhcp. dhcp ports: 67:server 68:client
dhcpagent d3 debug mode for the dhcp client daemon.
in.dhcpd -v -d -i <interface> verbose debug mode for the dhcp server daemon.
/etc/init.d/dhcp stop|start stop or start dhcp server daemon
ifconfig <interface> dhcp start start dhcpagent on the client for the interface specified.
ifconfig -a shows if a system is running as a dhcp client.
ifconfig <interface> dhcp status print out lease info on current host, including whether the client has a DHCP IP address, how many times the client requested an IP address assignment, how many times the server replied, and how many times the client rejected an assignment; whether this is the primary interface; and the times when the lease was started, when it expires, when dhcpagent tried to or will try to renew it.
ifconfig <interface> dhcp inform print out DHCP parameter information on client.
ifconfig <interface> dhcp release release the IP address on a client and bring down the interface.
ifconfig <interface> dhcp drop bring down the interface on the client but do not inform the server that you are releasing the IP address. This allows you to reboot (for example) without losing the IP address.
ifconfig <interface> dhcp ping tests whether the interface is under the control of dhcp.
netstat -D - provides status of DHCP configured interfaces
dhcpinfo <parameter> - queries for the value of the named parameter, where the parameter is a defined symbol or the numeric code associated with that symbol, as listed in the file /etc/dhcp/inittab, or /var/dhcp/dhcptab.
in.dhcpd -r <IP of server> - start dhcp daemon on BOOTP relay server.
Definitions:
dhcpagent the DHCP daemon which runs on the client and allows the client to renegotiate its lease on an IP address when that lease (by default 3 days) runs out. Communication with dhcpagent is done through ifconfig . It can also be invoked directly.
The command dhcpagent runs when the client configures itself
for DHCP at which time it
requests an IP address, and again when the lease is about to expire. If the lease cannot be renewed, dhcpagent brings the connection down. It also acts as a database which may be queried by applications such as dhcpinfo for information other than the IP address, such as router addresses, domain name, client name, timeserver, DNS domain name, DNS server, IP addresses etc. dhcpagent also designates one interface as the "primary" interface, which is the one to which all global parameters may be assigned. In the case in which a client has more than one interface, this prevents conflicting information from being downloaded to the different interfaces.
dhcpinfo the utility which queries dhcpagent for the value of DHCP options (hostname, DNS server etc) stored by dhcpagent. It is invoked using dhcpinfo <name of parameter>, generally in a shell script. Two scripts which are set up to use dhcpinfo by default are /etc/init.d/inetsvc and /etc/init.d/inetinit.
in.dhcpd the DHCP daemon which runs on the server.
dhcpconfig utility which configures server and database, determines the database location, and initalizes the files dhcptab and dhcp_network. It may also set up hostnames based on the server name for assignment. It is a front end for dhtadm and pntadm.
/usr/sadm/admin/bin/dhcpmgr a GUI that configures the server and databases. It is a front end to dhtadm and pntadm and dhcpconfig. The first time it runs, it configures the server as a dhcp server.
lease the right to use an IP address, given to a DHCP client. When a lease expires, if LeaseNeg has been included in the client's dhcptab entry, the client can renew its lease. If not, the server reclaims the IP address, and returns it to the pool of available IP addresses. Otherwise, the lease is relinquished when the client leaves the network.
BOOTP the predecessor to DHCP, compatible with DHCP. BOOTP is used by diskless clients, and allows a client to download information about itself, including its IP address and a boot program. It is also used by JumpStart clients, which get their IP address from a local boot server via RARP, but get other configuration parameters from a BOOTP server. It can be used as an adjunct to DHCP, since they share many formats, and also share the same port, 67.. Unlike DHCP, BOOTP cannot recover and reallocate the IP address assigned, nor does it test for duplication of IP addresses. It allows only one static IP per MAC address.
BOOTP table a table on the BOOTP server, containing entries with the MAC address and static IP to be assigned to each supported client.
option/symbol - an option, also known as a symbol, is a definition of a piece of information which can be passed to a DHCP client by a DHCP server. An option is defined by its number, name, type of data in it etc. An option/symbol is assigned a value in a macro in the file /etc/dhcp/dhcptab.
macro a set of symbols with assigned values. These are defined in /etc/dhcp/dhcptab.
Primary server- a server which passes IP addresses directly to a client. The addresses which a server can pass to a client are specified when the software is installed and configured.
Secondary server- a server which confirms configuration parameters already supplied by a primary server. Thus, if a primary server is down, a secondary server can extend the lease. The primary server does this job, so also acts as a secondary server. A non-primary secondary server gets its file information from either NIS+ or from NFS shared files on the primary server.
Acronyms:
DHCP Dynamic Host Configuration Protocol
UTC Universal Time Coordinated
BOOTP BOOTstrap Protocol the protocol which preceded DHCP. BOOTP allowed for the download of static, unreclaimable IP addresses and other configuration information. This type of server is still used for JumpStart.
Files: client
/etc/dhcp.<interface> - example: /etc/dhcp.hme0.
- An empty file by this name must be created for each interface to be
configured by DHCP. It may also contain the entries "primary" and
"wait", where primary indicates that this interface is the primary
one of several and it is to this interface that global configuration parameters
are assigned, and wait plus a value in seconds, or the word "forever"
indicates how long the client should wait for a response to its dhcp request
before continuing the boot. Default: 30 seconds.
/etc/default/dhcpagent configuration file for DHCP. Contains (among others)
PARAM_REQUEST_LIST= 1,2,3,4 (or other option identifiers) - lists the options for which the client requests values. This is in addition to those automatically downloaded by the server with a macro.
RELEASE_ON_SIGTERM=no keep IP address attached to hme0 even if the client system goes down. yes release address if interface goes down. If the IP address is not released, information written to /etc/dhcp/<interface>.dhc allows the client to boot up and recommence using the same IP address.
REQUEST_HOSTNAME=yes - get a hostname from the DHCP server. This must be commented out for Dynamic DNS updates to occur.
/etc/dhcp/<interface.dhc> - the file to which dhcpagent writes system configuration information when the system goes down prior to the expiration of the lease. When the client boots, it will send an abbreviated DHCP request to the server, then use information from this file to reboot, rather than from the server. It is not written if the variable RELEASE_ON_SIGTERM=no is set in the file /etc/default/dhcpagent.
Files: server
/etc/inet/dhcpsvc.conf - DHCP server configuration file - created by configuration utilities. Do not edit.
/etc/dhcp/inittab (man -s 4 dhcp_inittab new in Solaris 8, replacing dhcptags) File which contains definitions (but not values) of variables, also known as DHCP options, or "symbols", that can be downloaded to DHCP clients. These are such items as Name Server, DNS domain name, Interface MTU, and hostname. The first and second entries in this file are separated by whitespace, and all others are separated by commas. This file is designed to replace the multiple locations for dhcp symbols used in older versions of Solaris. Symbols should be added to THIS file, even though they can be added to the dhcptab file.
Entries:
<symbol_name> <context> <symbol number> <type> <granularity> <maximum>
symbol name a alphanumeric alias for the symbol, for use by humans with dhcpinfo.
context: the type of symbol:
STANDARD These symbols are universal in all DHCP implementations and their values, which range from 1 to 127, are assigned by IANA. See RFC 1700 for a complete list up to 64. Standard symbols may not be edited, as their definitions are part of the source code. New standard symbols may be added in preference to upgrading the operating system; these symbols are defined in the RFCs.
SITE These symbols are defined at a particular site and may vary from site to site. Their values range from 128 to 254.
VENDOR an option that applies only to clients with particular types of hardware or platform, or which is specified by a vendor. Only the clients of the type specified will receive these options from the server. To get the client platform type for a machine, type" uname -i " and substitute periods for commas in the output. For example, an Ultra 5 machine's client type will be SUNW.Ultra5-10. x86 machines have the client type SUNW.i86pc. Multiple client types may be specified for a particular option. A vendor may define 254 vendor options numbered from 1 to 254. Vendors are determined by the variable "vendor_type" which is field 60.
FIELD a category allowing the fields to be aliased to names.
INTERNAL These are internal to Sun's DHCP code.
symbol number the actual identifier for the symbol, from the ranges listed above.
type may be one of
IP an IP address
ASCII ascii characters
UNUMBER8,UNUMBER16,UNUMBER32
OCTET
BOOLEAN
various numerical designators
*NUMBER* is any unsigned number of the length specified, OCTET is a hexadecimal value, like a MAC address. BOOLEAN has no value; if the option is present, the condition is true, if the option is absent, the condition is false. Example: If the hostname option is present, a hostname should be assigned, and the server looks in /etc/hosts for the value. No value is assigned to "hostname" however, since it will vary with every client.
granularity the number of objects (as defined in the type field) that make up one symbol. For example, a static route is made up of 2 IP addresses, so the granularity of the static route symbol is 2.
maximum how many values the symbol can have in a macro. 0 means unlimited. For example, there can only be one netmask, so the maximum for a netmask symbol will be 1.
visibility which dhcp related programs can read the value of this option. sdmi means: snoop, in.dhcpd, dhcpmgr, dhcpinfo.
Example: An options which designates pairs of IP addresses:
IpPairs SITE, 132, IP, 2, 0, sdmi
The name used with dhcpinfo is IpPairs. This variable is defined only at the site, and its number is 132. The format of the items in the option is an IP address, and each item consists of 2 IP addresses. There is no limit number of values the option can have.
/var/dhcp/SUNWfiles1_dhcptab (for text files) managed with dhtadm - the file on the server which contains macros, vendor and site specific symbols, or new standard symbols, whose definitions have been added to dhcp since the time the OS was released. You can find information on new standard symbols in the RFCs.
Format for symbol entries in the dhcptab (format is not exact):
Name Type Value
Where
Name is the name to be given the symbol
Type is "s" indicating a symbol
Value is:
symbol_name=context,code,type,granularity,maximum. The symbol fields in /var/dhcp/dhcptab are the same as those in /etc/dhcp/inittab, except for the context field. . The context field may also be "site" for a site-specific option, or "vendor=<client type>" for an option which applies only to a particular type of client. The context field may also be "extend," for a new standard option. A new standard option is an option added to the IANA list since the OS was written. When new versions of the OS come out, any symbols accepted by IANA are included, so if you have a reasonably new version of the OS, you need not concern yourself with new standard options. The acceptable symbol type values are ASCII, IP, BOOLEAN, OCTET, NUMBER, as in /etc/dhcp/inittab.
Symbol entries:example of a static route to be added to the routing table:
routesymbol s Site,134,IP,2,0
This site-specific symbol is assigned the number 134, and consists of sets of 2 IP addresses. As many pairs of IP addresses as the administrator wants can be included in a definition of this symbol. Note that the symbol is only defined here, no values are assigned to it. Values are assigned to symbols only in macros.
Macros:
Macros are collections of symbols of any kind with assigned values. . The symbols used to make up the macros are those defined in /etc/dhcp/inittab or the dhcptab and the values are whatever the administrator wants to set. Macros allow the administrator to assign values to symbols and to group symbols for use in downloading configuration parameters to DHCP clients. Macros may be specifically assigned to a set of addresses, in the file /var/dhcp/<dhcp_table> (like /var/dhcp/SUNWfiles1_128_50_1_0) and will be then downloaded to any client receiving one of those addresses. Macros with specific types of names may also be automatically downloaded to clients. A macro whose name is a network address will be automatically downloaded to any system on that network. A macro named for a particular client will be downloaded to that client. The name for the client is in the form of the MAC address without colons: a macro named 080020ae9b98 will automatically be downloaded to the host with the MAC address 8:0:20:ae:9b:98. A macro named after a machine type will be automatically downloaded to any client of that machine type. For example, the macro named sunw.ultra5_10 will be downloaded to any Ultra 5 or 10 system when it boots. A server will return the hostname, network broadcast address, network subnet mask, or network maximum transfer unit (MTU) to a client attached to the same network as the server without those items being explicitly configured in the dhcptab.
Macros are downloaded to clients in the order: 1) class of client (such as SUNW-Ultra5_10) 2) network address 3) macros mapped to specific IP addresses in the file /var/dhcp/<dhcp_table> 4) macros mapped to specific clients.
Macros may be made up of options/symbols (as defined in this file, the file /etc/dhcp/inittab, and RFC 1700), previously defined macros or a combination of both. If this file is changed, the daemon in.dhcpd must be forced to reread it with /etc/init.d/dhcp stop|start.
Format of macro entries in the dhcptab (format is not exact):
Name Type Value
Name the name of the macro, which can be listed under " Macro" in the file /var/dhcp/<dhcp_table> and will then be downloaded to any client which fits that entry. The macro name may be chosen by the administrator, and assigned to all downloads of a particular type. Generally three types of DHCP macros are created by default: one named after the network address, which is downloaded to all clients on that network, one named after the server, and downloaded to all clients of that server, and one called "locale", containing only the UTCoffst= <offset in seconds from UTC>. This last macro is included in the server macro, along with the time server, lease policy information and DNS server and domain name information. The network macro usually has network specific information such as the network broadcast address, subnet, and MTU, but may also have lease information. The system administrator may change any of these macros. If the default setup is used, the file /etc/init.d/dhcp is added to configure the system using these parameters using dhcpinfo.
Type "m," indicating a macro, which is a set of symbols and their values.
Value the actual option/value pairs that make up the macro, in the format symbol=value:symbol1=value1:symbol2=value2: macro1:macro2: etc.
Macro entries: typical examples for a server "phoenix" in Pacific Daylight Time:
Locale m :UTCoffst=-25200:
128.50.1.0 m \
:Broadcast=192.21.20.255:Subnet=255.255.255.0:MTU=1500: \
routesymbol=192.21.20.3 192.21.20.4:
phoenix m \
:Include=Locale:Timeserv=192.21.20.3:LeaseTim=259200: \
LeaseNeg: DNSdmain=ebay.sun.com:DNSserv=192.21.20.3:
The macro "Locale" contains only the time zone, set by UTCoffst= <the difference in seconds between the local time and Universal time> - when you calculate this, go negative west from Greenwich, England to the International Dateline, and positive east from Greenwich to the Dateline). The value "-25200" is seven hours west of Greenwich, England, stated in seconds (aka Pacific Daylight Time).
The macro 128.50.1.0 will be downloaded first to any client on the 128.50.1.0 network, with the following configuration parameters:
Broadcast=192.50.1.255 this is the broadcast address for this network.
Subnet=255.255.255.0 the netmask for this network
MTU=1500 this is an Ethernet 2 network, with an MTU of 1500.
routesymbol a symbol defined by the system administrator containing a default route to be added to the routing table.
The macro phoenix is downloaded to any client whose configuration statement in the dhcp_network file includes the name "phoenix." Although this macro is not automatically downloaded, by default a similar file is placed in every configuration statement in the dhcp_network file. It will be downloaded after the network macro is downloaded, with the following parameters:
LeaseTim=259200 (3 days in seconds) or other value in seconds this represents the maximum time the client can hold a single IP address.
LeaseNeg - client can negotiate for an additional LeaseTim seconds after the first lease is up. The symbol "LeaseNeg" is a Boolean, so if it is present, the client is allowed to get an extension on its lease, and if it is not present, the client cannot get an extension.
Include=Locale- a macro called "Locale" is included in this macro. The macro "Locale" must already have been defined in the dhcptab file.
TimeServ=192.21.20.3- IP address of the timeserver.
DNSdmain=ebay.sun.com - DNS domain name
DNSserv=192.21.20.3 name of the DNS server.
/var/dhcp/SUNWfiles1_128_50_1_0 (or other network IP address in the same format, for text files) the dhcp_network file - a dynamic database which contains the information used to map a client to an IP address and to any configuration parameters to be passed to that client, and which is updated by the server with assignment information for each IP address when it is in use by a client. This file is administered using pntadm, dhcpmgr or dhcpconfig. One such dhcp network file must be set up for every network served by the server. The name for this file comes from the file /etc/netmasks. This file may be stored in either text file or binary format.
Entries include (format is not exact):
Client_ID Flags Client_IP Server_IP Lease Macro
Client_ID identifies the DHCP client: Possible entries:
00 any client
01+MAC address a client has this address. It has a 10mbps ethernet port (01) and the specified MAC address; each octet in the MAC address must have 2 places. The entire entry is concatenated together without spaces in the form demonstrated by 010800209b0d45.
Flags indicates the type of lease.
0 dynamic lease is temporary and will be re-evaluated after a period of time.
1 permanent lease is permanent, and only the client specified will use that IP.
2 manual put in specifically for the client with the MAC address listed in Field 1
4 unusable - another host is using this address. With manual flag prevents the client listed under Client_ID from booting.
8 BOOTP system is a BOOTP server.
If the administrator wants to provide a permanent lease for a particular client, the flags would be 2 (manual) + 1 (permanent) or 3.
Client_IP the IP address to be allocated
Server_IP the IP address of the server these entries are also used by secondary servers, so this value indicates which is the primary server for the entry.
Lease this holds the expiration time in seconds since the epoch (Jan 1 1970) in either decimal or hexadecimal notation once a address is assigned. A permanent lease is noted as -1. A lease of 0 indicates that the IP address is currently unassigned. The lease is determined by adding the LeaseTim value from the appropriate macro in the dhcptab to the time the lease is assigned.
Macro a dhcptab macro name. It is used to look up the configuration parameters in the dhcptab database.
Standard shell comments may be included anywhere in this file following the #.
/etc/inet/dhcpsvc.conf configuration file for the DHCP service. It has 2 important parameters
RESOURCE=files|nisplus default: files
PATH=<path to tables> default: /var/dhcp
PATH should contain either the path to the files used to store DHCP configuration information, or the path to the nisplus resource.
BOOTP relays also have:
RUN_MODE=relay (default is server).
RELAY_DESTINATION=<IP of DHCP server> - used only if RUN_MODE is set to relay.
This file is configured by the dhcpconfig utility. It determines whether NIS+, binary or ASCII database files on the server are used to store DHCP data. It is dynamic, and entries change as they are used.
Misc:
Troubleshooting DHCP:
1.snoop DHCP and look for DHCPREQUEST and DHCPACK.
snoop udp dhcp
2. Run the client daemon in debug mode:
pkill dhcpagent; /sbin/dhcpagent d3
3. Run the server daemon in debug mode:
/etc/inet.d/dhcp
stop
/usr/lib/inet/in.dhcpd
-i <interface> -d -v
How to configure a DHCP client
touch /etc/dhcp.<interface name>
ifconfig
How to configure a DHCP server
dhcpmgr
OR
dhcpconfig
create /dhcp/var/128_50_1_0 (or other network number in the same format)
create /dhcp/var/dhcptab
create /etc/default/dhcp
Sequence of DHCP startup packet transmission:
1. DHCPDISCOVER from client
2. 3 ARPS from server to check if theIP is already in use.
3. DHCPOFFER from server
4. DHCPACCEPT from client
OR
4.DHCPREQUEST from client, asking for download of configuration parameters.
5. DHCPACK from server with parameters.
6. 1 ARP from client to check if IP is in use.