小编udo*_*dan的帖子

CentOS 7 - 无需重启即可重命名网络接口

我正在通过修改/etc/sysconfig/network-scripts.

  • eth0 -> nic0
  • eth1 -> nic1

修改后的网络脚本内容如下:

# cat /etc/sysconfig/network-scripts/ifcfg-nic0
DEVICE=nic0
BOOTPROTO=static
ONBOOT=yes
HWADDR=xx:xx:xx:xx:xx:xx
USERCTL=no
IPV6INIT=no
MASTER=bond0
SLAVE=yes
Run Code Online (Sandbox Code Playgroud)

重新启动会激活新配置。但是如何在重新启动的情况下激活此配置?

Asystemctl restart network不起作用。

我可以按旧名称 ( ifdown eth0)关闭一个接口,但ifup无论提供旧名称还是新名称,都会导致以下消息:

错误:[/etc/sysconfig/network-scripts/ifup-eth] 设备 nic0 似乎不存在,延迟初始化。

/etc/init.d/network status 显示此输出:

Configured devices:
lo bond0 nic0 nic1
Currently active devices:
lo eth0 eth1 bond0
Run Code Online (Sandbox Code Playgroud)

两者,ifconfigip a显示旧的接口名称。

configuration centos network-interface

25
推荐指数
3
解决办法
18万
查看次数

标签 统计

centos ×1

configuration ×1

network-interface ×1