初级会员
- 积分
- 144
- 金钱
- 144
- 注册时间
- 2019-5-5
- 在线时间
- 30 小时
|
测试WiFi驱动过程中执行 udhcpc -i wlan0 后没有分配搭配IPudhcpc -i wlan0
udhcpc: started, v1.29.0
udhcpc: sending discover
udhcpc: sending select for 192.168.1.102
udhcpc: lease of 192.168.1.102 obtained, lease time 7200
需要把\busybox-1.1.2\examples\udhcp下的脚本simple.script(是simple.script文件,该目录还有个sample.script文件,注意不要复制错了)改名为default.script,放在开发板上的/usr/share/dhcpc/目录下(目录需要自己创建),才能将获取的IP写到指定的网卡中。
修改后获取IP正常
# udhcpc -i wlan0
udhcpc: started, v1.29.0
Setting IP address 0.0.0.0 on wlan0
udhcpc: sending discover
udhcpc: sending select for 192.168.1.102
udhcpc: lease of 192.168.1.102 obtained, lease time 7200
Setting IP address 192.168.1.102 on wlan0
Deleting routers
route: SIOCDELRT: No such process
Adding router 192.168.1.1
Recreating /etc/resolv.conf
Adding DNS server 192.168.0.1
Adding DNS server 192.168.1.1
然后ping下百度
ping -I 192.168.1.102 www.baidu.com
PING www.baidu.com (180.101.49.12) from 192.168.1.102: 56 data bytes
64 bytes from 180.101.49.12: seq=0 ttl=54 time=6.512 ms
64 bytes from 180.101.49.12: seq=1 ttl=54 time=6.943 ms
64 bytes from 180.101.49.12: seq=2 ttl=54 time=6.873 ms
分配IP,联网都正常
|
|