In this example , a DHCP server will be configured on Router1.
The lease should be valid for 12 hours.Click on image for larger picture!The DHCP-Server need to be configured with the following options:
The lease should be valid for 12 hours.Click on image for larger picture!The DHCP-Server need to be configured with the following options:
Pool name | Clients |
Network (ip’s) | 172.16.0.0 /24 |
Default router (gateway) | 172.16.0.1 |
Domain name | linuxsource.nl |
Lease | 12 hours |
ip dhcp excluded | 172.16.0.1 to 172.16.0.4 |
First, go to Router1 into configuration mode
Switch1# conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#
Set the dhcp server and the options we want
router1(config)# ip dhcp pool Guests router1(dhcp-config)# network 172.16.0.0 255.255.255.0 router1(dhcp-config)# default 172.16.0.1 router1(dhcp-config)# dns-server 8.8.8.8 router1(dhcp-config)# lease 0 12 router1(dhcp-config)# exit
Exclude switch1 and switch2, CoreSwitch1 and the router itself from the DHCP-Server. (so it can’t give the ip-addresses 172.16.0.1 to 172.16.0.4 to the clients)
router1# ip dhcp excluded-address 172.16.0.1 172.16.0.4
Verify the dhcp configured parameters with:
router1# show ip dhcp pool Pool Guests : Utilization mark (high/low) : 100 / 0 Subnet size (first/next) : 0 / 0 Total addresses : 254 Leased addresses : 1 Pending event : none 1 subnet is currently in the pool : Current index IP address range Leased addresses 172.16.0.5 172.16.0.1 - 172.16.0.254 1
Verify the the operation of the DHCP Server with:
router1# show ip dhcp binding IP address Client-ID/ Lease expiration Type Hardware address 172.16.0.5 00D0.D39B.6485 -- Automatic 172.16.0.6 000B.BED0.043E -- Automatic
View if there are any conflicts.. (in this case, none!)
router1# show ip dhcp conflict IP address Detection method Detection time VRF ..... ..... ..... ...
Save the configuration of router1
Router1# copy running-config startup-config Destination filename [startup-config]? <ENTER> Building configuration... [OK] Router1#
You are done!