Friday, June 25, 2010

To Configure DHCP on a Cisco router

To Configure DHCP on a Cisco router

To configure Cisco DHCP, follow these steps, which include sample commands

1) Configure an IP address on the router's Ethernet port, or Fast Ethernet Port and
bring up the interface .
Eg:-
Router(config)# interface FA 0/0

Router(config-if)#ip address 1.1.1.1 255.0.0.0

Router(config-if)# no shutdown

2) enable the DHCP service in the router

Router(config)#service dhcp

3) Create a DHCP IP address pool for the IP addresses you want to use.
Router(config)# ip dhcp pool mypool
Where mypool is name of the DHCP pool

4) Specify the network and subnet for the addresses you want to use from the pool.
Router(dhcp-config)# network 1.1.1.0 255.0.0.0


5) Specify the DNS domain name for the clients.
Router(dhcp-config)# domain-name pathcom.com

6) Specify the primary and secondary DNS servers
Router(dhcp-config)# dns-server 209.250.128.6 209.250.128.8

7) Specify the default router (i.e., default gateway).
Router(dhcp-config)#default-router 1.1.1.1

8) Specify the lease duration for the addresses you're using from the pool.
Router(dhcp-config)#lease 7

9) Exit Pool Configuration Mode.
Router(dhcp-config)#exit

10) Configure the IP addresses to be excluded from the pool. This is usually done to
avoid the conflicts caused by the DHCP with servers and printers. Remember to
give ALL servers and network printers static IP addresses in the same range of the
DHCP pool. And then exclude these addresses from the pool to avoid conflicts

Router(config)#ip dhcp excluded-address XXX.XXX.XXX.XXX

Use the command in the previous form to excluded a single address. You can
repeat it as much as you see fit for the IP addresses you want to exclude.



Use the following commands to check the DHCP operation on the router:

Router#show ip dhcp binding

This command shows the current bindings of addresses given to clients

Router#show ip dhcp server statistics

This command show the DHCP server statistics.

Router#debug ip dhcp server

To clear DHCP server variables, use the following commands as needed:

Router#clear ip dhcp binding *


NOTE:- DHCP service uses port 67 and 68. So, if you are using a firewall, remember to open these ports

No comments: