Remove virbr0 interface in Linux

virbr0 is an ethernet bridge

root@linux:~ # ifconfig virbr0
virbr0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:7630 (7.4 KiB)

You use brctl to manage the interface.
brctl is used to set up, maintain, and inspect the ethernet bridge configuration in the linux kernel

root@linux:~ # brctl show
bridge name bridge id STP enabled interfaces
virbr0 8000.000000000000 yes

Verify if libvirtd is running

root@linux:~ # service libvirtd status
libvirtd (pid 12529) is running…

Verify if there is any host running. In my case there isn’t

root@linux:~ # virsh list
Id Name State
———————————-

This is the default network set-up for the virtual machines

root@linux:~ # virsh net-list
Name State Autostart
—————————————–
default active yes

To remove first I’ll make sure the service libvirtd won’t be started automatically on next boot

root@linux:~ # chkconfig –list | grep -i lib
libvirt-guests 0:off 1:off 2:off 3:on 4:on 5:on 6:off
libvirtd 0:off 1:off 2:off 3:on 4:on 5:on 6:off

root@linux:~ # chkconfig libvirt-guests off
root@linux:~ # chkconfig libvirtd off

Destroy the network default

root@linux:~ # virsh net-destroy default
Network default destroyed

And undefine the network default

root@linux:~ # virsh net-undefine default
Network default has been undefined

Stop the libvirtd service

root@linux:~ # service libvirtd stop
Stopping libvirtd daemon: [ OK ]

The interface virbr0 is now gone

root@linux:~ # ifconfig virbr0
virbr0: error fetching interface information: Device not found

Source: http://unixhood.com/main/2013/07/30/how-to-disableremove-virbr0-nat-interface-in-linux-kvm/

Advertisement