DHCP v4
The Dynamic Host Configuration Protocol (DHCP) dynamically assigns IP addresses to devices. DHCPv4 is for an IPv4 network.
This means that a network administrator, do not have to spend hours configuring IP addresses for every device on the network. In a small home or office, that would not be very difficult, but any large network might have hundreds or even thousands of devices.
In this module, you will learn how to configure a Cisco IOS router to be a DHCPv4 server, and also how to configure a Cisco IOS router to act as a client.
Steps to configure a DHCPv4 Server on a Cisco IOS Device
- Exclude IPv4 addresses
- Define a DHCPv4 Pool Name
- Configure the DHCPv4 pool
1. Exclude static IPv4 addresses
Command to exclude IPv4 addresses
R1(config)# ip dhcp excluded-address [low-address] [high-address]
2. Define a DHCPv4 Pool Name
Command to define a DHCPv4 Pool Name
R1(config)# ip dhcp pool [pool-name] R1(dhcp-config)#
3. Configure the DHCPv4 pool
Define the address pool
R1(dhcp-config)# network [network-number] [mask | / prefix-length]
Define the default router or gateway
R1(dhcp-config)# default-router [address]
Define a DNS server
R1(dhcp-config)# dns-server [address]
Define the domain name
R1(dhcp-config)# domain-name [domain]
Define the duration of the DHCP lease
R1(dhcp-config)# lease {days [hours [minutes]] | infinite}
Define the NetBIOS WINS server
R1(dhcp-config)# netbios-name-server [address]
DHCPv4 Complete Configuration example
R1(config)# ip dhcp excluded-address 192.168.10.1 192.168.10.9 R1(config)# ip dhcp excluded-address 192.168.10.254 R1(config)# ip dhcp pool LAN-POOL-1 R1(dhcp-config)# network 192.168.10.0 255.255.255.0 R1(dhcp-config)# default-router 192.168.10.1 R1(dhcp-config)# dns-server 192.168.11.5 R1(dhcp-config)# domain-name example.com R1(dhcp-config)# end R1#
Note The DHCP Lease command and the NetBIOS WINS server command were not used in the example because the *default DHCP Lease timeout was used and **NetBIOS WINS is considered legacy
* By default, the DHCP Lease timeout is one day (24h) and
** Microsoft recommends not deploying WINS, instead configure DNS for Windows name resolution and decommission WINS.