Page 1 of 1

Unable to create NAT network with DHCP enabled

Posted: 3. Dec 2013, 19:07
by TSU
Hello trying to understand NAT on Virtualbox

System:
Windows 8 (fully updated)
Current VBox 4.3.4, was also trying on previous version before updated today

Noted in included documentation that NAT is considered experimental.

First curiosity observed:
When 2 guests are running in the default NAT network, I found both machines were fully functional accessing the Internet, but both were assigned the same IPv4 address. Each guest had different IPv6 addresses and MAC addresses. Am speculating that the default NAT does not have DHCP on.

Have attempted:
Add a new NAT network with DHCP enabled. Following the VBox included documentation, I believe the following command is supposed to do this

Code: Select all

VBoxManage natnetwork add -t nat-int-network -n "192.168.15.0/24" -e -h on
The command executes successfully(well, at least without error),
But when I open an existing Guest and open its Network Properties, the new network just created is not listed, even after closing and restarting VBox.

Suggestions?
Besides the above, is there a way to list available networks, their status and perhaps state of configured options both from the CLI and the GUI VM VirtualBox Manager?
From the command line, the help options don't seem to list such a command.

Thx,
TSU

Re: Unable to create NAT network with DHCP enabled

Posted: 3. Dec 2013, 19:40
by Perryg
VBoxManage list
Will give you all the list options.
VBoxManage list natnets
Should show what you are looking for.

Re: Unable to create NAT network with DHCP enabled

Posted: 3. Dec 2013, 20:14
by TSU
Perryg wrote:VBoxManage list
Will give you all the list options.
VBoxManage list natnets
Should show what you are looking for.
Cool. Thx for answering at least my last question.
Interesting though that when I list natnetworks, I see only the network I created and not the default NAT networks.

So, I wonder then if the default networks exist differently,
And I wonder if to a certain degree this could be why I cannot view the network I created in the VirtualBox Manager.

TSU

Re: Unable to create NAT network with DHCP enabled

Posted: 3. Dec 2013, 20:42
by Perryg
The first question is did you use the original or did you add one?
I left the original alone since it was the default NAT scheme and added one instead. The added one is what I use and it does work for me.

Re: Unable to create NAT network with DHCP enabled

Posted: 4. Dec 2013, 17:37
by TSU
Perryg wrote:The first question is did you use the original or did you add one?
I left the original alone since it was the default NAT scheme and added one instead. The added one is what I use and it does work for me.
As I described, I added a network according to the documentation instead of trying too hard to modify the default existing networks.

So, when you created your new network, did it appear in the list of available networks when configuring "Networking" in the VM Guest properties? It didn't for me. And from the command line, the network definitely is "enabled."

So, am now considering perhaps testing by trying to launch a Guest from the command line specifying the new network. But, if that is all that works, it's a shame because it would mean that the VM VirtualBox Manager won't work for me.

Also, what OS are you running as your Host?

TSU

Re: Unable to create NAT network with DHCP enabled

Posted: 4. Dec 2013, 17:58
by Perryg
Shows like it should, although I created this in the GUI. It should be possible to create via CLI but might be tricky as some things are.

Code: Select all

perry@perry-main:~$ VBoxManage list natnets
NetworkName:    NatNetwork
IP:             10.0.2.1
Network:        10.0.2.0/24
IPv6 Enabled:   No
IPv6 Prefix:    
DHCP Enabled:   Yes
Enabled:        Yes
loopback mappings (ipv4)
        127.0.0.1=2

NetworkName:    NatNetwork1
IP:             10.1.2.1
Network:        10.1.2.0/24
IPv6 Enabled:   No
IPv6 Prefix:    
DHCP Enabled:   Yes
Enabled:        Yes
loopback mappings (ipv4)
        127.0.0.1=2

NatNetwork.png
NatNetwork.png (55.29 KiB) Viewed 3966 times

Re: Unable to create NAT network with DHCP enabled

Posted: 4. Dec 2013, 18:33
by TSU
Perryg wrote:Shows like it should, although I created this in the GUI. It should be possible to create via CLI but might be tricky as some things are.

Code: Select all

perry@perry-main:~$ VBoxManage list natnets
NetworkName:    NatNetwork
IP:             10.0.2.1
Network:        10.0.2.0/24
IPv6 Enabled:   No
IPv6 Prefix:    
DHCP Enabled:   Yes
Enabled:        Yes
loopback mappings (ipv4)
        127.0.0.1=2

NetworkName:    NatNetwork1
IP:             10.1.2.1
Network:        10.1.2.0/24
IPv6 Enabled:   No
IPv6 Prefix:    
DHCP Enabled:   Yes
Enabled:        Yes
loopback mappings (ipv4)
        127.0.0.1=2

OK,
I got it now. Your screenshot clarified how a custom NAT network is accessed, I wonder why the weird hierarchy and IMO unclear label(NAT network instead of something like Custom Networks)? I don't think it's even intuitive that a hierarchy is supported for any of the selections when all the others seem to support only one network.

Anyway, thx the issue is resolved (now on to testing).

TSU