How to disable IPv6 support?

2,636 views
Skip to first unread message

Uilian Ries

unread,
Jul 9, 2015, 3:59:28 PM7/9/15
to vagra...@googlegroups.com
I would like to disable IPv6 directly in my Vangrat file.

I'm using a script file that executes when the VM (virtual box) and disable IPv6 by sysctl
My virtual machine is using Ubuntu 14.04.

Alvaro Miranda Aguilera

unread,
Jul 9, 2015, 5:44:19 PM7/9/15
to vagra...@googlegroups.com
Hello,

couple of options here

1. on the first provision, add those lines to /etc/sysctl.conf and run sysctl -p

grep net.ipv6.conf.all.disable_ipv6 /etc/system.conf || (echo
"net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee -a /etc/system.conf)

repeat for

net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

that will apply the values to the system running, and will be aplied
on next reboot

2. on every vagrant up, you can add `,run: "always"` to the shell
provisioner, and that script will run in every vagrant up or vagrant
reload

3. update the base box, export it and use the box box

4. create a new base box fit to what do you require


Any questions, or anything you need, feel free to ask

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/67c3b978-d2b1-4fbc-83e3-31901808f6bf%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Uilian Ries

unread,
Jul 13, 2015, 11:56:43 AM7/13/15
to vagra...@googlegroups.com
Hi Alvaro,

Thanks for your suggestion.

Actually this is exactly what I did.

I added a script to /etc/sysctl.conf and after I run sysctl -p  (during Vagrant initialization).

However, I see this situation as a workaround, not a native setting for Vagrant.

For example, when I want add network config at Vagrant config, I have this line:

     agent.vm.network "public_network", ip: "192.168.0.1", :adapter => 1, :bridge => "eth1"

I would like add an option to IPv6, maybe like this:

      agent.vm.network "public_network", ip: "192.168.0.1", :adapter => 1, :bridge => "eth1", :ipv6 => False

I don't know a native option for this case.

Alvaro Miranda Aguilera

unread,
Jul 14, 2015, 5:45:21 AM7/14/15
to vagra...@googlegroups.com
Hello,

My suggestion will be create your own base box..

may sound difficult but is not..

hashicorp have a tool for this, called packer (packer.io)

If you haven't used, a nice starting point is the tutorial:
https://atlas.hashicorp.com/tutorial/packer-vagrant/0

With that you will use packer push to send the template to atlas, and
there the box will be built remotely and made available for vagrant

Then you can start tweaking and modifying that box.

Basically you may want to move to the base box as much as the heavy
lifting as you can..

as an example, a normal devstack (openstack) run can be 1hour 20
minutes starting with a bare minimum ubuntu, depending on the
internet.. I was able to make that down to 20 mins installing all the
packages required and having a git clone of the big components
included in the base box

Hope this helps
Alvaro
> https://groups.google.com/d/msgid/vagrant-up/8f02f21a-af4e-45a2-9952-6b922d23f92a%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages