1

This answer states that a network bridge doesn't always have to have a IP address. It mentions this entry for /etc/network/interfaces:

auto br0
iface br0 inet manual
    bridge_ports eth0

which should define a bridge called br0, connected to eth0. Does this make eth0 exclusively available to the bridge, i.e. not to the host?

I am asking because the answer above says if you specify 0.0.0.0 as the bridge's address, the VMs would be connected to eth0 but not the host. Is doing that effectively the same thing, or a different thing?

Benni
  • 113

1 Answers1

1

Once eth0 is placed on the br0 bridge you cannot configure eth0 anymore. If you want to use eth0 you have to configure br0 now as if you were configuring eth0.

When you say that eth0 is exclusively available to the bridge and not to the host it is true, but do note that br0 is available on the host so you are not losing anything. From the point of view of the host it is almost as if you had only renamed the interface to br0.

Specifying 0.0.0.0 as the bridge's address on the host is not necessary. You may just as well leave it unconfigured.

The VMs are all connected to the bridge. Imagine you have a switch and each VM and the host are all separate computers. Now every computer has a cable connecting it to the network switch. Now all VMs and the host are physically connected through the network switch (your bridge). This is exactly what happens when you create a bridge. Now, being physically connected does not mean they can exchange data among them. If, for instance, the "host computer" has no IP on that interface connected to the switch, nobody will be able to exchange data with the host. When you leave br0 with IP 0.0.0.0 or no IP at all you are doing exactly that and hence, VMs will not be able to connect to the host via their eth0 interface (via the bridge).

Focus on the concept of what a bridge is and everything will make sense.

Also, check this answer here: https://askubuntu.com/a/432030/73636

mbello
  • 521
  • 4
  • 13