linux-dhcp作用域和类
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
linux-dhcp作用域和类
安装dhcp server
[root@myhost ~]# hostname dhcp
[root@myhost ~]# Last login: Wed Oct 5 11:38:14 2011 from 192.168.100.1 [root@dhcp ~]# mkdir /mnt/cdrom
[root@dhcp ~]# mount /dev/cdrom /mnt/cdrom
mount: block device /dev/cdrom is write-protected, mounting read-only [root@dhcp ~]# cd /mnt/cdrom/Server/
[root@dhcp Server]# rpm -ivh dhcp-3.0.5-18.el5.i386.rpm
[root@dhcp Server]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.100.255
HWADDR=00:0C:29:14:B3:4D
IPADDR=192.168.100.70
NETMASK=255.255.255.0
NETWORK=192.168.100.0
ONBOOT=yes
~
[root@dhcpetc]# vim /etc/resolv.conf
nameserver 192.168.100.70
超级作用域、空作用域、绑定
[root@dhcp Server]# vim /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
shared-network zzu {
subnet 192.168.20.0 netmask 255.255.255.0 {
option routers 192.168.20.254;
option subnet-mask 255.255.255.0;
option nis-domain "";
option domain-name "";
option domain-name-servers 192.168.100.70;
option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 192.168.20.128 192.168.20.254;
default-lease-time 21600;
max-lease-time 43200;
host tec { ---ip与mac的绑定,保证每
次分配的地址都是固定的。
next-server ;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 192.168.20.100;
}
}
subnet 192.168.30.0 netmask 255.255.255.0 {
option routers 192.168.30.254;
option subnet-mask 255.255.255.0;
option nis-domain "";
option domain-name "";
option domain-name-servers 192.168.100.70;
option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 192.168.30.128 192.168.30.254;
default-lease-time 21600;
max-lease-time 43200;
host mkt {
next-server ;
hardware ethernet 00:0C:29:F4:CD:0F;
fixed-address 192.168.30.100;
}
}
subnet 192.168.100.0 netmask 255.255.255.0 {
}
}
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.sample
#
~
~
~
"/etc/dhcpd.conf" 45L, 1209C written
[root@dhcp Server]#
[root@dhcp Server]#
[root@dhcp Server]#
[root@dhcp Server]# service dhcpdconfigtest
Syntax: OK
[root@dhcp Server]#
类别
--根据不同的用户群分配不同的地址
[root@dhcpetc]# vim dhcpd.conf
ddns-update-style interim;
ignore client-updates;
――作用域和服务器选项的小区域优先选项
subnet 192.168.20.0 netmask 255.255.255.0 {
--定义类
class "vm" {
match if substring (hardware,1,3) = 00:0C:29; --mac地址前三位匹配的分配的类}