1.临时方法
ifconfig eth0 192.168.5.40 netmask 255.255.255.0
ifup eth0 打开网络
ifdown eth0
ifup eth0
2.长期临时方法
vim /root/.profile
增加 ifconfig eth0 192.168.5.40 netmask 255.255.255.0
3.长期方法
/etc/network/interfaces
在文末添加:
auto eth0
iface eth0 inet static
address 192.168.10.67
netmask 255.255.255.0
gateway 192.168.10.1
broadcast 192.168.10.255
设置完成后可使用: systemctl restart networking
重新连接网络
如果不生效,可以使用临时方法:
ifconfig eth0 192.168.10.47 (重启后会恢复)
还不行的话,可以在petalinux中修改:
petalinux-config->subsystem auto hardware settings->obtain ip address automatically(n)
static ip address中设置,重新生成操作系统
欢迎光临我的淘宝店:
https://shop113189537.taobao.com/?spm=a211vu.server-web-home.sellercard.15.64f02d58fKtmoz