# =============================================================================#
# 設定檔:/usr/local/etc/dhcpd.conf
# 先架好 NAT 後,再來建立 DHCP 功能。
# /usr/local/sbin/dhcpd -cf /usr/local/etc/dhcpd.conf vr1
# =============================================================================#
#server-identifier 192.168.1.254 ; # 標明此伺服器名稱
default-lease-time 21600; # 租約使用時間: 6 小時
max-lease-time 86400; # 最大租期長度: 1 天
option domain-name-servers 211.75.215.107,168.95.1.1,139.175.55.244 ; # 可用的名稱伺服器,最多指定三台
option domain-name "bsdlab.idv.tw"; # 所屬的網域名稱
option routers 192.168.1.254 ; # 子網路路由器(gateway)
option broadcast-address 192.168.1.255 ; # 廣播封包位置
option perform-mask-discovery on;
option mask-supplier on;
ddns-update-style none;
#### ------ 宣告 NAT 網域之動態IP ------ ####
group { # 宣告一個群組
# 192.168.1.1 ~ 192.168.1.63 保留給其他特定的主機或設備系統(如印表機)使用
subnet 192.168.1.0 netmask 255.255.255.0 { # 子網路與網路遮罩
range dynamic-bootp 192.168.1.64 192.168.1.120 ; # 動態分配 IP 位置範圍(一)
range dynamic-bootp 192.168.1.193 192.168.1.250 ; # 動態分配 IP 位置範圍(二)
}
# 下列主機(根據網卡編號-MAC Address)因用途特殊,所以固定IP。
host epa91ba3 { # EPSON EPL-5700 + 10Base-T/2 Interface Card
hardware ethernet 00:00:48:a9:1b:a3;
fixed-address 192.168.1.32;
option host-name "epa91ba3";
}
# 192.168.1.220 ~ 192.168.1.226 指定給運動賽會時各工作站使用
host pc220 {
hardware ethernet 00:80:c8:f8:07:10;
fixed-address 192.168.1.220;
option host-name "pc220";
}
host pc221 {
hardware ethernet 00:80:c8:f8:7e:0b;
fixed-address 192.168.1.221;
option host-name "pc221";
}
host pc224 {
hardware ethernet 00:50:ba:20:35:65;
fixed-address 192.168.1.224;
option host-name "pc224";
}
host pc225 {
hardware ethernet 00:50:ba:00:0b:de;
fixed-address 192.168.1.225;
option host-name "pc225";
}
host denyclient_001 { # 讓這塊網卡不得使用DHCP取得IP
hardware ethernet 00:e0:c5:e4:02:ee;
deny booting;
}
}
|