首先,查看目前经动态分配(DHCP)得到的IP信息
ip addr 然后,编辑/etc/sysconfig/network-scripts/ifcfg-eth0文件,如果没有则创建
ip addr
/etc/sysconfig/network-scripts/ifcfg-eth0
vim etc/sysconfig/network-scripts/ifcfg-eth0
图片参考大佬:https://blog.csdn.net/qq_38138069/article/details/80982527
保存,之后执行service network restart或者重启即可。
service network restart