如何删除 vnet0 接口?

如何删除 vnet0 接口?

在对新推出的 kvm 主机上的无连接问题进行故障排除时,我注意到第二个不需要且可能已在之前创建的桥接口:vnet0

[user@box]# brctl show
bridge name              bridge id           STP enabled  interfaces
br0                      8000.14187769b69a   no           em1
                                                          vnet0
virbr0                   8000.5254003ada63   yes          virbr0-nic

[user@box]# ip route
default via 111.111.111.2 dev br0
169.254.0.0/16 dev br0 scope link metric 1006
111.111.111.0/23 dev br0 proto kernel scope link src 111.111.111.44
192.168.122.0/24 dev virbr0 proto kernel scope link src src 192.168.122.1

这里分别是 ifcfg-br0 和 em1 文件:

[user@box ~]# cat /etc/sysconfig/network-scripts/ifcfg-br0 
TYPE=Bridge
BOOTPROTO=static
IPV4_FAILURE_FATAL=no
IPV6INIT=no
NAME=br0
PREFIX=23
DEVICE=br0
ONBOOT=yes
IPADDR=111.111.111.44
GATEWAY=111.111.111.2
DNS1=4.4.4.4

[user@box ~]# cat /etc/sysconfig/network-scripts/ifcfg-em1
TYPE=Ethernet
NM_CONTROLLED=no
NAME=em1
DEVICE=em1
ONBOOT=yes
BRIDGE=br0

具有功能齐全的网桥的姐妹 EL7 系统如下所示:

[user@box]# brctl show
bridge name              bridge id           STP enabled  interfaces
br0                      8000.141877699b     no           em1
virbr0                   8000.5254004bc0f4   yes          virbr0-nic

[user@box]# ip route
default via 111.111.111.2 dev br0 
111.111.111.0/23 dev br0  proto kernel  scope link  src 111.111.111.222
192.168.122.0/24 dev virbr0  proto kernel  scope link  src 192.168.122.1 

[user@box ~]# cat /etc/sysconfig/network-scripts/ifcfg-br0 
TYPE=Bridge
BOOTPROTO=static
IPV4_FAILURE_FATAL=no
IPV6INIT=no
NAME=br0
PREFIX=23
DEVICE=br0
ONBOOT=yes
IPADDR=111.111.111.222
GATEWAY=111.111.111.2
DNS1=4.4.4.4

[user@box ~]# cat /etc/sysconfig/network-scripts/ifcfg-em1
TYPE=Ethernet
NM_CONTROLLED=no
NAME=em1
DEVICE=em1
ONBOOT=yes
BRIDGE=br0

我尝试使用virsh net-destroy vnet0,但我看到failed to get network vnet0

如何vnet0从第一个示例中删除流氓接口?

答案1

要禁用 virbr0,请尝试:

virsh net-destroy 默认值

virsh net-取消定义默认值

服务 libvirtd 重新启动

如果配置

相关内容