-2

我正在尝试使用busybox中的dhcp服务器udhcpd来获取IP地址。我正在开发一个带有标准 linux 的 ARM 平台。

dhcp 客户端 IP 地址没问题,根据 udhcpd.conf 文件中设置的范围,但网络掩码设置为 255.255.255.255。如果我手动将其更改为 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)

希望有人可以帮助我了解问题所在

4

1 回答 1

0

终于找到了问题的根源......我正在用 gedit 编辑 .conf 文件,它在行尾放置了一个像 '^M' 这样的字符。我可以看到这个并使用 VI 工具修复它。所以 udhcpd 是无法理解的。

于 2016-03-16T09:25:14.303 回答