Ewige前夕
Debian安装DHCP服务器并进行简单配置

#Debian不彳亍

#Debian不彳亍

#Debian不彳亍

 

安装dhcp

apt install isc-dhcp-server -y

奇奇怪怪的名称

 

编辑默认绑定网卡

nano /etc/default/isc-dhcp-server

 

配置文件

subnet 192.168.222.0 netmask 255.255.255.0   {     //作用域,宣告对哪个网段生效
	range 192.168.222.100 192.168.222.110;       //范围
	option domain-name-servers 8.8.4.4;//下发的DNS的IP
        option domain-name "skills.com*";  //域名
 	option routers 192.168.222.254;                   //下发的网关IP
	option broadcast-address 192.168.222.255; //当前网段的广播地址
	default-lease-time 600;                        //默认租期
	max-lease-time 7200;                          //最大租期
}

 

接下来大概率会启动不了,报错

Sep 16 08:12:43 debian systemd[1]: Starting LSB: DHCP server...
Sep 16 08:12:43 debian isc-dhcp-server[35191]: Launching IPv4 server only.
Sep 16 08:12:43 debian isc-dhcp-server[35191]: Starting ISC DHCPv4 server: dhcpddhcpd service already running (pid file /var/run/dhcpd.pid currenty exists
Sep 16 08:12:43 debian systemd[1]: isc-dhcp-server.service: Control process exited, code=exited, status=1/FAILURE
Sep 16 08:12:43 debian systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
Sep 16 08:12:43 debian systemd[1]: Failed to start LSB: DHCP server.

 

删除那个莫名其妙的pid重启dhcp服务即可

rm -rf /var/run/dhcpd.pid

 

 

 

发表评论

textsms
account_circle
email

Ewige前夕

Debian安装DHCP服务器并进行简单配置
#Debian不彳亍 #Debian不彳亍 #Debian不彳亍   安装dhcp apt install isc-dhcp-server -y 奇奇怪怪的名称   编辑默认绑定网卡 nano /etc/default/isc-dhc…
扫描二维码继续阅读
2021-09-16