在串口终端调试中找到rc.local文件
vi /etc/rc.local
在rc.local中添加设置静态Ip,添加内容如下
PATH=/sbin:/bin:/usr/sbin:/usr/bin
ifconfig eth0 192.168.50.174 netmask 255.255.255.0
route add default gw 192.168.1.1
echo "nameserver 114.114.114.114" > /etc/resolv.conf
如图所示
其中主要是通过eth0来设置静态ip地址的,要保证和gw网段一致,设置好重新启动可以看到静态ip设置成功。