2016-03-15 21 views
-2

我試圖使用udhcpd,在busybox中的一個DHCP服務器來獲取IP地址。 我正在研究一個帶有標準linux的ARM平臺。從udhcpd獲得的網絡掩碼的問題

根據udhcpd.conf文件中設置的範圍,但DHCP掩碼設置爲255.255.255.255,dhcp客戶端IP地址正常。 如果我手動將其更改爲255.255.255.0,服務完美工作,但我不明白爲什麼網絡掩碼設置爲此,可以修改哪些內容以使其自動生效。

的(簡單)的conf文件:

# Sample udhcpd configuration file (/etc/udhcpd.conf) 
# Values shown are defaults 

# The start and end of the IP lease block 
start   192.168.7.2 
end    192.168.7.254 

# The interface that udhcpd will use 
interface  usb0 

option   subnet 255.255.255.0 (tested with or without this option) 

希望有人能夠幫助我undertand什麼

回答

0

終於發現了問題的根源...... 我編輯.conf文件中的問題與gedit,它會在行尾放置一個'^ M'字符。我可以看到這個並使用VI工具修復它。 所以這是udhcpd無法理解的。