Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Help: bridging a virtual machine with the physical network
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Fri Sep 24, 2010 2:18 pm    Post subject: Help: bridging a virtual machine with the physical network Reply with quote

Hi all.

I'm trying to bridge (if that's the way to go) the network card of one of my virtual machines with the physical network. In vain. Here's what I have:
  • Ethernet card: Broadcom BCM5784M (eth0)
  • Wireless: Intel Wifi Link 5100 (wlan0)
Code:
eth0  ---+
         |
       bond0 --+
         |     |
wlan0 ---+     |
              br1 --> IP from the LAN DHCP server (eth0/wlan0)
               |
  (VM) vif0  --+

I have created a bonding interface, bond0 with both wlan0 and eth0. Then I've created a tun/tap interface, vif0, for my VM and a bridge interface, br1, which is comprised of bond0 and vif0. When I run my virtual machine, I can only the IP address of my laptop (the host machine) but no machine in the LAN on which the host is connected.

I have another bridge (br0) for a routed network between other virtual machines and all of them are able to reach the local network. But they use routing/nating instead.

Does anyone have an idea on what's (possibly) wrong? From what I know, this could be an ARP issue. However I have no clue on how to solve it.

Thanks in advance for any hint/suggestion.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1344
Location: Sweden

PostPosted: Fri Sep 24, 2010 2:49 pm    Post subject: Reply with quote

I'm really bad with networking, so I don't really understand the details, but I've had this successfully working with the KVM instructions on the wiki.
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Fri Sep 24, 2010 3:29 pm    Post subject: Reply with quote

Letharion wrote:
I'm really bad with networking, so I don't really understand the details, but I've had this successfully working with the KVM instructions on the wiki.

My network setup is globally the same, except the physical LAN is made of both eth0 and wlan0 bonded together. But I'm almost sure this is where it hurts as I know wireless interfaces can be problematic with bonding and bridging in some circumstances. I'll try bridging eth0 with the virtual network directly and see if there's a difference.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
AngelKnight
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jan 2003
Posts: 127

PostPosted: Mon Sep 27, 2010 8:44 pm    Post subject: Re: Help: bridging a virtual machine with the physical netwo Reply with quote

To VinzC: not sure what you're aiming for, but why are eth0 and wlan0 bonded? Could you not just get by with attaching eth0, wlan0 and vif0 as ports on the same bridge br1, then go from there?
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Mon Sep 27, 2010 10:27 pm    Post subject: Re: Help: bridging a virtual machine with the physical netwo Reply with quote

AngelKnight wrote:
To VinzC: not sure what you're aiming for, but why are eth0 and wlan0 bonded? Could you not just get by with attaching eth0, wlan0 and vif0 as ports on the same bridge br1, then go from there?

Yes I could. But bridging considerably slows down network starting time plus it doesn't offer redundancy like bonding. With bonding I can use either or both interfaces without being required to enable STP and the like. In general bonding is much more convenient than bridging. however I'll try bridging eth0 without wlan0 first since I suspect wireless firmwares to disallow such flexibility. I'll report the results.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Tue Sep 28, 2010 12:54 pm    Post subject: Reply with quote

Bridging vif0 with eth0 worked, so as I suspected there is a problem with my wireless interface somehow. I couldn't add wlan0 to the bridge however, I still wonder why. I'll try further to bridge both wireless and ethernet interfaces.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
Mad Merlin
Veteran
Veteran


Joined: 09 May 2005
Posts: 1155

PostPosted: Tue Sep 28, 2010 1:50 pm    Post subject: Reply with quote

VinzC wrote:
Bridging vif0 with eth0 worked, so as I suspected there is a problem with my wireless interface somehow. I couldn't add wlan0 to the bridge however, I still wonder why. I'll try further to bridge both wireless and ethernet interfaces.


Many wireless interfaces don't allow more than one MAC address to be sourced through them, meaning they're effectively unusable for bridging. Routed networks can be an usable workaround though.

Also I'm surprised bonding worked between eth0 and wlan0, I've never heard of anyone try that before. Is that a purely failover bonding type rather than round-robin?
_________________
Game! - Where the stick is mightier than the sword!
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Tue Sep 28, 2010 3:12 pm    Post subject: Reply with quote

VinzC wrote:
Bridging vif0 with eth0 worked, so as I suspected there is a problem with my wireless interface somehow. I couldn't add wlan0 to the bridge however, I still wonder why. I'll try further to bridge both wireless and ethernet interfaces.


Mad Merlin wrote:
Many wireless interfaces don't allow more than one MAC address to be sourced through them, meaning they're effectively unusable for bridging. Routed networks can be an usable workaround though.

Also I'm surprised bonding worked between eth0 and wlan0, I've never heard of anyone try that before. Is that a purely failover bonding type rather than round-robin?

So far I've set it up in fail-over mode. I haven't used it in round-robin mode yet.

I do need my virtual machines to be connected to the LAN however. I have Windows virtual machines, which I need to test against a Samba domain controller in the local network so routing is not a viable option there. Are there other workarounds?
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
AngelKnight
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jan 2003
Posts: 127

PostPosted: Sat Oct 02, 2010 3:35 am    Post subject: Reply with quote

Mad Merlin wrote:
VinzC wrote:
Bridging vif0 with eth0 worked, so as I suspected there is a problem with my wireless interface somehow. I couldn't add wlan0 to the bridge however, I still wonder why. I'll try further to bridge both wireless and ethernet interfaces.


Many wireless interfaces don't allow more than one MAC address to be sourced through them, meaning they're effectively unusable for bridging. Routed networks can be an usable workaround though.

Also I'm surprised bonding worked between eth0 and wlan0, I've never heard of anyone try that before. Is that a purely failover bonding type rather than round-robin?


Bridging wired ethernet and wireless together doesn't often work; it's usually the wireless hardware or firmware that gets in the way. One interference is, as mentioned earlier, where the wireless firmware refuses to transmit frames with a "foreign" source MAC.
Back to top
View user's profile Send private message
AngelKnight
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jan 2003
Posts: 127

PostPosted: Sat Oct 02, 2010 3:41 am    Post subject: Re: Help: bridging a virtual machine with the physical netwo Reply with quote

VinzC wrote:
AngelKnight wrote:
To VinzC: not sure what you're aiming for, but why are eth0 and wlan0 bonded? Could you not just get by with attaching eth0, wlan0 and vif0 as ports on the same bridge br1, then go from there?

Yes I could. But bridging considerably slows down network starting time plus it doesn't offer redundancy like bonding. With bonding I can use either or both interfaces without being required to enable STP and the like. In general bonding is much more convenient than bridging. however I'll try bridging eth0 without wlan0 first since I suspect wireless firmwares to disallow such flexibility. I'll report the results.


From your diagram you're already using bridging...

If you don't want to use STP, use the following on a bridge (assume br0):

Code:
brctl stp br0 off
brctl setfd br0 1


And be certain through other means that you don't accidentally introduce loops.

With regard to ensuring that your virtual machines appear in the same broadcast domain with a domain controller (presumably hanging off of br1 or eth0), just put eth0 and vif0 both on br1.
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Sat Oct 02, 2010 11:24 am    Post subject: Re: Help: bridging a virtual machine with the physical netwo Reply with quote

AngelKnight wrote:
With regard to ensuring that your virtual machines appear in the same broadcast domain with a domain controller (presumably hanging off of br1 or eth0), just put eth0 and vif0 both on br1.

I have tried bridging only my Ehternet card with the virtual machine segment; it worked. I had also started another thread as I got an error message trying to bridge wlan0. In fact my wireless card can simply not be bridged, which is a shame as I always had Intel Wireless cards in the laptops I used and this is the very first time there is one I just cannot bridge :evil: ! With IPW2200, IPW3945 I've never had any problem, ever. IWL5100AGN, piece of crap! I'm nearly finding this scandalous, really.

Currently I've kept my network configuration as drawn in my initial post. My virtual machines do contact the local network only when I plug the cable in the Ethernet socket. It's more than nothing and I guess I'll have to cope with it. I just want to keep bonding.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum