Next, let's take a look at how to set up DHCP servers in enterprises. The company has recently expanded its office business and established subsidiaries in many regions. As the subsidiary has just been established, it does not have enough funds to purchase servers, and the IP addresses of office machines are to be managed by means of automatic DHCP allocation, without a dedicated DHCP server, IP addresses cannot be automatically allocated.
The author finds that each subsidiary uses the corresponding router at the network egress, so it can enable the DHCP service function on the route device at the egress of the company and use the router as the DHCP server.
Now, I will take the Cisco router as an example to introduce the configuration method. Assume that the company's internal IP address is 10.30.70.1 ~ 10.30.70.255, the client in the network wants to automatically obtain the IP address through the DHCP service, but the company has two servers (IP addresses are 10.30.70.2 and 10.30.70 respectively. 100), the two servers cannot automatically obtain the IP address and can only use a fixed IP address.
Service dhcp
// Start the DHCP service.
Ip dhcp exclude-add 10.30.70.2 10.30.70.100
// Retain the two IP addresses, that is, they are not automatically allocated through DHCP. In this example, the two IP addresses are reserved for the server.
Ip dhcp ping packets 3
// Ping the IP address before assigning an IP address. That is to say, test the connectivity after the IP address is assigned to a computer. If the connectivity problem is found, assign the IP address to the computer, this method effectively ensures the normal network connection.
Ip dhcp pool 1
Net 10.30.70.0 255.255.255.0
// Set the DHCP range, including the IP Range and subnet mask.
Default-router 10.30.70.1
// Set the gateway address.
Lease 8
// Set the IP address lease obtained through DHCP to 8 days.
After the above configuration, the vrodhcp can act as a DHCP server to allocate IP addresses, gateways, and other network parameters to the client, saving the cost of purchasing the DHCP server, the effect of Automatically Obtaining an IP address is almost the same as that of using a DHCP server.