Reputation: 1812
I'm creating a VM definition and I want to specify a single "private_network" on the primary interface of the box (eth0, it's Linux)
Despite having only one config.vm.network statement, I keep getting the desired network set on eth1, while eth0 is assigned an ip from a 10.0.2.0/24 subnet which I have never defined.
How can I prevent this and have my desired 192.168.x.y/24 set on eth0?
Best, Edoardo
Upvotes: 3
Views: 4623
Reputation: 1
You can try to add the adapter: 1 to the config. Although I still find some problem with it. See if it will help you starts from somewhere.
Example:
config.vm.network "public_network", bridge: "Broadcom BCM5709C", adapter: "1", ip: "192.168.x.xx" You will still have the eth1 which is host-only network...
Upvotes: 0
Reputation: 13920
eth0
is by default used by Vagrant for NAT (VirtualBox NAT networking mode), which allow you to vagrant ssh
into the box (port forwarding rules - host 2222 <=> guest 22).
That's why you have 2 NICs even though you have only 1 config.vm.network
in Vagrantfile
.
I don't think it can be disabled, BUT I am not 100% sure, you may want to look into vagrant source code to dig further.
Upvotes: 6