BOOTP & DHCP 的差別是??
BOOTP 是 DHCP 的前身,目前 BOOTP 多用於系統尚未進入作業系統前,需要透過網路環境來獲取資源,如無磁碟主機的開機.
- 通常 BOOTP 客戶端會要求一個 boot image (file) 用來開機.
- BOOTP 客戶端沒有像是 DHCP 有租約時間的限制,.
DHCP Client (Port 68 , 使用廣播封包 broadcast ) 向 DHCP Server (Port 67) 請求 IP (使用 UDP),透過四個動作 ( DHCPDISCOVER , DHCPOFFER , DHCPREQUEST , DHCPACK ) 來獲得.BOOTP 也是類似的動作,但 BOOTP 客戶端沒有像是 DHCP 有租約時間的限制,所以每一次重新開機獲取的 IP 位置可能都會不一樣.
在 Linux 下常用的 ISC DHCP 就可以設定 Bootp.
[root@localhost ~]# cat /etc/dhcpd.conf # ddns-update-style interim ddns-update-style none; ignore client-updates; allow booting; allow bootp; class "pxeclients" { match if substring(option vendor-class-identifier, 0, 9) = "PXEClient"; next-server 192.10.0.1; filename "linux-install/pxelinux.0"; } subnet 192.10.0.0 netmask 255.255.255.0 { range 192.10.0.150 192.10.0.180; option broadcast-address 192.10.0.255; option routers 192.10.0.1; option subnet-mask 255.255.255.0; option domain-name-servers 192.10.0.1; }
主要的設定就是 allow bootp; , bootp 也可以依據需求設定成為 deny bootp; 或是 ignore bootp;
因為 BOOTP 每次開機都會需要一個新的 IP Address ,如果是在測試環境中需要常重新開機的話可以利用 MAC Address 對應 IP Address 的方式設定. host name { hardware ethernet MAC Address; fixed-address IP Address;}
[root@localhost ~]# cat /etc/dhcpd.conf # ddns-update-style interim ddns-update-style none; ignore client-updates; allow booting; allow bootp; class "pxeclients" { match if substring(option vendor-class-identifier, 0, 9) = "PXEClient"; next-server 192.10.0.1; filename "linux-install/pxelinux.0"; } subnet 192.10.0.0 netmask 255.255.255.0 { range 192.10.0.150 192.10.0.180; option broadcast-address 192.10.0.255; option routers 192.10.0.1; option subnet-mask 255.255.255.0; option domain-name-servers 192.10.0.1; group { host client1 { hardware ethernet 00:1F:6A:21:71:3F; fixed-address 192.10.0.140; } host client2 { hardware ethernet 00:1F:6A:21:71:3F; fixed-address 192.10.0.141; } } }