设置IP地址:
eth0:172.17.17.1
eth1:192.168.1.1
eth2:192.168.2.1
# vi /etc/sysctl.conf
# echo 1 > /proc/sys/net/ipv4/conf/all/bootp_relay
# echo 1 > /proc/sys/net/ipv4/ip_forward
2、
# vi /etc/sysconfig/dhcrelay
INTERFACES="eth0 eth1 eth2"
DHCPSERVERS="172.17.17.2"
3、
# chkconfig --level 2345 dhcrelay on
# /etc/init.d/dhcrelay start
--------------------------------------------------------
设置IP地址:
eth0:172.17.17.2
1、
# vi /etc/dhcpd.conf
ignore client-updates;
default-lease-time 12000;
max-lease-time 24000;
option time-offset -18000;
subnet 172.17.17.0 netmask 255.255.255.0 {
option routers 172.17.17.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 172.17.17.1;
range 172.17.17.11 172.17.17.254;
host printer {
hardware ethernet 00:12:fc:78:AB:CD;
fixed-address 172.17.17.3;
}
}
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.1.1;
range 192.168.1.11 192.168.1.254;
}
subnet 192.168.2.0 netmask 255.255.255.0 {
option routers 192.168.2.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.2.1;
range 192.168.2.11 192.168.2.254;
}
# vi /etc/sysconfig/dhcpd
DHCPDARGS="eth0"
3、
# /etc/init.d/dhcpd start