DHCP
[root@lai18 html]# ifconfig ens33
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.118.118 netmask 255.255.255.0 broadcast 172.16.118.255
inet6 fe80::cc92:1612:53f5:26dd prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:37:c8:db txqueuelen 1000 (Ethernet)
RX packets 7452 bytes 710992 (694.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5802 bytes 857597 (837.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ping -c 1 172.16.118.118
[root@lai18 html]# arp -n
Address HWtype HWaddress Flags Mask Iface
172.16.118.254 (incomplete) ens33
172.16.118.188 ether 02:00:4c:4f:4f:50 C ens33
rpm -q dhcp
yum -y install dhcp
cp -p /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak
cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf
cp:是否覆盖"/etc/dhcp/dhcpd.conf"? y
vi /etc/dhcp/dhcpd.conf
ddns-update-style none;
log-facility local7;
subnet 172.16.118. 0 netmask 255.255.255.0 {
range 172.16.118.1 172.16.118.87;
range 172.16.118.89 172.16.118.99;
range 172.16.118.100 172.16.118.254;
option subnet-mask 255.255.255.0;
option routers 172.16.118.254;
option domain-name "cqipc.eud";
option domain-name-servers 8.8.8.8,61.128.128.68;
default-lease-time 600;
max-lease-time 7200;
}
host zhangsan{
hardware ethernet 02:00:4c:4f:4f:50;
fixed-address 172.16.118.88;
}
systemctl restart dhcpd
systemctl enable dhcpd
cat /var/lib/dhcpd/dhcpd.leases
