CCNA (ICND2)Management

Configuring DHCP on a Cisco router

DHCP (Dynamic Host Configuration Protocol) allows a server (in this scenario a Cisco router) to issue IP addresses to computers on the network dynamically. This is not a great solution for servers, which should have static IP addresses, but for client computers needing access to the network quickly and easily, this is certainly a great option.

 

DHCP also removes the administration burden of having to manage all the IP addresses issued to computers statically, and allows for computers to join a network quickly even if the end user has limited knowledge of networking since most computers have a default configuration on the network card and wireless network card to obtain an IP address automatically via DHCP.

 

Configuring DHCP on a Cisco router is a simple task and although the live demo at the end of this article shows some of the more detailed commands, the minimum commands to configure DHCP are:

 

AOIP.ORG(config)# ip dhcp pool aoip

{A pool is a collection of IP addresses you wish to issue dynamically, and ‘aoip’ is any name you wish to assign to your DHCP pool}

AOIP.ORG(dhcp-config)# network 192.168.2.0 255.255.255.0

{These are the IP addresses you wish to add to the pool. Instead of using the full SubnetMask value I could have used /24 instead}

AOIP.ORG(dhcp-config)# default-router 192.168.2.1

{This is the IP address that will be issued to the client computers to use as their default gateway, which will be this router}

 

In the live demo below, I have added a few extra commands to the configuration;

 

AOIP.ORG(dhcp-config)# option 150 ip 192.168.2.10

{option 150 issues a TFTP address to the clients for use in IP telephony. This would be the IP address of the TFTP server running on a Cisco Unified Communications Manager (CUCM)}

AOIP.ORG(dhcp-config)# dns-server 192.168.2.2 192.168.2.3

{In order to resolve Host names to IP addresses, client computers require the IP addresses of your DNS (Domain Name Service) servers. I have defined two for fault tolerant purposes}

AOIP.ORG(dhcp-config)# domain-name AOIP.ORG

{Issues the domain name to the clients}

AOIP.ORG(dhcp-config)# netbios-name-server 192.168.2.4 192.168.2.5

{If you are using a WINS (Windows Internet Naming Service) server on your network, you can use DHCP to issue the address to the client computers. As with DNS, I have issued 2 addresses for fault tolerant purposes}

AOIP.ORG(dhcp-config)# lease 8

{The default duration that a client computer will be allowed to use the IP address before they have to request another one, is one day. You can use the lease command to change this and in my example I have changed it to 8 days. You can define days, hours and minutes – lease 8 0 0 is 8 days, 0 hours, 0 minutes)

AOIP.ORG(dhcp-config)# exit

 

AOIP.ORG(config)# ip dhcp excluded-address 192.168.2.1 192.168.2.10

{To prevent DHCP issuing an IP address that is already in use by one of my servers, I have created an exclusion range from 192.168.2.1 – 192.168.2.10. This would result in the first client receiving the IP address 192.168.2.11}

 

If you can see this, then you might need a Flash Player upgrade or you need to install Flash Player if it's missing. Get Flash Player from Adobe.

One thought on “Configuring DHCP on a Cisco router

Leave a Reply

Your email address will not be published. Required fields are marked *