udhcpc命令可以自动获取ip并设置网关,但是若在没有/usr/share/udhcpc/default.script文件的情况下,则只能看到获取的IP以及租赁时间。
udhcpc -i wlan0成功的打印信息
Sending discover…
Sending select for 192.168.43.183…
Lease of 192.168.43.183 obtained, lease time 3600
Setting IP address 192.168.43.183 on wlan0
Deleting routers
route: SIOCDELRT: No such process
Adding router 192.168.43.1
Recreating /etc/resolv.conf
Adding DNS server 192.168.43.1没有default.script文件的打印信息
Sending discover…
Sending select for 192.168.43.183…
Lease of 192.168.43.183 obtained, lease time 3600default.script文件是将busybox中/busybox/examples/udhcp/simple.script文件复制过来即可