CentOS DHCP
安装
1 | yum update |
修改 ip
1 | vim /etc/sysconfig/network-scripts/ifcfg-eth2 |
1 | DEVICE="eth2" |
- 重启网络
1 | service network restart |
服务端配置
- 路径
1 | /etc/dhcp/dhcpd.conf |
- 复制 dhcpd.conf.samplle
1 | cp -p /usr/share/doc/dhcp-6.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf |
- 配置文件设置
1 | ddns-update-style interim;// dhcp 服务器和dns 服务器的动态信息更新模式 |
- 启动
1 | service dhcpd start |
客户端配置
1 | vim /etc/sysconfig/network-scripts/ifcfg-eth2 |
1 | DEVICE="eth2" |
- 重启网络
1 | ifdown eth2 |
查看租约情况
1 | cat /var/pib/dhcpd/dhcpd.leases |