When emulating an OpenWRT Router in VirtualBox how do the network settings relate to a real world router

networkingvirtualboxvirtualization

I'd like to setup OpenWRT in VirtualBox for purposes of testing a network configuration before putting it on a live physical router.

How do the adapter settings relate to the real physical ports on an actual router?

My physical router has a WAN port, 3 LAN ports and the last port is a separate subnet to a DMZ for servers.

In this tutorial they set the first adapter to NAT so the Virtual OpenWRT router can connect to the internet; this appears to me to be the equivalent of the WAN port (but I could be wrong).

They also configure a second adapter which I believe to be the equivalent of one of the physical
LAN ports on my physical router.

If I am correct in my assumption here, to add more virtual ports to the router I just need to add another bridged adapter, and to emulate something like load balancing I could simulate dual internet connections coming into the router using another NAT adapter.

Now if the assumptions above are true, then how do I virtually plug an adapter from another vm into the bridged adapter port as I would physically using a wire?

Best Answer

By not using bridged. Strictly speaking you can, but it's not what you actually want to do.

Try setting the second adapter to be set to internal networking, so you can connect it to another adapter (in another VM, also set to internal networking).

You could use an OS-side routing rule to route traffic from one bridged interface to another, but it will be much more difficult than doing it with internal networking.