Page 1 of 1

clarification request - bridged networking

Posted: 30. Jan 2012, 23:32
by elsnerc
Hello community!

I try hard to understand the bridged networking paradigm and am failing miserably.
So, if there is anybody out there, who would care to enlighten me (may she/he, if existing, be manyfold blessed by the God of their choosing) I would, by all means, be very much in debt to you.

What am I trying to do: having a virtualbox machine act as a router between 2 networks: 172.28.0.0/24 and 172.29.0.0/24.
- The host would run ubuntu server with VirtualBox 4.1.8 as the virtualiser.
- The host would have 3 physical ethernet interfaces (eth0, eth1, eth2).
- ALL IP addresses in all networks are static
- The host should have eth0 be it's dedicated interf. and should have a static IP, like 172.28.0.100/24
- The virtual machine would have 2 network interfs, bridged to eth1 and eth2.
- The virtual machine should be seen in the 172.28 net by the IP 172.28.0.1. on the interf. eth1/v.if1
- The virtual machine should be seen in the 172.29 net by the IP 172.29.0.1. on the interf. eth2/v.if2

schematic:

physical machine
|--- eth0 (172.28.0.100/24)
|--- eth1 (?.?.?.?/?) ------- v.if1 (?.?.?.?/?) --- |
|--- eth2 (?.?.?.?/?) ------- v.if2 (?.?.?.?/?) --- | virtual machine

Now, if I understand the concept of bridging correctly, I should be able to construct a bridge br1 by joining eth1 and v.if1; and a br2 accordingly, in some sort of way. The way is my quest.

What I do not understand is:
- What happens when I choose "bridged" in the network config of the vbox machine? (I do not see a virtual interface or a bridge appearing on either host nor guest)
- On which side should the config of the bridge happen, so that the above works (So: which ?.?.?.? in the above scheme would hold the 172.28.0.1, etc.)?
- And where in the scheme would br1 and br2 appear?

If anybody could find the time to explain things to me, that would be grand.
A link to some site describing a setup as above would also be much appreciated.
Thank you very much in advance!

P.S. In all the material I have looked at so far, there was not one, that I could extract the information from:
http://www.virtualbox.org/manual/ch06.html
http://samiux.wordpress.com/2007/07/11/ ... irtualbox/
http://forum.pfsense.org/index.php?topic=40074.0
http://aztcs.org/meeting_notes/linuxsig ... -Linux.pdf
http://timita.org/wordpress/2011/07/29/ ... -preamble/
http://www.linuxforen.de/forums/showthread.php?t=236444

Re: clarification request - bridged networking

Posted: 31. Jan 2012, 00:53
by BillG
No, bridging does not create a virtual interface. The bridge driver software simply allows a virtual machine to access a physical network through a physical NIC.

When you set bridged mode you do it on an existing interface in your vm guest. What bridged mode allows you to do is bridge this interface in the vm to a physical NIC in the host. AS a result, that NIC in the vm will be in the same network as the physical NIC to which it is bridged. You select which physical NIC you want to bridge to from the dropdown list.

The physical NICS which are bridged to your router interfaces do not need IP addresses at all (in the host OS). Just give the NICs in the vm a static IP in the correct IP subnet (and make sure that the physical NIC is connected to the network which contains the other machines in this segment/subnet).

So connect all machines in subnet A to eth1 on the host and subnet B to eth2. Bridge eth0 in the vm to eth1 in the host and eth1 in the vm to eth2 in the host.

You are trying to route traffic between two sets of physical machines?

Re: clarification request - bridged networking

Posted: 31. Jan 2012, 02:44
by elsnerc
Hello Bill!
Thank you for the quick answer!
It helped me a lot. Since it was confirming some of my assumptions, I tried looking for other sources of error.
And I found that the standard AMD network interface doesn't work correctly on the machine I was
using: an older sun v20z. Changing the adapter emulation to the intel pro/1000 magically solved the issue.
Now I can access the pfsense running in the vbox.

As an answer to your question, yes, the vbox will play router to a couple of other physical machines divided
in the 2 separate networks I was describing.

cheers,
Christian

Re: clarification request - bridged networking

Posted: 31. Jan 2012, 05:05
by BillG
Good. Sounds like you are on the right track.