本文共 1053 字,大约阅读时间需要 3 分钟。
角色 ip地址 网关dhcp服务器 192.168.8.81 192.168.8.1客户机1 动态获取 192.168.8.81客户机2 192.168.8.99 192.168.8.81
yum -y install dhcp
b. 更改配置文件:vim /etc/dhcp/dhcpd.conf
default-lease-time 600;max-lease-time 7200;subnet 192.168.8.0 netmask 255.255.255.0 {range 192.168.8.90 192.168.8.100;option routers 192.168.8.1;}host printer {hardware ethernet 00:0c:29:48:c5:a2;fixed-address 192.168.8.99;}c. 启动服务:
systemctl start dhcpd
TYPE=EthernetBOOTPROTO=dhcpDEFROUTE=yesPEERDNS=yesPEERROUTES=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_PEERDNS=yesIPV6_PEERROUTES=yesIPV6_FAILURE_FATAL=noIPV6_ADDR_GEN_MODE=stable-privacyNAME=eth0DEVICE=eth0ONBOOT=yesGATEWAY=192.168.8.81 #网关一定要设置成dhcp服务器的ip地址NETMASK=255.255.255.0DNS1=8.8.8.8DNS2=114.114.114.114
b. 重启网络服务:
systemctl restart network
ip ab. 客户机2:
ip a
转载地址:http://lyfco.baihongyu.com/