Changing the default network VirtualBox assigns to VMs attached to NAT

4

2

By default, VirtualBox assigns a 10.0.2.0/24 address to a VM attached to NAT. Is it possible to change NAT to a different network?

This is not a duplicate question. I know it is possible to define a separate "NAT network" and assign it, but that is not what I want to do. I want to change the default network for the NAT, but I see no way to do that.

Ben

Posted 2014-12-14T05:50:21.113

Reputation: 194

Answers

2

The Virtualbox manual has a section describing how to adjust the default NAT interface behavior, Fine-tuning the VirtualBox NAT engine. You can alter the IP address range and submask, change the behavior of the DNS resolver, and other things.

The actual changes are made through the VBoxManage command (in other words, there's no GUI). For example, to change the IP address range for the network, you'd run something like this while the guest isn't running:

VBoxManage modifyvm "VM name" --natnet1 "192.168/16"

Kenster

Posted 2014-12-14T05:50:21.113

Reputation: 5 474

3The OP asked to change it for all of VirtualBox, and not just a particular VM. modifyvm subcommand fails to meet the criteria because it only changes it for a particular VM. – jww – 2015-06-19T23:19:56.803