Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

19.2.1 Configure the DHCP service program


May 24, 2021 That's what Linux should learn



The DHCP service program is used to assign available IP addresses to client hosts, and this is the basis for file transfer between the server and client hosts, so we configure the DHCP service program first. First set the IP address for the unattended system according to Table 19-1, and then follow Figures 19-2 and 19-3 to shut down their DHCP services in the virtual network editor of the virtual machine.

Table 19-1 Unattended system with client settings

19.2.1 Configure the DHCP service program

Host Name Operating System IP Address Unattended System RHEL 7 192.168.10.10 Client Uninstalled Operating System - Chapter 19 Installs service using PXE-Kickstart Unattended. Chapter 19 Installs the service unattended using PXE-Kickstart.

Figure 19-2 Turns on the virtual network editor of the virtual machine

19.2.1 Configure the DHCP service program

Figure 19-3 Shut down the DHCP service that come with the virtual machine

Once the disc image is mounted and the Yum repository file is configured properly, the DHCP service package can be installed.

[root@linuxprobe ~]# yum install dhcp Loaded plugins: langpacks, product-id, subscription-manager This system is not registered to Red Hat Subscription Management. Y ou can use subscription-manager to register. r hel | 4.1 kB 00:00 Resolving Dependencies --> Running transaction check ---> Package dhcp.x86_64 12:4.2.5-27.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved

  1. Package Arch Version Repository Size
  2. ================================================================================
  3. Installing:
  4. dhcp x86_64 12:4.2.5-27.el7 rhel 506 k
  5. Transaction Summary
  6. ================================================================================
  7. Install 1 Package
  8. Total download size: 506 k
  9. Installed size: 1.4 M
  10. Is this ok [y/d/N]: y
  11. Downloading packages:
  12. Running transaction check
  13. Running transaction test
  14. Transaction test succeeded
  15. Running transaction
  16. Installing : 12:dhcp-4.2.5-27.el7.x86_64 1/1
  17. Verifying : 12:dhcp-4.2.5-27.el7.x86_64 1/1
  18. Installed:
  19. dhcp.x86_64 12:4.2.5-27.el7
  20. Complete!

Chapter 14 has explained in detail the configuration and deployment methods of the DHCP service program, and I believe readers have some impressions of the relevant configuration parameters. However, the profile we are using here is two main differences from the profile in Chapter 14: the BOOT boot protocol is allowed to allow hosts in the LAN that do not have an operating system to obtain a static IP address;

[root@linuxprobe ~]# vim /etc/dhcp/dhcpd.conf allow booting; a llow bootp; d dns-update-style interim; i gnore client-updates; s ubnet 192.168.10.0 netmask 255.255.255.0 { option subnet-mask 255.255.255.0; o ption domain-name-servers 192.168.10.10; r ange dynamic-bootp 192.168.10.100 192.168.10.200; d efault-lease-time 21600; m ax-lease-time 43200; n ext-server 192.168.10.10; f ilename "pxelinux.0"; A fter confirming that the parameters of the DHCP service program are filled in correctly, restart the service program and add it to the boot item. This automatically installs the system for the client host after the device's next restart without human intervention.

[root@linuxprobe ~]# systemctl restart dhcpd [root@linuxprobe ~]# systemctl enable dhcpd ln -s '/usr/lib/systemd/system/dhcpd.service' '/etc/systemd/system/multi-user.target.wants/dhcpd.service'