DHCP 服务

配置环境

server和client 设置网卡1(仅主机模式)
server :只配ip 192.168.19.2其他不用配置
client ipv4和ipv6全部设置为Automatic
关闭 虚拟机软件 网卡1默认开启DHCP

server服务器

安装DHCP

yum -y install dhcp
systemctl restart dhcpd
systemctl enable dhcpd

修改主配置文件

vim /etc/dhcp/dhcpd.conf

ddns-update-style none;  不自动动态更新
ignore client-updates;   忽略client机更新DNS记录
subnet 192.168.18.0 netmask 255.255.255.0{
range 192.168.18.20 192.168.18.50;
option subnet-mask 255.255.255.0;
option routers 192.168.18.2;   定义客户机的网关地址
option domain-name "linuxprobe.com";
option domain-name-servers 192.168.18.2;   定义客户机的DNS地址
default-lease-time 21600;  定义默认租约时间
max-lease-time 43200;   最大预约时间
}

systemctl start dhcpd
systemctl enable dhcpd

client

yum -y install dhcp
systemctl restart dncpd
systmectl enabled dhcpd

验证

在client 客户机 :
ifconfig 看ip地址有没在设置的ip范围内

猜你喜欢

转载自blog.csdn.net/UPNEW/article/details/82939185