Rhel5.6下DHCP中继代理的实现

第一个Server1设置三块网卡作为中继器
设置IP地址:
eth0:172.17.17.1
eth1:192.168.1.1
eth2:192.168.2.1
    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
--------------------------------------------------------
Server2作为DHCP服务器:
设置IP地址:
eth0:172.17.17.2
 
   1、
# vi /etc/dhcpd.conf
ddns-update-style none;
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;
}
    2、
# vi /etc/sysconfig/dhcpd
DHCPDARGS="eth0"
 
    3、
# /etc/init.d/dhcpd start
 

你可能感兴趣的:(linux,DHCP,中继代理)