1. 程式人生 > >操作kickstart模式時DHCP無法啟動

操作kickstart模式時DHCP無法啟動

安裝DHCP服務配置了以後無法啟動

檢視狀態

[[email protected] ~]# systemctl status dhcpd
● dhcpd.service - DHCPv4 Server Daemon
   Loaded: loaded (/usr/lib/systemd/system/dhcpd.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since 四 2018-03-01 17:19:40 CST; 12s ago
     Docs: man:dhcpd(8)
           man:dhcpd.conf(5)
  Process: 4879 ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid (code=exited, status=1/FAILURE)
 Main PID: 4879 (code=exited, status=1/FAILURE)

3月 01 17:19:40 bogon dhcpd[4879]: on ftp.isc.org.  Features have been added and other changes
3月 01 17:19:40 bogon dhcpd[4879]: have been made to the base software release in order to make
3月 01 17:19:40 bogon dhcpd[4879]: it work better with this distribution.
3月 01 17:19:40 bogon dhcpd[4879]: 
3月 01 17:19:40 bogon dhcpd[4879]: Please report for this software via the CentOS Bugs Database:
3月 01 17:19:40 bogon dhcpd[4879]:     http://bugs.centos.org/
3月 01 17:19:40 bogon systemd[1]: dhcpd.service: main process exited, code=exited, status=1/FAILURE
3月 01 17:19:40 bogon systemd[1]: Failed to start DHCPv4 Server Daemon.
3月 01 17:19:40 bogon systemd[1]: Unit dhcpd.service entered failed state.
3月 01 17:19:40 bogon systemd[1]: dhcpd.service failed.
狀態錯誤,檢視dhcp配置檔案vim /etc/dhcp/dhcpd.conf
配置如下

subnet 192.168.15.0 netmask 255.255.255.0 {

range 192.168.15.100 192.168.15.199;

option routers 192.168.15.2;

option subnet-mask 255.255.255.0;

default-lease-time 21600;

max-lease-time 43200;

next server 192.168.15.201;

filename "/pxelinux.0";

}

 配置next-server要帶連字元“-”修改後

subnet 192.168.15.0 netmask 255.255.255.0 {

range 192.168.15.100 192.168.15.199;  #可分配起始IP-結束IP

option routers 192.168.15.2;          

option subnet-mask 255.255.255.0;

default-lease-time 21600;            #設定預設的IP租用期限

max-lease-time 43200;                #設定最大IP租用期限

next-server 192.168.15.201;          #告知客戶端TFTP伺服器的IP

filename "/pxelinux.0";              #告知客戶端TFTP根目錄下載pxlinux.0檔案

}儲存後啟動成功
[[email protected] ~]# systemctl status dhcpd
● dhcpd.service - DHCPv4 Server Daemon
   Loaded: loaded (/usr/lib/systemd/system/dhcpd.service; disabled; vendor preset: disabled)
   Active: active (running) since 四 2018-03-01 17:37:39 CST; 6s ago
     Docs: man:dhcpd(8)
           man:dhcpd.conf(5)
 Main PID: 5179 (dhcpd)
   Status: "Dispatching packets..."
   CGroup: /system.slice/dhcpd.service
           └─5179 /usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid

3月 01 17:37:39 bogon dhcpd[5179]: No subnet declaration for ens34 (no IPv4 addresses).
3月 01 17:37:39 bogon dhcpd[5179]: ** Ignoring requests on ens34.  If this is not what
3月 01 17:37:39 bogon dhcpd[5179]:    you want, please write a subnet declaration
3月 01 17:37:39 bogon dhcpd[5179]:    in your dhcpd.conf file for the network segment
3月 01 17:37:39 bogon dhcpd[5179]:    to which interface ens34 is attached. **
3月 01 17:37:39 bogon dhcpd[5179]: 
3月 01 17:37:39 bogon dhcpd[5179]: Listening on LPF/ens33/00:0c:29:4b:71:eb/192.168.15.0/24
3月 01 17:37:39 bogon dhcpd[5179]: Sending on   LPF/ens33/00:0c:29:4b:71:eb/192.168.15.0/24
3月 01 17:37:39 bogon systemd[1]: Started DHCPv4 Server Daemon.
3月 01 17:37:39 bogon dhcpd[5179]: Sending on   Socket/fallback/fallback-net
低階錯誤