Networking – What is This Virtual Interface and How to Remove It

ifconfiginterfacelinux-networkingnetworkingredhat

I am using RHEL 7.4 and had both a virbr0 and virbr1. I want to remove them both.

I was able to remove virbr0 by stopping and disabling the default virtual kvm.

libvirtd isn't running, yet I still have virbr1. Initially I followed setaoffice.com/2015/01/06/remove-virbr0-interface-in-linux which removed virbr0, but not virbr1.

When I run ifconfig I see the following:

ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.27  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::b675:d8a3:7535:216d  prefixlen 64  scopeid 0x20<link>
        ether 3c:97:0e:96:36:a5  txqueuelen 1000  (Ethernet)
        RX packets 2649  bytes 529358 (516.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1315  bytes 230578 (225.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xf3a00000-f3a20000  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 10  bytes 840 (840.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 10  bytes 840 (840.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.123.1  netmask 255.255.255.0  broadcast 192.168.123.255
        ether 00:16:3e:14:cb:4c  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

If I ping 192.168.123.1 I get responses so something is active on that address

I am trying to figure out why I have a virb1? Do I need it? As far as I am aware I have disabled and destroyed the default libvirt virth machines, and they no longer exist.

Any ideas how I can figure out what this device is and how to remove it from my configuration?

Best Answer

That's a bridge device created by libvirt that normally supports the "default" NAT-based network.

Even if you aren't using any virtual machines, as long as libvirt is running, that interface will be present (provided you have a default network defined at all).

It doesn't do anything on its own, and is generally harmless. However, if you would like to remove it you can do one of the following (and probably more if you're creative):

  • Remove libvirt entirely. Be careful and make note of what resources libvirt is managing. It has its own volume management service, and can mount filesystems, create volume groups, establish other networks, etc. This can be done via:

    # yum remove libvirt*

  • Stop and disable libvirt entirely. This will keep it from managing all resources even on reboot, so you'll want to be sure of what it's actually using (as described above). In Cent/RHEL 7, this can be done thusly:

    # systemctl stop libvirtd

    # systemctl disable libvirtd

  • Destroy the "default" libvirt network. This will stop the network that has been created and tear down the associated bridge. This change is ephemeral, and this network will come back online after a hypervisor node reboot or libvirt daemon restart. Ephemerally disabling the "default" network can be accomplished with a single command (on the hypervisor in question):

    # virsh net-destroy default

    If you want to permanently remove the "default" network entirely, you can undefine it:

    # virsh net-undefine default

    However, it may be more sensible to simply keep this network from starting rather than undefining it (in case you ever want to use it in the future without having to define a new default network). This can be accomplished by disabling network autostarting for "default":

    # virsh net-autostart --disable default