技术专栏
udhcpd配置及使用
基于mips芯片qca953x平台;
今天测试板子wifi无线连接的时候,手机端怎么也连接不上,连上wifi后手机端立即就闪断了,后面发现原因是无线路由开发板没有开启dhcp服务器,手机端获取不到ip地址,下面来讲下busybox的dhcp服务器udhcpd的使用及配置。
1.使用原始的udhcpd配置文件/etc/udhcpd.conf启动dhcp服务器udhcpd,结果出现以下错误
~ # udhcpd /etc/udhcpd.conf &
info, udhcpd (v0.9.9-pre) started
error, max_leases value (254) not sane, setting to 234 instead
error, Unable to open /var/lib/misc/udhcpd.leases for reading
error, SIOCGIFADDR failed, is the interface up and configured?: No such device
- 1
- 2
- 3
- 4
- 5
原始的/etc/udhcpd.conf文件内容,部分省略,省略部分采用原来的默认配置:
# Sample udhcpd configuration file (/etc/udhcpd.conf)
# The start and end of the IP lease block
start 192.168.1.20 #default: 192.168.0.20
end 192.168.1.254 #default: 192.168.0.254
# The interface that udhcpd will use
interface ixp0 #default: eth0
# The maximim number of leases (includes addressesd reserved
# by OFFER's, DECLINE's, and ARP conficts
#max_leases 254 #default: 254
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
修改后的/etc/udhcpd.conf文件内容,部分省略,省略部分采用原来的默认配置:
# Sample udhcpd configuration file (/etc/udhcpd.conf)
# The start and end of the IP lease block
start 192.168.1.20 #default: 192.168.0.20
end 192.168.1.254 #default: 192.168.0.254
# The interface that udhcpd will use
interface br0 #default: eth0 --- 解决error, SIOCGIFADDR failed, is the interface up and configured?: No such device
# The maximim number of leases (includes addressesd reserved
# by OFFER's, DECLINE's, and ARP conficts
max_leases 234 #default: 254 --- 解决error, max_leases value (254) not sane, setting to 234 instead
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
解决error, Unable to open /var/lib/misc/udhcpd.leases for reading,在板子上执行以下命令:
# mkdir -p /var/lib/misc/
# touch /var/lib/misc/udhcpd.leases
- 1
- 2
2.再次启动udhcpd进程
# udhcpd /etc/udhcpd.conf &
- 1
然后手机重连板子的wifi,手机获取到ip地址后,wifi无线连接成功。
声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
红包
点赞
收藏
评论
打赏
- 分享
- 举报
评论
0个
手气红包

相关专栏
-
浏览量:1457次2023-07-20 11:05:58
-
浏览量:2261次2018-06-27 17:06:49
-
浏览量:3930次2017-11-21 13:44:59
-
浏览量:1000次2023-08-09 15:19:33
-
浏览量:6696次2018-08-28 16:40:09
-
浏览量:1431次2023-09-20 17:34:18
-
浏览量:1008次2023-06-15 11:42:45
-
浏览量:26199次2021-01-29 14:36:29
-
浏览量:1829次2024-01-12 17:56:48
-
浏览量:1141次2023-11-17 11:33:55
-
浏览量:8869次2020-12-30 17:36:42
-
浏览量:4997次2022-03-30 09:00:15
-
浏览量:1542次2023-07-13 16:10:48
-
浏览量:6790次2021-09-07 16:20:24
-
浏览量:8746次2017-12-01 16:55:09
-
浏览量:3124次2020-07-29 15:38:57
-
浏览量:3238次2022-11-11 11:34:05
-
浏览量:1450次2019-12-10 15:13:25
-
浏览量:11917次2022-03-18 09:00:47
置顶时间设置
结束时间
删除原因
-
广告/SPAM
-
恶意灌水
-
违规内容
-
文不对题
-
重复发帖
打赏作者

蜡笔不信
您的支持将鼓励我继续创作!
打赏金额:
¥1

¥5

¥10

¥50

¥100

支付方式:

举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
审核成功
发布时间设置
发布时间:
请选择发布时间设置
是否关联周任务-专栏模块
审核失败
失败原因
请选择失败原因
备注
请输入备注