CentOS 7.7 下删除 virbr0

在CentOS 7的安装过程中如果有选择相关虚拟化的的服务安装系统后,启动网卡时会发现有一个以网桥连接的私网地址的virbr0网卡,这个是因为在虚拟化中有使用到libvirtd服务生成的,如果不需要可以删除。步骤如下:

1.停止网络服务

ifconfig virbr0 down

2.删除网桥virbr0

brctl delbr virbr0

3.关闭libvirtd服务

virbr0是由libvirtd服务创建,libvirtd在guest里没什么,所以disable掉,不然下次启动又创建了:
systemctl disable libvirtd

4.彻底删除自己不想要的网卡配置信息

[root@zabbix ~]# ip addr list
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno16780032: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:b6:e3:55 brd ff:ff:ff:ff:ff:ff
    inet 10.20.1.250/24 brd 10.20.1.255 scope global noprefixroute eno16780032
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:feb6:e355/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 500
    link/ether 52:54:00:1b:b0:49 brd ff:ff:ff:ff:ff:ff
14: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
    link/none 
    inet 10.2.2.1 peer 10.2.2.2/32 scope global tun0
       valid_lft forever preferred_lft forever

[root@zabbix ~]# virsh net-list
 名称               状态     自动开始  持久
----------------------------------------------------------
 default              活动     是           是

[root@zabbix ~]# virsh net-destroy default
网络 default 被删除

[root@zabbix ~]# virsh net-list
 名称               状态     自动开始  持久
----------------------------------------------------------

[root@zabbix ~]# ip addr list
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno16780032: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:b6:e3:55 brd ff:ff:ff:ff:ff:ff
    inet 10.20.1.250/24 brd 10.20.1.255 scope global noprefixroute eno16780032
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:feb6:e355/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
14: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
    link/none 
    inet 10.2.2.1 peer 10.2.2.2/32 scope global tun0
       valid_lft forever preferred_lft forever
[root@zabbix ~]#

点赞

发表评论

电子邮件地址不会被公开。必填项已用 * 标注