Remove virbr0 virtual network card from CentOS7

During the installation of CentOS 7, if you select the virtualization related services to install the system, you will find a virbr0 network card with a private network address connected by a bridge when you start the network card. This is because the libvirtd service is used in virtualization to generate the card. If you do not need to close it, you can remove it:

I. view IP and bridge equipment


[root@Node1 ~]#IP - 4 addr / / view IP address
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.10.7/24 brd 192.168.10.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 / / view the bridge
bridge name     bridge id               STP enabled     interfaces
virbr0          8000.5254005caf00       yes             virbr0-nic
[root@Node1 ~]#


II. Delete the bridge

[root@Node1 ~]# ifconfig virbr0 down   
[root@Node1 ~]#brctl delbr virbr0 / / delete Bridge

III. disable power on Service

[root@Node1 ~]#systemctl disable libvirtd. Service / / disable libvirtd service. Start the libvirtd service. Remove 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.

Verification


[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 forever2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    inet 192.168.10.7/24 brd 192.168.10.255 scope global ens33
       valid_lft forever preferred_lft forever


Verified that virbr0 has been deleted****


Tags: Linux network socket CentOS

Posted on Sun, 03 Nov 2019 15:05:55 -0800 by Deany