-1

I have a VirtualBox VM which has:

eth0: 10.0.2.15/24
default-gateway: 10.0.2.2/24

Within that VM I have 2 LXC containers (i.e. two other virtual machines)

VM1 - eth0: 10.50.50.50/16 (connects to br0)
VM2 - eth0: 10.50.50.51/16 (connects to br0)

On the virtualbox instance, I tried to set up a bridge br0:

br0: 10.50.0.1/16 -> eth0

But this setup isn't working, as soon as I attach the bridge to eth0, eth0 can no longer ping the router. I don't understand what rules I'm violating by trying to configure a different network on the br0 side of the bridge than on the eth0 side.

I thought that traffic from one side just replicates to the other. So traffic on the virtualbox host would hit eth0 and make it out the default gateway. And traffic on the LXC containers network would hit br0, cross over to eth0, and make it to the default gateway.


Where's the folly in my thinking?

davidparks21
  • 928
  • 1
  • 12
  • 27

1 Answers1

3

I guess the problem is that you are trying to bridge 2 different subnets. Eth0 loses IP address when you attach it to the bridge so the only address you are left with is 10.50.0.1/16. Hence the inability to ping gw. If you want your virtual machines to be on a different subnet then maybe you should consider routing or NAT instead of bridging.

pupkinsen
  • 113
  • 2
  • 10
  • I get it now, bridging works only on the same subnet, there's now layer 3 routing capability in bridging. When I diagrammed it out logically I had left the IP on eth0, I didn't realize that it goes away. But I see now. – davidparks21 Mar 27 '13 at 10:15