现象:
在开发板命令行输入:
#ifconfig
如果没有返回,则需要配置 ip。
解决方法:
配置 ip:
#ifconfig eth0 down
#ifconfig eth0 hw ether 00:00:AA:BB:CC:DD
#ifconfig eth0 up
#ifconfig eth0 192.168.0.230 //设定ip
配置网关:
#route add default gw 192.168.0.1
*以上板子重启后,需手动设置。
设置固定 ip:
//设置为开机启动项
#vi /etc/init.d/rcS
//添加以下内容
ifconfig eth0 192.168.0.230 netmask 255.255.255.0 up
//:wq 保存文档
//在命令行同步文件修改
#sync
即可实现重启自动设置固定 ip。