Hi, i have this setup:
VM1--------VM2-------VM3
All three machines are running Linux (CentOs) on windows 7 host machine.
My target is to use VM2 as a bridge (actually Switch using OVS on VM2) between VM1 & VM3. However i have tried many things but there seem to be a problem.
1. Using Host Only Interface:
With this option all three machines can ping each other via shared windows virtual interface (192.168.56.1) however problem here is that traffic does not pass through VM2 rather directly between VM1 and VM3.
2. Using Internal Network:
To seperate i tried to assign two different internal network on links VM1-VM2 and Vm2-VM3 but this makes them unable to access eachother. The way i can make it work is by enabling IP routing, and natting however this is not what i want, i want L2 bridging via VM2.
Now on VM2 i am running OpenVSwitch, so that i can pass the traffic from one interface to the other and vice versa, but i really need some information, using Virtual Box how can i realize this task??
Using Virtual Machine as Gateway between two other VMs
Using Virtual Machine as Gateway between two other VMs
Last edited by rizwan on 22. Mar 2013, 17:06, edited 1 time in total.
-
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: Using Virtual Machine as Bridge between two other VMs
If you have all three VMs sharing a single simple network then of course they all see each others transmissions. They would need to be set up as separate networks, with VM2 configured as a gateway. You can do this by configuring multiple internal networks, and VM2 probably needs to be given two NICs. Actual configuration of this network is beyond the scope of the VirtualBox forums.
I would avoid the use of the word "bridge" when discussing this, as that has a specific meaning around here which is not related to your question. Gateway is more accurate I think.
I would avoid the use of the word "bridge" when discussing this, as that has a specific meaning around here which is not related to your question. Gateway is more accurate I think.
Re: Using Virtual Machine as Bridge between two other VMs
Thanks mpack, the only question i wanted to ask, with two seperate internal networks, does VirtualBox has any vlan tagging mechanism, which might block traffic to pass. I mean i separate the two networks using different internal networks, but if i explicitly via VM2 pass packets to other network will they pass on to the 'other' network?
Or is there any VLAN tagging done by virtualbox that would drop this traffic?
Can you please confirm this, that is all i wanted to know.
Or is there any VLAN tagging done by virtualbox that would drop this traffic?
Can you please confirm this, that is all i wanted to know.
-
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: Using Virtual Machine as Bridge between two other VMs
All VirtualBox does is provide the NIC simulation. VirtualBox has very little participation in the actual networking apart from providing a DHCP server in some modes (details in manual). So no, I would not expect VirtualBox to "tag" anything.
-
Perryg
- Site Moderator
- Posts: 34369
- Joined: 6. Sep 2008, 22:55
- Primary OS: Linux other
- VBox Version: OSE self-compiled
- Guest OSses: *NIX
Re: Using Virtual Machine as Gateway between two other VMs
The actual culprit here is the adapter selection. Some will remove the VLAN tagging (described in the manual)
You can use the find feature of the manual to search for vlan and read all about it. I usually use the VirtIo network adapter and do not see any tag removal.
You will need special drivers in Windows guests for VirtIO, however Linux usually have them native.
You can use the find feature of the manual to search for vlan and read all about it. I usually use the VirtIo network adapter and do not see any tag removal.
You will need special drivers in Windows guests for VirtIO, however Linux usually have them native.
Re: Using Virtual Machine as Gateway between two other VMs
Thanks @perryg, i get it but in my case i just wanted to use same VLAN or no tag atall, just make sure both machines can access each other via VM2.
So just incase for the benefit of everyone, the problem was Ethernet Card properties.
I had to select promiscous mode to let it allow all traffic to pass through it, on both incoming and outgoing interfaces and voilaa now it's working.
So just incase for the benefit of everyone, the problem was Ethernet Card properties.
I had to select promiscous mode to let it allow all traffic to pass through it, on both incoming and outgoing interfaces and voilaa now it's working.