Vous êtes sur la page 1sur 6

Dynamically Configuring DHCP Server Options

Document ID: 22920


Introduction
Prerequisites
Requirements
Components Used
Conventions
Configure
Network Diagram
Configurations
Verify
Troubleshoot
Troubleshooting Commands
Related Information

Introduction
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 laborintensive, 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.

Prerequisites
Requirements
Cisco recommends readers of this document have knowledge of these topics:
DHCP
Domain Name System (DNS)
Windows Internet Name Service (WINS)

Components Used
This configuration was developed and tested with these software and hardware versions:
Cisco IOS Software Release 12.2(27)
Two Cisco 3660 routers with NM1E used for PC and client connection

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.

Conventions
For more information on document conventions, refer to the Cisco Technical Tips Conventions.

Configure
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) .

Network Diagram
This document uses the network setup shown in this diagram:

Configurations
This document uses these configurations:
Central (3660)
Central# show runningconfig
Building configuration...
.
.
.
ip dhcp excludedaddress 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.
domainname Central
! Specify the domain name for the client.
dnsserver 10.0.0.2
! Specify the DNS server you want to respond to DHCP clients who

! need to correlate the host name to the IP address.


netbiosnameserver 10.0.0.2
! Specify the Network Basic Input/Output System (NetBIOS)

! WINS server (for Microsoft DHCP clients)


!
.
.
!
interface FastEthernet0/0
ip address 10.0.0.1 255.255.255.0
duplex auto
speed auto
!
.
.
!
end

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 domainnames. 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 runningconfig
Building configuration...
.
.
.
ip dhcp excludedaddress 192.168.1.1
! This ip address must not be assigned to DHCP clients.
!
ip dhcp pool Client
import all
! 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.


defaultrouter 192.168.1.1
! Specify the default gateway for DHCP clients.
!
.
.
!
interface FastEthernet0/0
ip address dhcp
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 192.168.1.1 255.255.255.248
duplex auto
speed auto
!
end

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 networkconfig. The default host configuration file is hostconfig, 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 routerconfig.
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:
150 Etherboot
150 GRUB configuration path name
The DHCP options can be configured with the option code ascii string tftpservername 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.

Verify
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.
show ip dhcp import Displays the option parameters imported into the DHCP server database.
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

show ip dhcp server statistics Displays DHCP server statistics.


Central#show ip dhcp
Memory usage
Address pools
Database agents
Automatic bindings
Manual bindings
Expired bindings
Malformed messages

server statistics
13906
1
1
1
0
0
0

Message
BOOTREQUEST
DHCPDISCOVER
DHCPREQUEST
DHCPDECLINE
DHCPRELEASE
DHCPINFORM

Received
0
1
1
0
0
0

Message
BOOTREPLY
DHCPOFFER
DHCPACK
DHCPNAK

Sent
0
1
1
0

show ip dhcp binding Displays address bindings on the Cisco IOSDHCP server.
Central#show ip dhcp binding
IP address
ClientID/Hardware address
10.0.0.6
0063.6973.636f.2d30.
3036.302e.3563.6634.
2e61.3961.382d.4574.
30

Lease expiration
Apr 25 2005 12:30 AM

Troubleshoot
This section provides information you can use to troubleshoot your configuration.

Troubleshooting Commands
Note: Before you issue debug commands, refer to Important Information on Debug Commands.
debug ip dhcp server packetDecodes DHCP receptions and transmissions.
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.
C:\>ipconfig /all

Type
Automat

Windows 2000 IP Configuration


Host Name . . . . . . . . . . . .
Primary DNS Suffix . . . . . . .
Node Type . . . . . . . . . . . .
IP Routing Enabled. . . . . . . .
WINS Proxy Enabled. . . . . . . .
DNS Suffix Search List. . . . . .

:
:
:
:
:
:

PC
cisco.com
Hybrid
No
No
cisco.com

Ethernet adapter Local Area Connection :


Connectionspecific DNS Suffix .
Description . . . . . . . . . .
Physical Address. . . . . . . .
DHCP Enabled. . . . . . . . . .
Autoconfiguration Enabled . . .
IP Address. . . . . . . . . . .
Subnet Mask . . . . . . . . . .
Default Gateway . . . . . . . .
DHCP Server . . . . . . . . . .
DNS Servers . . . . . . . . . .
Primary WINS Server . . . . . .
Lease Obtained. . . . . . . . .
Lease Expires . . . . . . . .. .

:
:
:
:
:
:
:
:
:
:
:
:
:

Central
3Com EtherLink XL 10/100 PCI TX NIC(3C905BTX)
00105A865ACA
Yes
Yes
192.168.1.2
255.255.255.248
192.168.1.1
10.0.0.6
10.0.0.2
10.0.0.2
Tuesday, April 26, 2005 6:04:29 PM
Wednesday, April 27, 2005 6:04:29 PM

Related Information
DHCP Server Options Import and Autoconfiguration
AutoInstall Using DHCP for LAN Interfaces
Configuring WINS, DNS and DHCP on Access Servers
Using the Cisco IOS DHCP Server on Access Servers
Configuring DHCP
DHCP Commands
Cisco IOS DHCP Server
Dynamic Address Allocation and Resolution Cisco Systems
IP Technology Support Page
Technical Support & Documentation Cisco Systems

Contacts & Feedback | Help | Site Map


2008 2009 Cisco Systems, Inc. All rights reserved. Terms & Conditions | Privacy Statement | Cookie Policy | Trademarks of
Cisco Systems, Inc.

Updated: Oct 12, 2005

Document ID: 22920

Vous aimerez peut-être aussi