免费注册 查看新帖 |

Chinaunix

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

Linux DHCP 服务器配置 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-12-11 11:01 |只看该作者 |倒序浏览
一,安装(disk 4)
rpm -ivh dhcp-3.0.3-26.rpm
二,配置
[email=root@FedoraCore2]root@FedoraCore2[/email]
~]# rpm -ql dhcp
/etc/dhcpd.conf
/etc/rc.d/init.d/dhcpd
/etc/rc.d/init.d/dhcrelay
/etc/sysconfig/dhcpd
/etc/sysconfig/dhcrelay
/usr/bin/omshell
/usr/sbin/dhcpd
/usr/sbin/dhcrelay
/usr/share/doc/dhcp-3.0.3
/usr/share/doc/dhcp-3.0.3/README
/usr/share/doc/dhcp-3.0.3/RELNOTES
/usr/share/doc/dhcp-3.0.3/dhcpd.conf.sample
/usr/share/man/man1/omshell.1.gz
/usr/share/man/man5/dhcp-eval.5.gz
/usr/share/man/man5/dhcpd.conf.5.gz
/usr/share/man/man5/dhcpd.leases.5.gz
/usr/share/man/man8/dhcpd.8.gz
/usr/share/man/man8/dhcrelay.8.gz
/var/lib/dhcpd
/var/lib/dhcpd/dhcpd.leases
复制配置文件,进行配置
cp /usr/share/doc/dhcp-3.0.3/dhcpd.conf.sample /etc/dhcpd.conf
配置文件dhcpd.conf
ddns-update-style interim;
ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0 {
# --- default gateway
        option routers                  192.168.0.1;
        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.0.128 192.168.0.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;
        }
}
注意接口上一定至少有一个子网的地址
ip addr add 192.168.0.1/24 dev eth0
维护文件
/var/lib/dhcpd/dhcpd.leases
调试查看
less /var/log/messages
DHCP 中继
dhcrelay -p 连接端口 -i 网卡接口 DHCP服务器IP地址
dhcrelay -i eth1 -i eth2 172.16.0.1 192.168.0.1
自动启动服务
ntsysv
chkconfig --leve 5 dhcpd on
chkconfig --leve 3 dhcpd on


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/45117/showart_440065.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP