debian10 dhcp简单配置
需求:DHCP•为客户端分配IP范围是10.10.100.1-10.10.100.50;•DNS:按照实际需求配置DNS服务器地址选项;•GATEWAY:按照实际需求配置网关地址选项。步骤:安装dhcpapt installisc-dhcp-server -y查看网卡名ip addr修改vim/etc/default/isc-dhcp-server备份配置文件mv /etc/dhcp/dhcpd.
·
需求:
DHCP
•为客户端分配IP范围是10.10.100.1-10.10.100.50;
•DNS:按照实际需求配置DNS服务器地址选项;
•GATEWAY:按照实际需求配置网关地址选项。
步骤:
安装dhcp
apt install isc-dhcp-server -y
查看网卡名
ip addr
修改监听配置
vim /etc/default/isc-dhcp-server
备份配置文件
mv /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak
写入配置
vim /etc/dhcp/dhcpd.conf
配置格式
ddns-update-style none;
subnet ${子网:10.10.100.0} netmask ${子网掩码:255.255.255.0}{
range ${开始IP:10.10.100.1} ${10.10.100.50};
option subnet-mask ${子网掩码:255.255.255.0};
option routers ${网关地址:10.10.100.2};
option domain-name "${域名:dhcp.com}";
option domain-name-servers ${DNS服务器IP地址:114.114.114.114};
default-lease-time 3600;
max-lease-time 7200;
}
ddns-update-style none;
subnet 10.10.100.0 netmask 255.255.255.0 {
range 10.10.100.1 10.10.100.50;
option subnet-mask 255.255.255.0;
option routers 10.10.100.2;
option domain-name "ChinaSkills.cn";
option domain-name-servers 114.114.114.114;
default-lease-time 3600;
max-lease-time 7200;
}
重启服务
systemctl restart isc-dhcp-server
测试
在VMware中关闭dhcp
参考:Debian10快速部署DHCP服务 作者:坐公交也用券
更多推荐
已为社区贡献2条内容
所有评论(0)