DHCP enables you to automatically assign reusable IP addresses to DHCP clients. This document provides an example for how to configure DHCP options such as the Domain Name System (DNS) and Windows Internet Name Service (WINS) addresses, to respond to DHCP requests from local clients behind the customer premises equipment (CPE).
Previously, network administrators had to manually configure the Cisco IOS® DHCP server on each device enabled with this feature. After a router is deployed, it is labor-intensive, time consuming, and expensive to go to each location and make modifications.
Consequently, the Cisco IOS DHCP Server was enhanced in order to allow configuration information to be updated automatically. Network administrators can configure one or more centralized DHCP server to update specific DHCP options within the DHCP pools. The remote servers can request or import these option parameters from the centralized servers.
Cisco recommends readers of this document have knowledge of these topics:
This configuration was developed and tested with these software and hardware versions:
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.
Note: The Cisco IOS DHCP Server feature is introduced in Cisco IOS Software Release 12.0(1)T. You need Cisco IOS® Software Release 12.0(2)T or later for use with Cisco 1700 series routers. For more information on routers that support the DHCP Server feature, see the Supported Platforms section of Cisco IOS DHCP Server document.
For more information on document conventions, refer to the Cisco Technical Tips Conventions.
In this section, you are presented with the information to configure DHCP Server Options for DNS and WINS. The 'Central' router is configured for these Server options and 'Remote' router imports these options. The remote PC or Client receives these imported options from the 'Remote' router during their DHCPACK stage.
Note: In order to find additional information on the commands used in this document, refer to DHCP Commands or use the Command Lookup Tool (registered customers only) .
This document uses the network setup shown in this diagram:
This document uses these configurations:
| Central (3660)
Central# show running-config
ip dhcp excluded-address 10.0.0.1 10.0.0.5
!--- This range must not be assigned to DHCP clients.
ip dhcp pool Central
network 10.0.0.0 255.255.255.0
!--- Specify the network number and mask for DHCP clients.
!--- Specify the domain name for the client.
!--- Specify the DNS server you want to respond to DHCP clients who
!--- need to correlate the host name to the IP address.
!--- Specify the Network Basic Input/Output System (NetBIOS)
!--- WINS server (for Microsoft DHCP clients)
ip address 10.0.0.1 255.255.255.0
Note: When you use a Cisco router as DHCP server, only one domain is allowed per DHCP pool, in other words, the router cannot send DHCP leases to clients that include two domain-names. It is not possible to mix static mapping in a dynamic Pool. If it is mixed, the % This command may not be used with network, origin, vrf, or relay pools error message appears.
| Remote (3660)
Remote# show running-config
ip dhcp excluded-address 192.168.1.1
!--- This ip address must not be assigned to DHCP clients.
ip dhcp pool Client
!--- Import DHCP option parameters into the database.
network 192.168.1.0 255.255.255.248
!--- Specify the network number and mask for DHCP clients.
!--- Specify the default gateway for DHCP clients.
ip address dhcp
ip address 192.168.1.1 255.255.255.248
The service config command is used in conjunction with the boot host or boot network command. The service config command is entered to enable the router to automatically configure the system from the file specified by the boot host or boot network command.
The service config command can also be used without the boot host or boot network command. If you do not specify host or network configuration filenames, the router uses the default configuration files. The default network configuration file is network-config. The default host configuration file is host-config, where host is the host name of the router. If the Cisco IOS software cannot resolve its host name, the default host configuration file is router-config.
Use the boot host command along with the service config command. Without the service config command, the router ignores the boot host command and uses the configuration information in NVRAM. If the configuration information in NVRAM is invalid or missing, the service config command is enabled automatically. The network server will attempt to load two configuration files from remote hosts. The first is the network configuration file containing commands that apply to all network servers on a network. Use the boot network command to identify the network configuration file. The second is the host configuration file that contains commands that apply to one network server in particular. Use the boot host command to identify the host configuration file.
The client sends out a broadcast inspite of the fact that the option 150 is configured because of its default nature to look out for the TFTP server and the Option 150 is defined on the server side not the client side. Other than TFTP, 150 option is also available for these:
The DHCP options can be configured with the option code ascii string tftp-server-name command. If you do not have the name of the server and if the server is configured only with the IP address, then use the option code ip ip address command.
This section provides information you can use in order to confirm your configuration works properly.
Certain show commands are supported by the Output Interpreter Tool (registered customers only) , which allows you to view an analysis of show command output.
Remote#show ip dhcp import
Address Pool Name: Client
Domain Name Server(s): 10.0.0.2
NetBIOS Name Server(s): 10.0.0.2
Domain Name Option: Central
Central#show ip dhcp server statistics
Memory usage 13906
Address pools 1
Database agents 1
Automatic bindings 1
Manual bindings 0
Expired bindings 0
Malformed messages 0
Central#show ip dhcp binding
IP address Client-ID/Hardware address Lease expiration Type
10.0.0.6 0063.6973.636f.2d30. Apr 25 2005 12:30 AM Automatic
This section provides information you can use to troubleshoot your configuration.
Note: Before you issue debug commands, refer to Important Information on Debug Commands.
The output taken from a PC or Client with a Microsoft Windows Operating system with the ipconfig /all command gives the TCP/IP configuration values configured by DHCP. Refer to RFC 2132 for more information on DHCP options.
Windows 2000 IP Configuration
Host Name . . . . . . . . . . . . : PC
Primary DNS Suffix . . . . . . . : cisco.com
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : cisco.com
Ethernet adapter Local Area Connection :
Connection-specific DNS Suffix . : Central
Description . . . . . . . . . . : 3Com EtherLink XL 10/100 PCI TX NIC(3C905B-TX)
Physical Address. . . . . . . . : 00-10-5A-86-5A-CA
DHCP Enabled. . . . . . . . . . : Yes
Autoconfiguration Enabled . . . : Yes
IP Address. . . . . . . . . . . : 192.168.1.2
Subnet Mask . . . . . . . . . . : 255.255.255.248
Default Gateway . . . . . . . . : 192.168.1.1
DHCP Server . . . . . . . . . . : 10.0.0.6
DNS Servers . . . . . . . . . . : 10.0.0.2
Primary WINS Server . . . . . . : 10.0.0.2
Lease Obtained. . . . . . . . . : Tuesday, April 26, 2005 6:04:29 PM
Lease Expires . . . . . . . .. . : Wednesday, April 27, 2005 6:04:29 PM