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?


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.

  • And I presume I would set the machines on the subnets to internal network as well? – leeand00 Apr 1 '14 at 21:45

Set the "virtual router" to have two network cards (the VM has to be off) then set the second network card to "host only" under the networking tab of the VM's settings. Set a second VM's network card to "host only" networking as well.

  • The vim has to be off? – leeand00 Apr 1 '14 at 21:40

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.