dhcp中继代理

第一部:先安装dhcp软件包  用yum安装
第二部:配置DHCP文件 在/etc/dhcpd.conf中 配置文件如下:
ddns-update-style interim;
ignore client-updates;

subnet 192.168.18.0 netmask 255.255.255.0 {

# --- default gateway
        option routers                  192.168.18.54;
        option subnet-mask              255.255.255.0;

#       option nis-domain               "domain.org";
#       option domain-name              "domain.org";
#       option domain-name-servers      192.168.1.1;

        option time-offset              -18000; # Eastern Standard Time
#       option ntp-servers              192.168.1.1;
#       option netbios-name-servers     192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
#       option netbios-node-type 2;

        range dynamic-bootp 192.168.18.128 192.168.18.254;
        default-lease-time 21600;
        max-lease-time 43200;
    }
subnet 192.168.1.0 netmask 255.255.255.0 {
        option routers                  192.168.1.1;
        option subnet-mask              255.255.255.0;
        option time-offset              -18000; # Eastern Standard Time

          range dynamic-bootp 192.168.1.128 192.168.1.254;
        default-lease-time 21600;
        max-lease-time 43200;
}
subnet 172.17.17.0 netmask 255.255.255.0 {
        option routers                  172.17.17.1;
        option subnet-mask              255.255.255.0;
        option time-offset              -18000; # Eastern Standard Time

          range dynamic-bootp 172.17.17.128 172.17.17.254;
        default-lease-time 21600;
        max-lease-time 43200;

}
  # we want the nameserver to appear at a fixed address
        host ns {
                next-server marvin.redhat.com;
                hardware ethernet 12:34:56:78:AB:CD;
                fixed-address 207.175.42.254;
        }

启动DHCP服务:
service dhcpd start


配置DHCP 中继代理

     配置文件如下
INTERFACE="eth0 eth1 eth2"
DHCDSERVERS="192.168.18.94"
启动dhcrelay
service dhcrelay start
echo 1 >/proc/sys/net/ipv4/ip_forward(开启网卡转发功能)
测试

 

 

你可能感兴趣的:(DHCP)