How to Setup NAT?
Posted: 19. May 2022, 12:05
Hello,
I'm trying to configure a VM with NAT and DHCP
I'd use this command to create the network:
This command were used to change the network type to NAT of my VM:
And this one to perform the port forwarding:
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.
is the one that I'm normally using but the DHCP seem to be integrated to VirtualBox so 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
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
Code: Select all
VBoxManage modifyvm build-sme-2106.05.6 --nic1 nat --nictype1 82540EM
Code: Select all
VBoxManage modifyvm "build-sme-2106.05.6" --natpf1 "guesthttps,tcp,,443,192.168.15.101,443"
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
Code: Select all
dhcp-lease-list
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