分类: LINUX
2009-09-29 13:56:03
DHCP服务:
服务器端安装软件包:#rpm –ivh dhcp-2. x.x.rpm
脚本程序: /etc/rc.d/init.d/dhcp
配置文件自己创建:/etc/dhcpd.conf
#vi /etc/dhcpd.conf
subnet 192.168.2.0 netmask 255.255.255.0
{ range 192.168.2.2 192.168.2.120;
default-lease-time 864000;
max-lease-time 864000;
option routers 192.168.2.220;
option domain-name “dhcp.com”;
option domain-name-servers 61.134.1.4;
}
一个简单的DHCP服务配好了。
#service dhcpd start
测试的时候先把防火墙关了,服务器端可以查看有无客户端:
#cd /var/lib/dhcp #cat dhcpd.leases
如果要给客户端绑定IP,需要客户机的MAC地址:
#vi /etc/dhcpd.conf
host mycomputer(计算机名)
{ fixed-address 192.168.2.55;
hardware ethernet 00:
default-lease-time 864000;
max-lease-time 864000;
option routers 192.168.2.220;
option domain-name “proxy.dhcp.com”;
option domain-name-servers 61.134.1.4;
}
这个模块是嵌套在上面的配置中的!
如果想再添一个子网,和上面一样:
subnet 192.168.3.0 netmask 255.255.255.0
{ }