1

How can I use Virtualbox custom NAT and also port forward?

For demos, I am running my VMs behind NAT on my laptop. If I run it in the vanilla NAT mode, then each VM I spin up automatically gets 10.0.2.15 and I can port forward traffic from my host laptop to it (e.g. browse HTTP interface by typing in https://127.0.0.1:8000 in my browser).

The problem however comes when I do mutiple VMs at the same time with this native NAT. All of them get 10.0.2.15 as an IP, so they cannot see each other for the demos I am setting up. When I do custom NAT (i.e. a unique 10/172/192 net I create just for my laptop), I unfortunately cannot do port forwarding (not an option in the GUI when I select this networking option in each VM's settings).

I'm hoping to both bridge VMs, use NAT, and port forward from my house. I supposed I could start putting multiple interfaces on them in vanilla NAT so they could see each other on this other internal VLAN I create, but I was hoping there was an easier way.

1 Answer 1

0

Use different network adapters in different guest vms. For example in the first guest use 'Adapter 1' for NAT, then it assigns 10.0.2.15 and if you use 'Adapter 2' for second guest vm, it assigns 10.0.3.15.

Or else have a look in to this link , you can configure your own custom NAT. https://www.virtualbox.org/manual/ch09.html#changenat

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .