TCP/IP and Data Communications Administration Guide

DHCP Tables

DHCP uses two types of databases: network tables and a dhcptab configuration macros table. These databases are NIS+ tables if you are using NIS+, or files if you are not using NIS+.

DHCP Network Tables

A DHCP network table contains information related to IP address allocation. Each network has a separate network table. The tables, called dhcp_network tables in DHCP, derive their names from the IP address of the network they serve. For example, the network table for the network 120.146.5.0 is 120_146_5_0, with underscores replacing periods in the IP address notation.

Each subnet in a DHCP network has a dhcp_network table containing entries for the clients in the subnet. When a client boots and a DHCP server answers its request for parameters, information is recorded as a dhcp_network entry for the client. Among other information, the table includes the client's IP address and a pointer into the dhcptab table.

A network table contains the following specific information:

The network table functions as a list of the IP addresses that DHCP servers can assign on a particular network. Each network has its own network table. The key element in the network table is the list of IP addresses. All other elements in the table are significant in relation to the IP address. For example, the client ID identifies the client to which a particular IP address is currently assigned. If the IP address is not currently assigned, then the client ID for that IP address is zero. The expiration time is also zero. When the IP address is assigned, then the client ID and lease expiration time are filled in.

In certain implementations, the client ID becomes the hardware address of the client machine, with a prefix that indicates the network type. For example, a client with an Ethernet address would have 0102608BA614C1 as its client ID, where 01 indicates that the client is an Ethernet network. Other implementations of DHCP may use other identifiers, such as DNS names or property numbers. The important thing is that the client IDs must be unique within the network.

When an IP address is assigned, the lease expiration time for that IP address is set to a specific date and time, or it is marked "No Expiration."

The lease flag and the dhcptab configuration macro name are the same, regardless of whether the IP address is currently assigned to a client. When a client gets a particular IP address, it also gets the type of lease specified by the lease flag and the configuration specified by the property name. The lease flag indicates the conditions under which the IP address can be assigned. The pntadm command manages the dhcp_network table. Example 16-1 shows an example of pntadm output.


Example 16-1 Sample Output: pntadm -P 129.146.86.0

Client ID      Flags Client IP       Server IP       Lease      Macro    Comment
                                                     Explanation

010800207CBA2C  04   129.146.86.153  129.146.86.181  Zero       mrcoffee
0108002022519C  00   129.146.86.205  129.146.86.181  7/3/1996   inet11
01080011043B65  08   129.146.86.29   129.146.86.181  Zero       inet11
0100A024A9BCEE  08   129.146.86.198  129.146.86.181  7/22/1996  inet11 	
0100A024A791DE  00   129.146.86.200  129.146.86.181  8/4/1996   inet11 
0100A02463D6EC  00   129.146.86.199  129.146.86.181  8/1/1996   inet11 
0100A024636AB7  00   129.146.86.201  129.146.86.181  8/3/1996   inet11 
010080C72EE4A3  00   129.146.86.206  129.146.86.181  7/5/1996   inet11 
010020AF4A3B31  0    129.146.86.214  129.146.86.181  Zero       hobbs
00              00   129.146.86.202  129.146.86.181  Zero       inet11	

The dhcptab ConfigurationTable

The dhcptab table contains information related to client configuration. The table is organized as a series of macro definitions that contain all of the information necessary to configure a network client. A client gets its configuration when it is assigned an IP address from the network table. The macro name associated with the IP address corresponds to a macro name in the dhcptab table. After a client gets an IP address from the network table, it gets its network configuration from the dhcptab table.

During the initial configuration of the DHCP server, the dhcptab table is created with macros for each configured network. Each of these macros contains information specific to the network, including subnet mask, network broadcast address, IP packet time to live, maximum datagram size, default router, static routes, DNS domain, NIS domain, DNS servers, and NIS servers, if these are available when the server is configured.

You can control how client machines access a network by changing the information contained in the macros. For example, changing the name of the macro that a particular client machine uses changes the network configuration of that machine. In a different example, changing a single option within a macro changes the reactions of all the machines that use that macro set. The ability to manage IP addresses is one of the major features of DHCP. The dhtadm command manages the dhcptab server configuration table. Example 16-2 shows an example of dhtadm output.


Example 16-2 Sample Output: dhtadm -P

Name         Type    Value

mrcoffee     Macro  :Subnet=255.255.255.0:Router=129.146.86.1:Broadcst=129.146.86.255: \
                    :BootSrvA=129.146.86.175:BootFile="/export/root/JavaDesktop/kona": \
                    :NISservs=129.146.86.33:NISdmain=sunsoft.eng.sun.com: \
                    :DNSdmain=Eng.Sun.COM: \
                    :DNSserv=129.146.1.151 129.146.1.152 129.144.1.57 129.144.134.19: \ 
                    :Include=Locale: \
                    :Timeserv=129.144.1.3:LeaseTim=3600:T1Time=1800: \
                    :T2Time=3060:	

Locale       Macro  :UTCoffst=25200:SN_TZ="PST8PDT":

inet11       Macro  :Include=Locale:Timeserv=129.146.86.181:LeaseTim=259200: \
                    :DNSdmain=Eng.Sun.COM: \
                    :DNSserv=129.146.1.151 129.146.1.152 129.144.1.57 129.144.134.19:

hobbs        Macro  :Subnet=255.255.255.0:Router=129.146.86.1:Broadcst=129.146.86.255: \
                    :BootSrvA=129.146.86.32:BootFile="819256D6.PREP":

129.146.89.0 Macro  :Subnet=255.255.255.0:Router=129.146.89.1:Broadcst=129.146.89.255: \
                    :NISdmain=sunsoft.eng.sun.com:NISservs=129.146.89.33: \
                    :NetBNms=129.146.171.31:NetBNdT=8:

129.146.88.0 Macro  :Subnet=255.255.255.0:Router=129.146.88.1:Broadcst=129.146.88.255: \
                    :NISdmain=sunsoft.eng.sun.com:NISservs=129.146.88.33: \
                    :NetBNms=129.146.171.31:NetBNdT=8:

129.146.87.0 Macro  :Subnet=255.255.255.0:Router=129.146.87.1:Broadcst=129.146.87.255: \
                    :NISdmain=sunsoft.eng.sun.com:NISservs=129.146.87.33: 
                    :NetBNms=129.146.171.31:NetBNdT=8:	

129.146.86.0 Macro  :Broadcst=129.146.86.255:Subnet=255.255.255.0:MTU=1500: \
                    :Router=129.146.86.1:NISdmain=sunsoft.eng.sun.com: \
                    :NISservs=129.146.86.33:NetBNms=129.146.171.31:NetBNdT=8: \
                    :BootSrvA=129.146.86.32:

129.146.85.0 Macro  :Subnet=255.255.255.0:Router=129.146.85.1:Broadcst=129.146.85.255: \
                    :NISdmain=sunsoft.eng.sun.com:NISservs=129.146.85.33: \
                    :NetBNms=129.146.171.31:NetBNdT=8:

129.146.84.0 Macro  :Subnet=255.255.255.0:Router=129.146.84.1:Broadcst=129.146.84.255: \
                    :NISdmain=sunsoft.eng.sun.com:NISservs=129.146.84.33: \
                    :NetBNms=129.146.171.31:NetBNdT=8:

129.146.83.0 Macro  :Subnet=255.255.255.0:Router=129.146.83.1:Broadcst=129.146.83.255: \
                    :NISdmain=sunsoft.eng.sun.com: \
                    :NISservs=129.146.83.33:NetBNms=129.146.171.31:NetBNdT=8:

129.146.82.0 Macro  :Subnet=255.255.255.0:Router=129.146.82.1:Broadcst=129.146.82.255: \
                    :NISdmain=sunsoft.eng.sun.com:NISservs=129.146.82.33: \
                    :NetBNms=129.146.171.31:NetBNdT=8:

129.146.81.0 Macro  :Subnet=255.255.255.0:Router=129.146.81.1:Broadcst=129.146.81.255: \
                    :NISdmain=sunsoft.eng.sun.com:NISservs=129.146.81.33: \
                    :NetBNms=129.146.171.31:NetBNdT=8:

SN_TZ        Symbol Vendor=SUNW,13,ASCII,1,0