[vbox-dev] Static route or default gateway for NAT

Valery Ushakov uwe at stderr.spb.ru
Mon Oct 3 19:59:28 GMT 2016


Malcolm Clarke <Malcolm.Clarke at brunel.ac.uk> wrote:

> I am trying to demonstrate routing in a virtualised network created
> using VirtualBox with a FreeBSD server acting as router between 2
> virtual networks.  One network is set as NAT Network to allow access
> to outside world.  However, although packets can be directed from
> the router to the NAT router for outward delivery, the NAT router
> does not know how to deliver the incoming packets for the "hidden"
> subnet.
> 
> I wonder if anyone has modified the NAT network to allow simple
> static routes or default gateway to support this configuration.
>
> I do not know the interest for this functionality and whether the
> work is justified for the use that would be made.

This can be done in principle, but will require inventing all the
related configuration glue etc.  That's a bit of a slippery slope, as
people will want more and more networking tools and protocol support
and what not.  NAT Network is a very simple solution for simple setups
and is not intended to be a fully fledged router solution.  If you are
really desperate to have multiple networks hidden behind the single
NAT Network, you can use proxy arp on your internal router VM, but
that's about it.

If you want to build network setups to demonstrate routing &c it's
better to have a dedicated VM with multiple netwroking interfaces to
do the routing/NATting.  Connect the VM to the internal network(s) and
bridge it to the host's real network adapter to give it real
connectivity.  Then you'll have all the usual networking tools of the
guest running in that VM at your disposal.

-uwe




More information about the vbox-dev mailing list