Using auto_config: false for a private network without specifying IP?

66 views
Skip to first unread message

Shashank Korada

unread,
Feb 21, 2018, 8:57:38 AM2/21/18
to Vagrant
Hi,

I am trying to spin a VM that has an additional interface which I want to configure/use later and hence do NOT want the IP to be assigned to it.
I am using the auto_config feature which does help in not assigning an IP to the interface

But for some reason I require the IP not to be mentioned in the vagrantfile. Is there a way to do it without specifying it?

VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.ssh.forward_agent = true
    config.vm.define test-vm do |s|
      s.vm.box = "ceph/ubuntu-xenial"
      s.vm.hostname = test-vm
      s.vm.network :private_network, ip: "10.10.10.10" , auto_config: false  ====> HOW TO SKIP specifying IP here?
      s.vm.provider :libvirt do |v|
        v.memory = 6000
        v.cpus = 2
        v.nested = true
    end
  end
end

I have tried s.vm.network :private_network, ip: "" , auto_config: false but that doesnt work
Any ideas?

Shashank Korada

unread,
Feb 21, 2018, 2:41:54 PM2/21/18
to Vagrant
The reason I dont want to mention the IP is , although it brings up an interface without assigning an IP to it , the host get a virtual network interface with 10.10.10.1 which I want to avoid

virbr66   Link encap:Ethernet  HWaddr fe:54:00:29:80:a2
inet addr:10.10.10.1 Bcast:10.10.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:536 (536.0 B)  TX bytes:348 (348.0 B)

Alvaro Miranda Aguilera

unread,
Feb 22, 2018, 6:29:27 AM2/22/18
to vagra...@googlegroups.com
Hello

The host get an IP from Virtualbox when Vagrant setup the proxy

if you go to network settings, vboxnet0 should be there

delete any other

then try with


s.vm.network :private_network, auto_config: false 



Vagrant will create a VBoxSwitch

if you create one manually, and disable dhcp, does set an ip the host

if not? then you can try with 

s.vm.network :private_network, name: "vboxnet1" , auto_config: false 

assuming the one you created without dhcp is called vboxnet1


If this fail

share Vagrantfile and output




--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/e7d2e52b-a3b2-40e1-81c1-4cf53f90d7a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages