我們的目標很簡單,DHCP服務器分配的地址範圍爲:192.168.18.100 ~ 192.168.18.199,默認網關爲192.168.18.253,在eth0上使用DHCP服務器。
生成一個文件:
gedit /etc/udhcpd.conf
該文件的內容爲:
start 192.168.18.100 #起始地址
end 192.168.18.199 #結束地址
interface eth0 #默認端口
opt router 192.168.18.253 #默認網關
系統啓動時啓動udhcpd服務器的方法爲:
在/etc/profile的最後寫入
udhcpd -S /etc/udhcpd.conf