安裝套件
$ sudo apt-get install dhcp3-server設定DHCP Server的網卡介面,編輯/etc/default/dhcp3-server檔案:
$ sudo vim /etc/default/dhcp3-server INTERFACES="eth1"設定DHCP Server,編輯/etc/dhcp3/dhcpd.conf:
$ sudo vim /etc/dhcp3/dhcpd.conf default-lease-time 600; max-lease-time 7200; option subnet-mask 255.255.255.0; option broadcast-address 192.168.1.255; option routers 192.168.1.1; option domain-name-servers 8.8.8.8, 168.95.1.1; option domain-name "reneeciou.example"; subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.10 192.168.1.100; range 192.168.1.150 192.168.1.200; }重新啟動DHCP Server:
$ sudo /etc/init.d/dhcp3-server restartDHCP Server 啟動|停止|狀態:
$ sudo /etc/init.d/dhcp3-server start|stop|status底下是DHCP Protocol的Flow:
可以透過Wireshark抓取DHCP的封包:
IP封包格式:
UDP封包格式:
BOOTP封包格式:
DHCP封包格式:
沒有留言:
張貼留言