How to configure DHCP Server on Cisco IOS

Hello Sebastian

What the documentation is saying is that the IP address on the router interface is already excluded from any DHCP scope that is being used. For example, looking at the topology from the lesson:

image

Let’s say that the DHCP server is configured with the following:

interface FastEthernet0/0
 ip address 192.168.12.254 255.255.255.0
!
ip dhcp pool MYPOOL
 network 192.168.12.0 255.255.255.0
 default-router 192.168.12.254
 dns-server 208.67.222.222
!
end

Note that one of the interfaces of the DHCP server, namely Fa0/0, is assigned an IP address within that scope. What the Cisco documentation is saying is that there is an implicit exclude command like so:

ip dhcp excluded-address 192.168.12.254

So the IP address of the interface which is within the scope of the DHCP pool is automatically excluded without needing to add any additional configurations.

This is true regardless of whether or not that particular IP address is the gateway of the scope.

I hope this has been helpful!

Laz

Thank you Laz,

My question is more around the use of the network and broadcast address within the subnet of the DHCP pool, and whether or not these were automatically excluded from the DHCP allocation on Cisco IOS.

I setup a test environment and configured a network address like the example above - reserving from 0 - 254 in the pool. I enabled debugs on the router and it stated the pool was exhausted, refusing to allocate the .255 address to a client.

I was just wondering because in an exam environment such as the CCIE EI, if I were asked to create an address pool with reservations, whether or not I should be including the network and broadcast in that address range - which I’m still not entirely sure of.

Hopefully this makes sense.

Hello Sebastian

DHCP servers “know” that the network and broadcast addresses of any configured scope are “off limits” when it comes to assigning them to DHCP clients. By definition, these addresses are never assigned to hosts, as you surely know, so any decent DHCP server should have that intelligence built in to its operation.

Remember, on any DHCP server, you typically indicate the network address and a subnet mask, such as 192.168.12.0/24 to indicate the scope. This, by the very definition of the RFC for IPv4, excludes .0 and .255.

I would be very surprised if a DHCP server required you to explicitly exclude these addresses to ensure they are not given.

One more thought. Many hosts will not allow you to manually configure their addresses as the network or broadcast address. I just tried on my Windows computer to assign it the broadcast address, and it gave me an error. So even if a DHCP server does, strangely enough, assign such addresses, the OS of the host should reject such an assignment.

I hope this has been helpful!

Laz