全部博文(16)
分类: LINUX
2009-05-14 12:39:31
格式如下
shared-network 超级作用域名称 {
[参数]
subnet 子网编码 netmask 掩码 {
[参数]
[声明]
}
subnet 子网编码 netmask 掩码 {
[参数]
[声明]
}
}
下边是实例
公司IP地址是192.168.1.0/24网段,可以容纳254台机器,使用DHCP服务器建立一个192.168.0.0网段的作用域,动态管理IP地址;
但网络规模扩大到400台机器,一个C类网络就无法满足要求,这时可以再为DHCP服务器添加一个新的作用域,管理分配192.168.1.0网段的IP,为网络增加254个新地址,只需要一个网卡就可以了
1,更改配置文件
ddns-update-style interim;
ignore client-updates;
shared-network mylab { #超级作用域名称为mylab
;option domain-name "test.com"; #注释掉,环境里目前没有域
;option domain-name-servers 192.168.0.1 #注释掉
default-lease-time 43200;
max-lease-time 86400;
subnet 192.168.0.1 netmask 255.255.255.0 {
option routers 192.168.0.1;
range dynamic-bootp 192.168.0.10 192.168.0.250;
}
subnet 192.168.1.1 netmask 255.255.255.0; {
option routers 192.168.1.1;
range dynamic-bootp 192.168.1.10 192.168.1.250;
}
}
2,重新加载配置文件
[root@mylab ~]# service dhcpd reload
[root@mylab ~]# service dhcpd status
dhcpd (pid 4600) is running...
查看/var/log/message里边的内容,启动成功
May 13 06:34:47 mylab dhcpd: Internet Systems Consortium DHCP Server V3.0.5-RedHat
May 13 06:34:47 mylab dhcpd: Copyright 2004-2006 Internet Systems Consortium.
May 13 06:34:47 mylab dhcpd: All rights reserved.
May 13 06:34:47 mylab dhcpd: For info, please visit
May 13 06:34:47 mylab dhcpd: Wrote 1 leases to leases file.
May 13 06:34:47 mylab dhcpd: Listening on LPF/eth0/00:0c:29:96:09:d4/mylab
May 13 06:34:47 mylab dhcpd: Sending on LPF/eth0/00:0c:29:96:09:d4/mylab
May 13 06:34:47 mylab dhcpd: Sending on Socket/fallback/fallback-net