How to change the default networking

9 views
Skip to first unread message

Adrian Wallaschek

unread,
Mar 5, 2020, 4:10:53 PM3/5/20
to Vagrant
Hi! I use Vagrant to build and configure VMs that later I want to deploy to vSpere. rsp. vCloud Director.

The structure is simple: there will be proxies and a jumpserver, each with one NIC in a DHCP-configured public network. They all will have a second NIC in a private network that uses fixed IP addresses.

Now when I build these machines, each ends up with three NICs: one for Vagrant, one for the private (as configured) and one for the public (as configured). While the configured NICs work, the Vagrant-NIC is disturbing me.

Yes, I can make an Ansible-Playbook to disable this one or a PowerCLI script to kill the NIC upon instantiation of the VM from the Content-Library.


What I would love, though, ist to re-configure the Vagrant internal networking to happen on that private interface. Is that possible? Can I redefine the network that Vagrant uses for configuring the machine?

Best ragards and thx in advance!

Alvaro Miranda Aguilera

unread,
Mar 7, 2020, 7:05:18 AM3/7/20
to vagra...@googlegroups.com
If the process you are doing is just automatic, ie runnign scripts, the best would be use packer.

packer have builders.
vmware-iso that can start from an iso and create a VM
but also have vmware-vmx that can start from an existing vm. this one is good to create specific VMS from a base template.

For your question,
You can try something like this:


 config.vm.network "public_network", adapter: 0, auto_config: false


But I am not sure the right syntax if you want multiple networks.



alvaro


--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/7655e701-4d38-430a-a353-b0ffb618b888%40googlegroups.com.


--
Alvaro

Reply all
Reply to author
Forward
0 new messages