将今天测试的DHCP代码,拿出来供参阅.
ddns-update-style interim;
ignore client-updates; #以上两个参数作为全局参数
subnet 192.168.1.0 netmask 255.255.255.0 { #定义作用域,既一个IP子网段
range dynamic-bootp 192.168.1.10 192.168.1.254; #ip地址范围
# --- default gateway
option routers 192.168.1.1; #DHCP客户端ip网关选项
option subnet-mask 255.255.255.0; #DHCP客户端ip子网掩码选项
# option nis-domain "domain.org";
# option domain-name "domain.org";
option domain-name-servers 202.102.200.101,202.102.192.68; #DHCP客户端DNS选项
option broadcast-address 192.168.1.255; #广播地址
# 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;
default-lease-time 21600;
max-lease-time 43200; #以上两个选项为Dhcp租用期限
# we want the nameserver to appear at a fixed address
host ns1 { #定义保留地址
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 192.168.1.99;
}
host ns2 {
hardware ethernet 00:14:78:bf:92:34;
fixed-address 192.168.1.121;
}
}
#注意,请保证你的DHCP服务器,与IP作用域处于同一网段,本例是在192.168.1.0/24这个网段上写的.