Android 命令设置获取、IP地址、网关、dns

设置ip

root@android:/ # ifconfig eth0 192.168.0.173 netmask 255.255.255.0
ifconfig eth0 192.168.0.173 netmask 255.255.255.0

设置网关Gateway

root@android:/ # route add default gw 192.168.0.1 dev eth0


添加dns

root@android:/ # setprop net.eth0.dns1 8.8.8.8

root@android:/ # setprop net.eth0.dns2 8.8.4.4


https://blog.csdn.net/zhang__ao/article/details/78262738
posted @ 2018-05-23 09:22  Ender.Lu  阅读(5748)  评论(0编辑  收藏  举报