CentOS 7删除virbr0虚拟网卡

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

 一、查看IP及网桥设备

 

[root@Node1 ~]# ip -4 addr    //查看IP地址

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1

    inet 127.0.0.1/8 scope host lo

       valid_lft forever preferred_lft forever

2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000

    inet 192.168.11.7/24 brd 192.168.11.255 scope global ens33

       valid_lft forever preferred_lft forever

3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN qlen 1000

    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0

       valid_lft forever preferred_lft forever

[root@Node1 ~]# brctl show    //查看网桥

bridge name     bridge id               STP enabled     interfaces

virbr0          8000.5254005caf00       yes             virbr0-nic

[root@Node1 ~]#

 

 二、删除网桥

[root@Node1 ~]# ifconfig virbr0 down  

[root@Node1 ~]# brctl delbr virbr0   //删除网桥

 三、禁用开机服务

[root@Node1 ~]# systemctl disable libvirtd.service    //禁用libvirtd服务开机自启动

Removed symlink /etc/systemd/system/multi-user.target.wants/libvirtd.service.

Removed symlink /etc/systemd/system/sockets.target.wants/virtlockd.socket.

Removed symlink /etc/systemd/system/sockets.target.wants/virtlogd.socket.

[root@Node1 ~]# systemctl mask libvirtd.service       

Created symlink from /etc/systemd/system/libvirtd.service to /dev/null.

 四、验证

 

[root@Node1 ~]# ip -4 add  

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1

    inet 127.0.0.1/8 scope host lo

       valid_lft forever preferred_lft forever

2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000

    inet 192.168.11.7/24 brd 192.168.11.255 scope global ens33

       valid_lft forever preferred_lft forever

posted on 2023-12-04 09:16  Allen158  阅读(210)  评论(0编辑  收藏  举报

导航