Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.