从udhcpd获得的网络掩码问题

时间:2016-03-15 20:55:39

标签: dhcp busybox netmask

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

根据udhcpd.conf文件中设置的范围,dhcp客户端IP地址是可以的,但网络掩码设置为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)

希望有人可以帮我解决问题

1 个答案:

答案 0 :(得分:0)

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