
Setting up a DHCP server to hand out IP addresses to clients, on a Cisco router or switch.
1
2
3
4
5
6
7
8
| Router(config)#ip dhcp pool <any-dhcp-pool-name>
Router(dhcp-config)#network <my-network-ip> <my-network-subnetmask>
Router(dhcp-config)#dns-server <my-dns-server-ip>
Router(dhcp-config)#default-router <my-gateway-ip>
Router(dhcp-config)#domain-name <my-domain-name>
Router(dhcp-config)#lease DAYS HOURS MINUTES
Router(config)#ip dhcp excluded-address <ip-address-to-exclude-from-pool>
Router(config)#service dhcp
|
Showing current leases:
1
| Router#show ip dhcp binding
|
Show some DHCP server statistics:
1
| Router#show ip dhcp server statistics
|
Should you choose, you can exclude a range of addresses from being assigned:
1
| Router(config)#ip dhcp excluded-address <start-ip-to-exclude> <end-ip-to-exclude>
|
You can also make your ip address leases never expire:
1
| Router(dhcp-config)#lease infinite
|