The IP address configured for the host-only network is not within the allowed ranges

Viewed 15093

I got this error when I run vagrant up on my macOS:

The IP address configured for the host-only network is not within the allowed ranges. Please update the address used to be within the allowed ranges and run the command again.

Address: 192.168.10.10 Ranges: 192.168.56.0/21

The same Vagrantfile works before, but not any more.

Any idea?

7 Answers

I found the "issue" started to happen after VirtualBox 6.1.26.

The way to solve is creating a new file at /etc/vbox/networks.conf on your macOS with content

* 10.0.0.0/8 192.168.0.0/16
* 2001::/64

Make sure including the asterisks *. Then the issue should be gone.

Regarding the networks.conf content, it can be found at https://www.virtualbox.org/manual/ch06.html#network_hostonly

Changing a Vagrantfile directly is not recommended if you didn't create it. You can use this instead

vagrant config static_ip 192.168.56.2

The ip address can be any in the range 192.168.56.2 - 192.168.63.254. Make sure to run vagrant reload after making changes.

Easy Solve

$ mkdir /etc/vbox/
$cd /etc/vbox/

vbox$ sudo vi networks.conf

  * 10.0.0.0/8 192.168.0.0/16
  * 2001::/64

I had the same issue on macOS after a system upgrade. In the System Preferences under Security & Privacy, enabling VirtualBox / Oracle solved it.

These are some trouble shooting steps that i took for resolving the issue.

  1. In the System Preferences under Security & Privacy, enabling VirtualBox / Oracle.
  2. After the changes restart the VirtualBox

If these doesn't resolve the issue check the following in you Vagrant File.

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| os = "generic/ubuntu2004" net_ip = "192.168.50"

As you can see the ip range given is not what vagrant is looking for. Change the net_ip value to 192.168.56 .

This will resolve the issue.

Got the same issue solved by the following steps

sudo nano /etc/vbox/networks.conf

  • 10.0.0.0/8 192.168.0.0/16
  • 2001::/64
  • 0.0.0.0/0 ::/0

sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart

Related