|
方法一:通过命令行配置(临时)- ifconfig eth0 192.168.10.100 netmask 255.255.255.0
- route add default gw 192.168.100.1
复制代码 方法二:写配置文件- 对/foundation/communication/netmanager_ext/services/ethernetmanager/config/ethernet_interfaces.json文件进行IP配置,重新编译烧录后即可。
- #cat /system/etc/communication/netmanager_ext/ethernet_interfaces.json
- {
- "config_ethernet_interfaces":[
- {
- "iface":"eth0",
- "caps":[
- ],
- "ip":"192.168.10.120",
- "gateway":"192.168.10.255",
- "dns":"",
- "netmask":"255.255.255.0",
- "route":"",
- "routemask":""
- },
- {
- "iface":"",
- "caps":[
- ],
- "ip":"",
- "gateway":"",
- "dns":"",
- "netmask":"",
- "route":"",
- "routemask":""
- }
- ]
- }
复制代码 查看网络信息:- 查看ip:
- ifconfig -a
- 查看路由表:
- cat /proc/net/fib_trie
复制代码 或者通过自己移植busybox,使用ip工具族查看或修改网络 |
|