dhcp服务器配置
1- dhcp服务器搭建
yum -y install dhcp
cp -p /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf
vim /etc/dhcp/dhcpd.conf
subnet 192.168.3.0 netmask 255.255.255.0 {
range 192.168.3.200 192.168.3.210;//地址池,起始地址,末尾地址。linux从大到小,windows从小到大
// option domain-name-servers 202.106.0.20;//dns服务器最多三个,用逗号隔开
// option domain-name "internal.example.org";//域名
option routers 192.168.3.1;//默认网关
option subnet-mask 255.255.255.0;//子网掩码
//option broadcast-address 10.5.5.31;
default-lease-time 600;//租约时间单位秒
max-lease-time 7200;//最大租约时间
# host ns {
# netxt-server dns.fengge.com;//实现pxe,获取引导文件
# hardware ethernet 12:34:56:78:AB:CD;//网卡
# fixed-address 192.168.3.9;//保留地址
# }
}
2- udp 67端口 服务器
udp 68 客户端
3- tail -f /var/lib/dhcpd/dhcpd.leases
dhclient eth0 //获取ip
dhclient -d //ctrl+c 取消