Sign Up|Login Courses & Workshops
Overview
Pricing
CISCO REFERENCE HOME

ip dhcp excluded-address

ip dhcp excluded-address

The ip dhcp excluded-address command is used to exclude certain IP addresses from being assigned to DHCP clients by the DHCP server service on a Cisco IOS device.

The format of the command is as follows:

ip dhcp excluded-address <start address> [<end address>]

The command can be used to exclude a single IP address at a time, or an entire range of IP addresses at a time.

In the following example, we create two dhcp pools and exclude a number of addresses from each pool:

RTR-1 Console
RTR-1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
RTR-1(config)#ip dhcp excluded-address 192.168.0.0 192.168.0.10
RTR-1(config)#ip dhcp excluded-address 192.168.0.50
RTR-1(config)#ip dhcp excluded-address 192.168.0.200 192.168.0.254
RTR-1(config)#ip dhcp excluded-address 172.16.1.0 172.16.1.10
RTR-1(config)#ip dhcp excluded-address 172.16.1.50
RTR-1(config)#ip dhcp excluded-address 172.16.1.100
RTR-1(config)#
RTR-1(config)#ip dhcp pool Vlan10-computers
RTR-1(dhcp-config)#network 192.168.0.0. 255.255.255.0
RTR-1(dhcp-config)#default-router 192.168.0.1
RTR-1(dhcp-config)#dns-server 8.8.8.8 1.1.1.1
RTR-1(dhcp-config)#domain-name home.lab
RTR-1(dhcp-config)#lease 7 0 0
RTR-1(dhcp-config)#exit
RTR-1(config)#
RTR-1(config)#ip dhcp pool Vlan20-printers
RTR-1(dhcp-config)#network 172.16.1.0. 255.255.255.0
RTR-1(dhcp-config)#default-router 172.16.1.1
RTR-1(dhcp-config)#dns-server 8.8.8.8 1.1.1.1
RTR-1(dhcp-config)#domain-name home.lab
RTR-1(dhcp-config)#lease 7 0 0
RTR-1(dhcp-config)#

In the example above we created two DHCP pools. One pool for the subnet 192.168.0.0/24 and the other pool for the subnet 172.16.1.0/24.

For the subnet 192.168.0.0/24 we excluded:

  • the range of IP addresses from 192.168.0.0 to 192.168.0.10
  • the single IP address from 192.168.0.50
  • the range of IP addresses from 192.168.0.200 to 192.168.0.254

For the subnet 172.16.1.0/24 we excluded:

  • the range of IP addresses from 172.16.1.0 to 172.16.1.10
  • the single IP address 172.16.1.50
  • the single IP address 172.16.1.100

In what configuration context are the excluded-addresses defined?

On most server-based DHCP server applications (such as a Windows DHCP server), the range of addresses to be excluded from a DHCP pool (or scope) is defined within the context of each scope.

However, in the case of Cisco IOS devices, the excluded addresses are defined in the Global configuration context, and not defined under each pool. (This is a common mistake while trying to configure excluded addresses on Cisco IOS.)

On Cisco IOS, we need to exit the DHCP configuration mode if we want to see the "excluded-address" option under the context-sensitive help. We define a global list of addresses to be excluded and the DHCP server service checks against the global list before assigning addresses for any specific pool.

DHCP, DNS and NAT are covered extensively in the following interactive course: Course 6 - IP Services. The course features visual, animated explanations and hands-on interactive labs.

Want to test your networking skills with hands-on configuration and troubleshooting questions? Try out the Workshops section of this website here: Workshops (Login required).

Read how to use the device simulators on this website here: Workshops - General Instructions