- 论坛徽章:
- 0
|
在RHEL4系统中配置DHCP服务器及DHCP中继代理
2007-07-09 kenthy#qingdaonews.com
######################################################
系统环境:RHEL4 [ 2.6.9-5.EL ]
软件版本:
dhcp-3.0.1-12_EL
dhclient-3.0.1-12_EL
目标功能:
使用一台RHEL4服务器[Server1]连接A、B、C三个网段,A网段中有一台DHCP服务器[Server2]。需要在Server1上配置dhcp中继代理,以使Server2能够给三个网段的客户机自动分配IP地址,给A网段的网络打印机绑定永久IP地址。
实验参数如下:
Server1:
eth0: 172.17.17.1/24
eth1: 192.168.1.1/24
eth2: 192.168.2.1/24
Server2:
eth0: 172.17.17.2/24
######################################################
Server1 [DHCP中继]:
1、# vi /etc/sysctl.conf
net.ipv4.conf.all.bootp_relay = 1
net.ipv4.ip_forward = 1
# 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
[注:如果仅当次测试可以使用“/usr/sbin/dhcrelay -i eth0 -i eth1 -i eth2 172.17.17.2”命令启动dhcp中继服务]
Server2 [DHCP服务器]:
1、# vi /etc/dhcpd.conf
ddns-update-style none;
ignore client-updates;
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,202.106.0.20;
option time-offset -18000;
range 172.17.17.100 172.17.17.200;
default-lease-time 36000;
max-lease-time 86400;
host printer {
hardware ethernet 00:12:fc:78:AB:CD;
fixed-address 172.17.17.250;
}
}
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,202.106.0.20;
option time-offset -18000;
range 192.168.1.100 192.168.1.200;
default-lease-time 36000;
max-lease-time 86400;
}
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,202.106.0.20;
option time-offset -18000;
range 192.168.2.100 192.168.2.200;
default-lease-time 36000;
max-lease-time 86400;
}
2、# vi /etc/sysconfig/dhcpd
DHCPDARGS="eth0"
3、# chkconfig --level 2345 dhcpd on
# /etc/init.d/dhcpd start
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/40349/showart_337110.html |
|