找回密碼
 註冊
搜索
查看: 574|回復: 0

[CentOS] CentOS 8, AlamLinux 9.4 DHCP Server 架設

[複製鏈接]
發表於 2024-7-25 22:29:24 | 顯示全部樓層 |閱讀模式
 
Push to Facebook
安裝DHCP SERVER及編輯

  1. dnf -y install dhcp-server
  2. vi /etc/dhcp/dhcpd.conf
複製代碼

檔案加入
  1. # create new
  2. # specify domain name
  3. option domain-name     "www.google.com";
  4. # specify DNS server's hostname or IP address
  5. #DNS導向
  6. option domain-name-servers 168.95.1.1, 8.8.8.8 ;
  7. # default lease time
  8. default-lease-time 6000;
  9. # max lease time
  10. max-lease-time 72000;
  11. # this DHCP server to be declared valid
  12. authoritative;
  13. # specify network address and subnetmask
  14. subnet 192.168.1.0 netmask 255.255.255.0 {
  15.    # specify the range of lease IP address
  16.    range dynamic-bootp 192.168.1.201 192.168.1.225;
  17.    # specify broadcast address
  18.    option broadcast-address 192.168.1.255;
  19.    # specify gateway
  20.    option routers 192.168.1.254;
  21. }
複製代碼


打開防火牆
  1. firewall-cmd --add-service=dhcp --permanent
  2. firewall-cmd --reload
複製代碼


看分配的IP
  1. ll /var/lib/dhcpd

  2. cat /var/lib/dhcpd/dhcpd.leases


  3. # The format of this file is documented in the dhcpd.leases(5) manual page.
  4. # This lease file was written by isc-dhcp-4.3.6

  5. # authoring-byte-order entry is generated, DO NOT DELETE
  6. authoring-byte-order little-endian;

  7. lease 192.168.1.201 {
  8.   starts 5 2024/07/26 08:12:45;
  9.   ends 5 2024/07/26 08:22:45;
  10.   tstp 5 2024/07/26 08:22:45;
  11.   cltt 5 2024/07/26 08:12:45;
  12.   binding state active;
  13.   next binding state free;
  14.   rewind binding state free;
  15.   hardware ethernet 00:e0:4c:bc:0c:bd;
  16.   uid "\001\000\340L\274\014\275";
  17.   set vendor-class-identifier = "MSFT 5.0";
  18.   client-hostname "SP-202308022222";
  19. }
  20. server-duid "\000\001\000\001.6\003a\000\361\363\273\003\";

複製代碼

CentOS,DHCP,Server架設

CentOS,DHCP,Server架設


打開防火牆
TCP PORT 67
https://www.server-world.info/en/note?os=CentOS_8&p=dhcp&f=1


 
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

Archiver|手機版|小黑屋|TShopping

GMT+8, 2025-5-1 05:24 , Processed in 0.025965 second(s), 24 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回復 返回頂部 返回列表