Last Updated on February 13, 2012 by Joe
By Joe Spoto
Step 1: The first step is to enable the service on the Cisco Router
Router(config)# service dhcp
This command enables the Cisco service on the Router and relay features on your router.
To remove the command use the same command with no at the beginning
Configuring the DHCP Pool Name
Configure the pool name and, use the following command in global configuration mode:
Router(config)#ip dhcp pool name
This command creates a name for the Service IP address pool and puts you into pool configuration mode, the prompt changes to dhcp-config#.
Setting up the Address Pool Subnet and Mask Next step is to setup a subnet and mask for the address pool you just created. This pool contains the valid range of IP addresses which the Service will assign to DHCP clients:
Router(dhcp-config)# network network-number [mask|prefix-length]
The prefix length indicates the number of bits which make up the address prefix. The prefix is the alternative way to specify the network mask of the client.
Setting up the Domain Name for the Client The domain name for a client puts the client into that domain.
Router(dhcp-config)# domain-name domain
Setting up the IP Domain Name System Servers for the Client When clients query DNS IP servers when they need to resolve host names or URLS to IP addresses.
Router(dhcp-config)# dns-server address [address2 …address5]
Specifies the IP address of a DNS server that is available to a client. Only one IP address is needed but you can configure up to 8 of them.
Configuring the Default Router for the Client The client needs to route off of the network and needs to know the IPaddress of the default gateway or default router. The IP address of the default router has to be on the same subnet as the DHCP client.
Router(dhcp-config)# default-router address [address2 … address8]
Specifies the IP address of a DNS server that is available to a client. Only one IP address is needed but you can configure up to 8 of them.
Setting up the Address Lease Time The default lease time for each IP address assigned by a Server one-day. This is the period of time which the leased address is valid. To change the lease value for an IP address:
Router(dhcp-config)# lease {days[hours][minutes] | infinite}
Configuring Dynamic DHCP on a Cisco Router Part 2
For the CCNA certification you must have a solid understanding in how to configure Dynamic Host Configuration Protocol (DHCP) on a Cisco router to serve IP address information to one or multiple subnets
Example Configuration of DHCP
Router(config)# service dhcp
Router(config)# ip dhcp pool CCNA
Router(dhcp-config)# network 10.1.1.0 255.255.255.0
Router(dhcp-config)# domain-name COMMSUPPORT.LOCAL
Router(dhcp-config)# dns-server 10.1.1.1
Router(dhcp-config)# default-router 10.1.1.254
Router(dhcp-config)# lease 5 2 3
The above configuration will assign an address in the range between 10.1.1.2 and 10.1.1.253 to any client, the server will also tell the client that the domain name is commsupport.local, that the DNS server on the subnet is 10.1.1.1, to use a gateway known as 10.1.1.254 and to hold onto the address for 5 days 2 hours and 3 minutes.
Joe Spoto is a senior lecturer at Commsupport networks in the United Kingdom. Joe teaches Cisco CCNA, CCNP, CCVP courses when he is not out on the road fixing and building networks, if you want to find out more about what we do at Commsupport please visit us at CCNA Course
Commsupport run free one day training sessions and free on-line webinars, CCNA training
Article Source: http://EzineArticles.com/?expert=Joe_Spoto
6 Responses
Is it necessary to include dhcp excluded address on the config?
Joe you are 2nd 2 none man!!
thanks for info
Dear friend,
what should we do if we use dhcp router not dhcp server? what is the ip address of dhcp router should we use ip-helper? we use ip address of serial interface of fathernet interface for ip-helper?
I am looking to hearing from you.
Best regard;
Vannda Thai
Hi Joe,
Can i configure it in serial? The situation is there are 3 routers (a,b & c) and connected to a frame relay (serial connection). Only in Router A you will configure the dhcp. How do i configure it? Please advise. Thanks
how can i cofigure DHCP request foward
the situation is,i got a router A and a Router B,all my client is connected through router B Fast Ethernet..i have been given job to configure DHCP on Router A (not in router B)..how do i forward the dhcp information to my client (connected to Router B)
tqvm
Hi Fahmi,
To do this you would need to configure an IP-Helper address on Router B. The ip helper address is the address of your dhcp server and would go on the interface that is your client's gateway on router B.
So, for example your dhcp server is 172.16.1.1. Your client's has an ip address of 10.0.0.100 and the gateway is 10.0.0.1. This gateway address is the ip address of Fa0/1 on Router B. On Fa0/1 on Router B you would add the statement
Router-B#(if-config)ip-helper 172.16.1.1
And that's it.. of course save your config…
Let me know if you have any more questions.