82
      virbr0    Link encap:Ethernet  HWaddr a2:17:ea:e3:47:7e  
      inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

can anyone tell me what this interface does and how I can change the IP address? I want to see if it is the reason my guests cannot connect.

AjayKumarBasuthkar
  • 1,042
  • 9
  • 11
user125242
  • 839
  • 1
  • 6
  • 7

5 Answers5

78

The virbr0, or "Virtual Bridge 0" interface is used for NAT (Network Address Translation). It is provided by the libvirt library, and virtual environments sometimes use it to connect to the outside network.

It was likely bundles with a VM software you installed at some point. If you'd like to remove it, and you're sure nothing else depends on it, you can use the following command:

sudo brctl delbr virbr0

(from UbuntuForums)

It is unlikely that the virtual bridge is affecting your guests' ability to connect to the Internet, though.

Vdragon
  • 127
  • 6
Travis G.
  • 1,837
  • 1
  • 13
  • 15
13

If you are unable to connect to the internet due to "vibr0" interface then follow the commands below

virsh net-destroy default
virsh net-undefine default
service libvirtd restart
ifconfig
A.B.
  • 89,123
  • 21
  • 245
  • 323
faizan
  • 131
  • 1
  • 2
11

For changing the ip address of virbr0 under ubuntu 12.04

sudo cp /var/lib/libvirt/network/default.xml /tmp/default.xml
sudo vi /tmp/default.xml # edit the ip address
sudo virsh net-destroy default
sudo virsh net-undefine default
sudo virsh net-define /tmp/default.xml
sudo virsh net-start default

You could refer to: http://wiki.libvirt.org/page/Networking

Harold
  • 103
  • 4
user2584459
  • 111
  • 1
  • 2
1

I am using virtualbox 5.2.28 on ubuntu-16.04 and the config file is in /var/lib/libvirt/dnsmasq/default.conf

maybe you can always check the conf file location by checking the cmdline of the dnsmasq process.

To check the process number, port, and name.

sudo netstat -plant

To check the cmdline and find from where it loads the configuration file use

cat /proc/<PID>/cmdline
alshaboti
  • 121
  • 3
1

My answer is a mix of previous answers, but that's how I could make it to work for me:

cp /var/lib/libvirt/network/default.xml /tmp/default.xml
vi /tmp/default.xml # edit the ip address
sudo virsh net-destroy default
sudo virsh net-undefine default   # needed to avoid errors below
sudo virsh net-define /tmp/default.xml
sudo virsh net-start default
rm /tmp/default.xml
Jonny
  • 121
  • 3
  • How is this different from [this](https://askubuntu.com/a/342364/214264) answer? – Mostafa Ahangarha Oct 16 '17 at 21:35
  • 2
    @MostafaAhangarha Without the undefine, the define command says it cannot create a new "default". It simply did not work for me. – Jonny Oct 16 '17 at 22:32
  • 1
    Then, please include this little but perhaps important piece of information. So, if in future anybody face with the same issue, knows how to solve it – Mostafa Ahangarha Oct 17 '17 at 16:01