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 eth0 iface 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 eth0 eth0的IP地址则固定。转载于:https://www.cnblogs.com/emlslxl/p/5527492.html
相关资源:JAVA上百实例源码以及开源项目