Hello. private_network will create a interface without access to the real network.
If you want to create a interface that have access to the real network, then public_network is what you may need. You can find more information here: https://www.vagrantup.com/docs/networking/ Alvaro. On Wed, Jan 16, 2019 at 3:07 PM Sunil Gajula <[email protected]> wrote: > I have a vagrant file, where the IP of my virtual box is hardcoded. > > # The IP address of the first server > primary_ip = "172.17.8.101" > > I wanted to dynamically assign the ip based on my local network (corporate > network). > > In vagrant documentation, I see we can use > > The easiest way to use a private network is to allow the IP to be assigned > via DHCP. > > Vagrant.configure("2") do |config| > config.vm.network "private_network", type: "dhcp" > end > > https://www.vagrantup.com/docs/networking/private_network.html > > In the same vagrant file, during the configuration I see that the > hardcoded ip is referred. Now since, I am using the 'type: dhcp', how can I > pass the IP details for the below configuration? > > host.vm.provision :shell, inline: %Q|echo 'export > ETCD_AUTHORITY="#{primary_ip}:2379"' >> /home/vagrant/.profile| > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/vagrant-up/c7a3a705-123d-48be-83da-4eca34ada5c5%40googlegroups.com > <https://groups.google.com/d/msgid/vagrant-up/c7a3a705-123d-48be-83da-4eca34ada5c5%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ewFFF2dF9vxkJ_tGJ0%2BmtDB8mMkkJ6kyhgDQTB19kzhAA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
