So, we need to enable and configure a DHCP server on a Cisco router. Here is a step-by-step guide on what to do.
DHCP configuration1) Enter privileged mode and configuration mode
> enable
# config t
(config)#
2) Create an address pool
(config)# ip dhcp pool MyDHCPpool1
(dhcp-config)#
In this example, a pool named MyDHCPpool1 is created, which we will be working with going forward. You can, of course, specify your own name.
3) Set the network addressing
(dhcp-config)# network 192.168.1.0 255.255.255.0
In this example, we specify that addresses should be assigned from the 192.168.1.0/24 subnet.
4) Set the default gateway
(dhcp-config)# default-router 192.168.1.1
Here we set 192.168.1.1 as the default gateway. This setting will be delivered to the DHCP client automatically together with its assigned IP address.
5) Set the DNS server
(dhcp-config)# 192.168.1.2
Here we set 192.168.1.2 as the DNS server. This setting will be delivered to the DHCP client automatically together with its assigned IP address.
6) Set addresses excluded from assignment
You will most likely need to specify a set of IP addresses that the DHCP server should not hand out to clients. For example, there may be servers or statically configured computers on these addresses that need to keep a permanent IP address.
Note. Excluded addresses are entered not from within the pool configuration, but from the configuration root.
(dhcp-config)# exit
(config)# ip dhcp excluded-address 192.168.1.1 192.168.1.9
(config)# ip dhcp excluded-address 192.168.1.250
In this example, we told the router not to hand out addresses from the range 192.168.1.1 to 192.168.1.9, and not to hand out the address 192.168.1.250.
If you need to remove an entered exclusion address, use the "no" prefix before the command:
(config)# no ip dhcp excluded-address 192.168.1.250
Deleting a pool (disabling DHCP)For this we use the "no" prefix. For example, if our pool is named "MyDHCPpool1", removing it would look like this:
(config)# no ip dhcp pool MyDHCPpool1
And don't forget to remove the exclusion addresses, so they don't linger in the configuration.
Static MAC=IP bindingwas described earlier
Comments