We will introduce the content of the DHCP service in six aspects. We have made a clear explanation of each step and hope everyone can master it. So, sometimes, some medium and high-end network equipment routers and switches have already integrated the DHCP service, so we can implement the DHCP service on the network equipment, no dedicated hosts are used as DHCP servers to save costs.
The following is an instance for configuring DHCP on a cisco router.
Set DHCP Service 1. Specify the range of IP addresses not automatically assigned
- Ip dhcp excluded-address 10.1.1.1 10.1.1.19 // the ip address from 10.1.1.1 to 10.1.1.19 is manually assigned.
Set DHCP Service 2. Set DHCP protocol address pool
- Ip dhcp pool global
-
- // This command specifies the DHCP address pool name
-
- Network 10.1.0.0 255.255.0.0
-
- // Dynamically assigned IP address range, except for the non-automatically assigned IP addresses specified before all IP addresses in the 10.1.0.0 network segment)
Set DHCP Service 3. Set DHCP protocol additional information
- Domain-name client.com
-
- // Configure the domain suffix for the client
-
- Dns-server 10.1.1.1 10.1.1.2
-
- // Configure the IP address of the DNS server for the client, which is 10.1.1.1 and 10.1.1.2.
-
- Netbios-name-server 10.1.1.5 10.1.1.6
-
- // Configure the WINS server address for the client, which is 10.1.1.5 and 10.1.1.6
-
- Netbios-node-type h-node
-
- // Configuring the node mode for the client affects the smoothness of name interpretation. For example, h-node is explained by the wins server first)
-
- Default-router 10.1.0.100 10.1.0.101
-
- // Configure the default gateway for the client
Set DHCP Service 4. Set the lease term
- Lease 8
-
- // Set the lease time to 8 days
Set DHCP Service 5. Sometimes we need to set the sub-address pool of the DHCP protocol server. For example, we want the gateway of the client in the 10.1.1.0/24 network segment to 10.1.1.100. We set it as follows:
- Ip dhcp pool subglobal
-
- Network 10.1.1.0 255.255.255.0
-
- // The Sub-address pool of global, which inherits domain name and other options from global
-
- Default-router 10.1.1.100 10.1.1.101
-
- // Configure the default gateway for the client
Set DHCP Service 6. Related DHCP Debugging commands
- No service dhcp
-
- // Stop the DHCP protocol service
-
- Show ip dhcp binding
-
- // Display Address allocation information
-
- Show ip dhcp conflict
-
- // Displays address conflicts.