Linux 基础 之 dhcp 的 配置
首先得先完成yum命令才可以进行dhcp的相关操作。
第一步 reset desktop
在 desktop 操作:
vim /etc/hosts
yum search dhcp 查询安装的文件名称
yum install dhcp.x86_64 -y 安装dhcp.x86_64 -y文件
cd /etc/dhcp/
ls
vim dhcpd.conf
ls
vim dhcpd.conf
7 域名 “example.com”
8 DNS server 114.114.114.114
10/11 不改
22 不改
26/27 删掉
30 subnet 172.25.254.0 子网 netmask 255.255.255.0 网络位
31 range 172.25.254.200 172.25.254.210 (范围,从最小到最大)
32 option routers 172.25.254.250 (网关)
34 以后全部删除
systemctl start dhcpd
systemctl enable dhcpd
cat /var/lib/dhcpd/dhcpd.leases
hardware ethernet 52:54:00:00:1d:0b
第二步、拔掉网线 reset server
在server操作:ifconfig
enther 52:54:00:00:1b:0b
两者相同,说明成功
排错:如果不相同,那就在desktop中重新cat文件,然后再在server中ifconfig.