Bridged netwok on host with two NICs

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Berjozkin
Posts: 65
Joined: 14. Nov 2007, 14:54
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Slackware 64 bit

Bridged netwok on host with two NICs

Post by Berjozkin »

Hi!

I am trying to set up a host having 2 NICs plus virtual machine with bridged NIC.

I found that the bridged interface works only in case if I assign bridging using eth0. if i choose eth1 for binding, I get something semi-functional - the host's dhcp server gets address request and assigns it, but VM seems not getting it as the next request from the guest comes in. I can not use the fixed address from the network eth1 is the member of, either.

Any ideas how to solve it (besides swapping the networks ethX are part of or moving to kvm)?
:?:

P.S. Both Host and Guest are Slackware64-14.1; guest uses Intel Pro Desktop MT NIC. Tried to fire up Win7 and OpenSUSE guests; results - the same.
Berjozkin
Posts: 65
Joined: 14. Nov 2007, 14:54
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Slackware 64 bit

Re: Bridged netwok on host with two NICs

Post by Berjozkin »

Now I am even more confused: I found that everything works only in case if bridge is bound to the adapter connected to the live network (the second net is not functional yet, having only one configured NIC with no cable attached). Can this be the root of the problem? I browsed through the logs, but did not notice anything.
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Bridged netwok on host with two NICs

Post by noteirak »

Well, bridging on a non-connected adaptor will not show it as disconnected in the VM, so it's possible the routing inside the VM thinks the network is accessible by both interfaces, and then fails since anything sent on eth1 will be dropped.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Berjozkin
Posts: 65
Joined: 14. Nov 2007, 14:54
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Slackware 64 bit

Re: Bridged netwok on host with two NICs

Post by Berjozkin »

Hi!
This does not explain why the dhcp requests are received by eth1 and answered, but not accepted by VM. I do not know the inner workings, but from such point of view - the network is alive as there are two computers on them - one with physical configured NIC offering dhcp service, the other - VM trying to be the part of that network.
May be the physical NIC' status influences the results indeed - I'll check that.
Martin
Volunteer
Posts: 2562
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Bridged netwok on host with two NICs

Post by Martin »

Is this a wired or wireless adapter?
Berjozkin
Posts: 65
Joined: 14. Nov 2007, 14:54
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Slackware 64 bit

Re: Bridged netwok on host with two NICs

Post by Berjozkin »

both wired, one - Intel 1gbit nic, second RTL8111/8168 PCI Express Gigabit Ethernet controller (rev 11)
Berjozkin
Posts: 65
Joined: 14. Nov 2007, 14:54
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Slackware 64 bit

[SOLVED] Re: Bridged netwok on host with two NICs

Post by Berjozkin »

Hi!

the problem lies with Virtualbox somehow detecting the link status of the NIC - bridge works only with the NIC having active link. It has to be active at the start of the VM as well as during runnig. If the cable is disconnected, connectivity is lost until the link in On again. It is just the link status which is important I suppose (I just plugged the free cable from the switch).

To developers: may be such behaviour could be qualified as bug and needs repairing? I mean - to make Virtualbox bridging indifferent to the status of the link of physical NICs? See my previous observations on dhcp behaviour. If the VM communicates with physical host through the network as another "physical" computer, not directly (not leaving the host), than the effect is clear and I recall the note to developers.
Berjozkin
Posts: 65
Joined: 14. Nov 2007, 14:54
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Slackware 64 bit

Re: Bridged netwok on host with two NICs

Post by Berjozkin »

Hi!

Re-opening the question - is it possible to organize bridging in a way that fir example - main OS ir using one NIC (say - wired) and virtual machine - wireless? Some time ago I tried to solve it by using latency setting (on Windows, I do not recall whether the name is correct now), but it gave very unstable results.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Bridged netwok on host with two NICs

Post by mpack »

The VM has no WiFi NIC emulations, so no.
Berjozkin
Posts: 65
Joined: 14. Nov 2007, 14:54
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Slackware 64 bit

Re: Bridged netwok on host with two NICs

Post by Berjozkin »

From binding point of view - is it indifferent to which kind of physical NIC VM binds? Or it works vice versa - it binds to the NIC server OS presenting as active? Or "more active" (better connection) than the other.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Bridged netwok on host with two NICs

Post by mpack »

I'm not sure I understand the question. Regardless of the type of host NIC you bridge to, it will appear as an Ethernet NIC to the guest. Be warned however that bridging to a WiFi NIC is not always possible. Multi-drop WiFi is technically outside the standard, so it's a matter of try it and see if it works.

Oh, and bridging binds specifically to a host NIC you select. There is no default, and it isn't relevant how "active" the host NIC is for this feature, as the TCP/IP stacks for the two PCs (host and guest) are completely independant, so the "other" activity on the physical NIC is not visible to the VM.
Post Reply