https://blog.51cto.com/14451009/2434021, this blog specifically describes how to use Linux to build a DHCP server. Then this blog will do a GNS3 with VMware virtual implementation of a DHCP service for Linux.
Experimental environment: server Linux (centos7)
Client 2, respectively, Windows 10, Windows 7.
First, the system should bind each separate fixing a card. NIC teaming after completion of the three systems is equivalent to a stand-alone computer. Windows 10 system is bound to the first NIC, Windows 7 is a second block bound to the NIC, and the third block is LinuxDHCP server NIC binding.
Next, constructed in a simple network topology, following FIG. Explain the following figure, in the middle of a Layer 2 switching with a three-tier exchange for the right of a Linux DHCP server, and the following two is for the two Windows clients, one is a Windows 10 Taiwan is Windows 7.
Now double-click to open the two machines enter the setup mode, first we Layer 2 switches to set.
First, using the global conf t command to enter the setting mode, then no ip routing command to disable routing function.
Then add vlan 10, respectively, as well as with vlan 20 vlan 30
Next, using the vlan mode exit command, then the int f1 / 1 command to enter the port 1 of the set, using the command set sw mo acc port access mode. Then add 1 to the port which vlan10 use sw acc vlan 10 command.
Then exit to exit port setting mode 1 in the same manner as port 3 is provided with a port 2
Finally set 1/0 as trunk port, layer-2 switching is provided here is completed. Next is the set of three switches.
First use conf t command to enter global settings mode, then use to create three vlan vlan 10,20,30 command.
And then were added to the three vlan on gateway.
And finally into 1/0 port is provided, and the setting mode as trunk encapsulation protocol. Here initially set up three-tier exchange is complete.
Enter the setup DHCP server, first use the rpm -a dhcp command to check the dhcp package system is not installed, I have been here for the installation is complete, if not installed, then you can use yum -y install dhcp command to install click.
Then a copy of the template profile directly overwriting the original empty profile.
Then use vim /etc/dhco/dhcpd.conf command to open just copy the configuration file, set it up.
Then add a 10 ip address pool segment, which is vlan10 of ip network segment.
Then use 4yy command to copy the configuration just finished four rows back in the next two copy using the p command.
Then copy out two modified to a good start topology developed two other segments, and finally enter "wq" to save and exit.
Then open the configuration file of the network card IP address changes to a static IP address. Modify the server's IP address input after 192.168.30.50 "wq" to save and exit.
Then restart the network services, and open the dhcp service.
Then check this machine dhcp service has been turned on.
Then they were entering the vlan 10,20,30 server all point to 192.168.30.50 will LinuxDHCP server.
Then open the client Windows 10, before the ipconfig / release command to relieve the original IP address.
Then use the ipconfig / renew command, has been looking to get a new address. Then we look at Windows 7.
Like Windows 10 system, first use the ipconfig / release command to release the original IP address.
Then use the ipconfig / renew command, you already get to see the address of the segment 20.