dhcp中继代理server1:
编辑中继配置文件:vim /etc/sysconfig/dhcrelay
INTERFACES="eth0 eth1 eth2"
DHCPSERVERS="172.17.17.2"
开启网卡功能:echo 1 >/proc/sys/net/ipv4/ip_forward
启动中继代理服务:service dhcrelay start
server2
setup设置IP地址,掩码,网关分别为:172.17.17.2,255.255.255.0,172.17.17.1
cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf 拷贝模板文件并覆盖原有的主配置文件
编辑配置文件:vim /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
option time-offset
default-lease-time 21600;
max-lease-time 43200;
subnet 172.17.17.0 netmask 255.255.255.0 {
option routers
option subnet-mask
range dynamic-bootp 172.17.17.100 172.17.17.200;
host print {
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 172.17.17.101;
}
}
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.1.100 192.168.1.200;
}
subnet 192.168.2.0 netmask 255.255.255.0 {
option routers 192.168.2.1;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.2.100 192.168.2.200;
}
启动dhcp服务:service dhcpd start