Page 1 of 1

Bridging two subnets

Posted: 2. Dec 2012, 11:16
by itbookham
Hello,

I am trying to simulate bridging two subnets. The host is running Windows 7 Professional and the two Virtual guests are running Windows XP Professional. There are three NICs installed on the computer - one for the host, the other two for the guests. The subnets on the guests are:

10.0.0.0 and 10.128.0.0 (Subnet mask 255.128.0.0)

In the network settings of both VBs I have allocated 'Bridged Adaptor' and then connected a CAT 5 ethernet cable to each NIC and plugged these into the router (D Link DSL 2640R). There is a facility in the router to configure VLAN, but I am not too sure if this is the same a bridging two subnets.

I have tried to use a router but I am not too sure what IP address to allocate to it?

Any assistance will be greatly appreciated.

Mark

Re: Bridging two subnets

Posted: 2. Dec 2012, 17:42
by noteirak
This is outside the scope of Virtualbox, and into networking, as you ask how to configure an external hardware, so I will not go into full details but here are the main steps :

Make your host tag VLAN 10 on NIC#1 for Guest #1 (10.0.0.0 subnet)
Make your host tag VLAN 20 on NIC#2 for Guest #2 (10.128.0.0 subnet)

Plug Host NIC#1 into Router NIC#1
Plug Host NIC#2 into Router NIC #2

Configure router :
Assign VLAN 10 on NIC#1 and assign IP from 10.0.0.0 subnet
Assign VLAN 20 on NIC#2 and assing IP from 10.128.0.0 subnet

Configure TCP/IP stack correctly on each VM & router.

Voila!

PS : This is under the assumption your hardware supports the listed operations.

Re: Bridging two subnets

Posted: 2. Dec 2012, 22:25
by itbookham
Hello,

I am much obliged for your suggestion. I don't think my router has the configuration options that you specify.

Is it possible to 'virtualize' connecting the two subnets without using an external hardware device?

Many thanks,
Mark

Re: Bridging two subnets

Posted: 3. Dec 2012, 03:30
by noteirak
itbookham wrote:Is it possible to 'virtualize' connecting the two subnets without using an external hardware device?
Sure, you got several choices depending on what you want to do exactly :
- Your host can act as a router, if you setup 2 host-only NICs and connect your VMs on them, depending on the subnet.
- Setup an extra VM and configure as router. You will then configure 2 NICs and connect each to one of the subnet.
- Reuse the VMs already setup and configure them to route the different subnets from one to another.

If you need more details, you will need to dig more into networking I am afraid.

Re: Bridging two subnets

Posted: 3. Dec 2012, 16:29
by itbookham
Hello,

Thanks for responding.

In your scenario how many physical NICs will I need to have installed on the host machine?

Thanks,
Mark

Re: Bridging two subnets

Posted: 4. Dec 2012, 22:04
by noteirak
If you want to access something outside the two subnets (something physical), at most 1, but it depends if you want to do NAT (then none) or Bridged (then 1)

Re: Bridging two subnets

Posted: 5. Dec 2012, 00:12
by BillG
itbookham wrote:Hello,

I am trying to simulate bridging two subnets. The host is running Windows 7 Professional and the two Virtual guests are running Windows XP Professional. There are three NICs installed on the computer - one for the host, the other two for the guests. The subnets on the guests are:

10.0.0.0 and 10.128.0.0 (Subnet mask 255.128.0.0)

In the network settings of both VBs I have allocated 'Bridged Adaptor' and then connected a CAT 5 ethernet cable to each NIC and plugged these into the router (D Link DSL 2640R). There is a facility in the router to configure VLAN, but I am not too sure if this is the same a bridging two subnets.

I have tried to use a router but I am not too sure what IP address to allocate to it?

Any assistance will be greatly appreciated.

Mark
Are you sure that you understand the difference between bridging and routing? If you bridge two subnets, they must use the same IP subnet, not a different one.

A bridge simply rebroadcasts the packet on the other network segment so it must be in the same subnet. A router will forward traffic which is addressed to the other network.

If you want to route between the two IP subnets, the router should be the default gateway for both subnets. If the default gateway of either subnet is some other router/gateway, you will need extra routing to get the traffic to the internal router so that it can be forwarded.

192.168.1.x dg 192.168.1.254
|
192.168.1.254 dg blank
router
192.168.2.254 dg blank
|
192.168.2.x dg 192.168.2.254