Broken routes with changed default router on macOS

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Broken routes with changed default router on macOS

michael
Hello,

I change the default route in a VM as described here: https://www.vagrantup.com/docs/networking/public_network.html#default-router (i.e. `route add default gw <new> && route del default gw <old>`).

This works fine on Linux but not for macOS users: they loose connectivity to the internet with the change (host and guest can still connect though).

Somebody knows the problem and a solution?

Thanks,
Michael

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/d03310ea-a817-407c-a525-997cbed904c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Broken routes with changed default router on macOS

Alvaro Miranda Aguilera
Hello

the documentation is just an example, different OS will require a different route.

are you doing a macOS guest and you want to override the default gw there?

The first point will be check the documentation and came with the commands you need

once you get the commands, Vagrant can run them for you. but came with the commands require some trial try/error.

Alvaro.

On Mon, Nov 20, 2017 at 9:40 AM, <[hidden email]> wrote:
Hello,

I change the default route in a VM as described here: https://www.vagrantup.com/docs/networking/public_network.html#default-router (i.e. `route add default gw <new> && route del default gw <old>`).

This works fine on Linux but not for macOS users: they loose connectivity to the internet with the change (host and guest can still connect though).

Somebody knows the problem and a solution?

Thanks,
Michael

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/d03310ea-a817-407c-a525-997cbed904c9%40googlegroups.com.
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ezV%2BqK1VV5aK0ZW0JZgoeOpqBQDDX3_NdV3wd2gkA%3DXUQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Broken routes with changed default router on macOS

michael


On Monday, November 20, 2017 at 10:44:56 AM UTC+1, Alvaro Miranda Aguilera wrote:

are you doing a macOS guest and you want to override the default gw there?

The guest is a Linux VM. The relevant part of my provision script is:

route add default gw 192.168.222.1
eval "$(route -n | awk '{ if ($8 =="enp0s3" && $2 != "0.0.0.0") print "route del default gw " $2; }')"

192.168.222.1 is the host IP address. The guest uses a private network; from the Vagrant file:

c.vm.network "private_network", ip: "192.168.222.10"

This all works on a Linux host. On a macOS host the guest is not able to connect to the internet after the default gw was changed.

 

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/e31e7b26-0713-4b69-b749-d27c82d50b08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Broken routes with changed default router on macOS

Alvaro Miranda Aguilera
there is not enough information to help.

should it connect over private_network?

what are the output of

route -n
ip addr show

can you ping 8.8.8.8 ?

perhaps you need to replace the dns?

can be many reasons why doesnt work, if you could share a repo over github to reproduce will be easier to have a look.

Alvaro.

On Mon, Nov 20, 2017 at 11:26 AM, <[hidden email]> wrote:


On Monday, November 20, 2017 at 10:44:56 AM UTC+1, Alvaro Miranda Aguilera wrote:

are you doing a macOS guest and you want to override the default gw there?

The guest is a Linux VM. The relevant part of my provision script is:

route add default gw 192.168.222.1
eval "$(route -n | awk '{ if ($8 =="enp0s3" && $2 != "0.0.0.0") print "route del default gw " $2; }')"

192.168.222.1 is the host IP address. The guest uses a private network; from the Vagrant file:

c.vm.network "private_network", ip: "192.168.222.10"

This all works on a Linux host. On a macOS host the guest is not able to connect to the internet after the default gw was changed.

 

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/e31e7b26-0713-4b69-b749-d27c82d50b08%40googlegroups.com.
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ezpDC8Mwy_76vdB_iXsGeCcjhKC18t3UFA0J49Zms8qMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.