How to Configure DHCP on Cisco IOS Devices
What is DHCP?
DHCP; which the acronym for Dynamic
Host Configuration Protocol, is widely term which is used to automatically assign
network parameters like IP address, mask, gateway, and DNS information
to network clients. DHCP server services are traditionally
deployed on network servers, it isn’t uncommon to see a DHCP server role
configured on a router or switch in smaller environments.
The Dynamic Host Configuration Protocol (DHCP)
is a standardized network protocol used on Internet Protocol (IP)
networks for dynamically distributing network configuration parameters,
such as IP addresses for interfaces and services.
How to Configure DHCP in Cisco IOS Devices?
- Enable The DHCP Server Service
The first step is to enable the DHCP server service on the router.
BranchRouter# configure terminal
BranchRouter(config)# service dhcp
BranchRouter(config)# ip dhcp pool MARKETING
BranchRouter(dhcp-config)# network [IP ADDRESS] [SUBNET MASK]
In the above example, the statement network [IP ADDRESS] [SUBNET MASK] directs the router to issue IP addresses to clients using range X.X.X.1-X.X.X.254. This defines the whole subnet for the client scope. This is not a good practice since we need other devices on the segment (like the router’s gateway IP address).
We’ll add a list of addresses to exclude in just a minute. Before we do that we need to define the additional DHCP parameters we want to define for the DHCP leases.
BranchRouter(dhcp-config)# default-router [IP ADDRESS]
BranchRouter(dhcp-config)# dns-server X.X.X.50 X.X.X.51 BranchRouter(dhcp-config)# domain-name [WEBSITE].com
There are numerous DHCP options you can assign, but here are a few of the most common:
BranchRouter(config)# ip dhcp excluded-address X.X.X.1 X.X.X.99
After you have enabled the DHCP service, defined the DHCP lease pool, DHCP parameters, and a DHCP exclude list, the DHCP service will be active and responding to client requests. Pretty simple.
Router#show ip dhcp binding.
BranchRouter# configure terminal
BranchRouter(config)# service dhcp
- Define The DHCP Pool
BranchRouter(config)# ip dhcp pool MARKETING
BranchRouter(dhcp-config)# network [IP ADDRESS] [SUBNET MASK]
In the above example, the statement network [IP ADDRESS] [SUBNET MASK] directs the router to issue IP addresses to clients using range X.X.X.1-X.X.X.254. This defines the whole subnet for the client scope. This is not a good practice since we need other devices on the segment (like the router’s gateway IP address).
We’ll add a list of addresses to exclude in just a minute. Before we do that we need to define the additional DHCP parameters we want to define for the DHCP leases.
- DHCP Parameters.
BranchRouter(dhcp-config)# default-router [IP ADDRESS]
BranchRouter(dhcp-config)# dns-server X.X.X.50 X.X.X.51 BranchRouter(dhcp-config)# domain-name [WEBSITE].com
There are numerous DHCP options you can assign, but here are a few of the most common:
- Domain-name – Defines the domain name the client should use
- Dns-server address [address2] – Lists the DNS servers (in order of preference) the client should use
- Default-router – Defines the client’s gateway
- Lease {days [hours [minutes]] | infinite} – Defines the lease duration (default is 24 hours)
- Define The Exclude List
X.X.X.100 - X.X.X.254
BranchRouter(config)# ip dhcp excluded-address X.X.X.1 X.X.X.99
After you have enabled the DHCP service, defined the DHCP lease pool, DHCP parameters, and a DHCP exclude list, the DHCP service will be active and responding to client requests. Pretty simple.
- Viewing Client Leases
Router#show ip dhcp binding.
No comments:
Post a Comment