1. ifconfig //查看网络相关信息
2. ifconfig eth0 192.168.1.103 netmask 255.255.255.0 //配置eth0的IP地址
3. route -n //查询路由信息
4. route add default gw 192.168.1.1
使用 ifconfig eth0 192.168.1.103 netmask 255.255.255.0 配置IP后开发板重启,IP地址丢失需要重新配置。
vim /etc/network/interfaces
auto eth0iface eth0 inet static address 192.168.1.41 gateway 192.168.1.1 netmask 255.255.255.0 dns-nameserver 114.114.114.114重启网卡
ifdown eth0
ifup eth0eth0的IP地址则固定。