The DHCP server is set up in linux. In fact, setting up a DHCP server in linux is very simple, not complicated at all. In windows, just a few mouse clicks, while in linux, a few digits are changed. Next let's take a look at the detailed configuration of DHCP in linux! 1. Install the DHCP software package because the software package is included in the installation CD, so we must first load the CD and quickly mount the CDmount to study the DHCP server setup in the linux environment. In fact, setting up a DHCP server in linux is very simple, not complicated at all. In windows, just a few mouse clicks, while in linux, a few digits are changed. Next let's take a look at the detailed configuration of DHCP in linux!
1. Install the DHCP Software Package Because the software package is attached to the installation disc, we must first load the disc Fast CD mounting Mount/dev/cdrom Cd/media/cdrom
Mount a DVD Mkdir/mnt/dvdrom Mount-o loop-t iso9660/dev/cdrom/mnt/dvdrom Cd/mnt/dvdrom Enable/disable a single Nic Ifup eth0 Ifdown eth0 Check whether the software package is installed Rpm-q dhcp View the software package that comes with the System Rpm-qa | grep dhcp Go to the Server folder of the installation disc to install the dhcp rpm package: Rpm-ivh dhcp-3.0.5-29.e15.i386.rpm After the installation is complete, view all files installed by the software package. Rpm-ql dhcp
Copy the dhcpd. conf. sample file to the/etc directory. This is a DHCP configuration template file. Cp/usr/share/doc/dhcp-3.0.5/dhcpd. conf. sample/etc/dhcpd. conf 2. Configure dhcpd. conf Edit this file and modify the network segment, gateway, DNS, and address pool for DHCP allocation. Vi/etc/dhcpd. conf
View DHCP service status Service dhcpd status Enable DHCP service Service dhcpd start Use a windows terminal to test and obtain the address.
View DHCP lease Cat/var/lib/dhcpd. leases
3. configure a DHCP retained address Edit dhcpd. conf Vi/etc/dhcpd. conf
Bind the MAC address and IP address, save and quit, and restart the DHCP service. Service dhcpd restart Obtain the address again on the windows terminal.
We can find that the address is fixed to 192.168.10.100. Okay, these are the basic DHCP server configurations. If you have any questions, you can discuss them together!