Configure DHCP on a Cisco router or switch

Configure DHCP on a Cisco router or switch

To begin, connect the router’s Ethernet port to a switch,and connect the switch to a laptop, which will serve as the DHCP client.

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

Step1) Configure an IP address on the router’s Ethernet port, and bring up the interface. (On an existing router, you would have already done this.)

Router(config)# interface ethernet0/0
Router(config-if)#ip address
Router(config-if)# no shutdown

Step2) Create a DHCP IP address pool for the IP addresses you want to use.

Router(config)# ip dhcp pool mypool

Step3) Specify the network and subnet for the addresses you want to use from the pool.

Router(dhcp-config)# network /8   

Step4) Specify the DNS domain name for the clients.


Step5) Specify the primary and secondary DNS servers.


Step6) Specify the default router (i.e., default gateway).


Step7) Specify the lease duration for the addresses you’re using from the pool.

Router(dhcp-config)#lease 7

Step8) Exit Pool Configuration Mode.