免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1097 | 回复: 0
打印 上一主题 下一主题

在RHEL4系统中配置DHCP服务器及DHCP中继代理 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-07-10 11:58 |只看该作者 |倒序浏览
在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
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP