public_network and gateway

16 views
Skip to first unread message

Mathew Abraham

unread,
Dec 5, 2017, 8:37:01 AM12/5/17
to Vagrant
Hi guys,

I got a setup for public_network with static IP

 c.vm.network :public_network, ip: n[0], netmask: '255.255.255.0'

However When the last bit is executed i.e. "Configuring and enabling network interfaces.."  it clears my manual GATEWAY entry in ifcfg-enp0s8 because of this other servers cannot ping my VM. Is there any way to

a) Configure gateways for interface via vagrant? 
b)or tell vagrant  not to delete gateway configs ?

VirtualBox Guest Additions: Starting.
Redirecting to /bin/systemctl start vboxadd.service
Redirecting to /bin/systemctl start vboxadd-service.service
Unmounting Virtualbox Guest Additions ISO from: /mnt
==> wcs_local_env: Checking for guest additions in VM...
==> wcs_local_env: Setting hostname...
==> wcs_local_env: Configuring and enabling network interfaces...
    wcs_local_env: SSH address: 127.0.0.1:2200
    wcs_local_env: SSH username: vagrant
    wcs_local_env: SSH auth method: private key
==> wcs_local_env: Mounting shared folders...
    wcs_local_env: /vagrant => C:/disc/vagrant
==> wcs_local_env: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> wcs_local_env: flag to force provisioning. Provisioners marked to run always will still run.

Thanks,
Mathew

Alvaro Miranda Aguilera

unread,
Dec 5, 2017, 12:02:30 PM12/5/17
to vagra...@googlegroups.com
hello

vagrant wont setup gw in that fixed ip setup, better tell vagrant not configure and do it over a provision script. you can add run: "always" to have it run all the time.

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/c2103655-0ab1-4f0e-8211-2e60786d9b9f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Mathew Abraham

unread,
Dec 5, 2017, 12:50:58 PM12/5/17
to Vagrant
Thanks Alvaro, I now tried an inline provision script with run always just to set gateway and it is working

Reply all
Reply to author
Forward
0 new messages