How to Setup NAT?

This is for discussing general topics about how to use VirtualBox.
Post Reply
Guillaume Soucy
Posts: 15
Joined: 27. Dec 2021, 04:27
Primary OS: Linux other
VBox Version: OSE Debian
Guest OSses: Windows (Multiples Versions)
Location: L'Orignal CA.
Contact:

How to Setup NAT?

Post by Guillaume Soucy »

Hello,

I'm trying to configure a VM with NAT and DHCP

I'd use this command to create the network:

Code: Select all

VBoxManage natnetwork add --netname natnet1 --network "192.168.15.0/24" --enable --dhcp on
This command were used to change the network type to NAT of my VM:

Code: Select all

VBoxManage modifyvm build-sme-2106.05.6 --nic1 nat --nictype1 82540EM
And this one to perform the port forwarding:

Code: Select all

VBoxManage modifyvm "build-sme-2106.05.6" --natpf1 "guesthttps,tcp,,443,192.168.15.101,443"
Unfortunately, it is not working.

I think that I'm doing something wrong, I do only have a little bit of experience with VirtualBox in CLI.

I'd did some searches and not able to find anything relevant.

I'm not even sure that 192.168.15.101 is the correct IP because I have no idea how to get the list of DHCP clients. 192.168.15.101 is the lower one and I do have only one VM, so I guest that 192.168.15.101 is the IP that the DHCP give to VM, if it was able to give one.

Code: Select all

dhcp-lease-list
is the one that I'm normally using but the DHCP seem to be integrated to VirtualBox so

Code: Select all

dhcp-lease-list
t seem not being the correct one. I also did some recherches to figure out how to get the DHCP clients list, I wasn't able to find anything relevant.

build-sme-2106.05.6 is my VM.
guesthttps seem to be the rule's name.
443,192.168.15.101,443 seem to be the: VM port, the VM IP then the external port?

I red some docs at https://docs.oracle.com/en/virtualizati ... erver.html but, more I'm reading more that I'm lost.

I need help please.

Thank-you in advance.

Guillaume
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: How to Setup NAT?

Post by scottgus1 »

Guillaume Soucy wrote:I'm trying to configure a VM with NAT
Guillaume Soucy wrote:VBoxManage natnetwork add --netname natnet1
Guillaume Soucy wrote:VBoxManage modifyvm build-sme-2106.05.6 --nic1 nat
"natnet" is "NAT Network", which is not the same as "NAT". Please see Virtualbox Networks: In Pictures for the differences.
Post Reply