Access Vagrant Box in Public Network

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

Access Vagrant Box in Public Network

Evanilson Abril
  
      Hello, 

          I have being struggling with this problem for 3 days now and I Can figure out the solution, please help me!!

          I want to setup a development environment for my company using vagrant. Each developer has an machine on the LAN network but I want to be able to make these machines available on the public network, what I mean by that is be able to ping these machines from a different network (for example ping this machines from another country). 

          I used the setup on the vagrantup.com documents but its not working, I am using the following setup 

          
 config.vm.network "public_network", ip: "192.168.0.17"
  # default router
  config.vm.provision "shell",
    run: "always",
    inline: "route add default gw 192.168.0.1"

  # default router ipv6
  config.vm.provision "shell",
    run: "always",
    inline: "route -A inet6 add default gw fc00::1 eth1"

  # delete default gw on eth0
  config.vm.provision "shell",
    run: "always"
    inline: "eval `route -n | awk '{ if ($8 ==\"eth0\" && $2 != \"0.0.0.0\") print \"route del default gw \" $2; }'`" 

But I am not able to access this machine. By the way I am able to access them from the host machine, but not from a different network 
Please can someone help me ?


--
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/e9cead21-d77d-41d0-ad50-679682324851%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Access Vagrant Box in Public Network

Alvaro Miranda Aguilera
Hello

Can you share the following please:

- Vagrantfile you are using
- Lan ip segment, ie 192.168.10.x
- It does dhcp or will be using fixed ip
- Whats the gateway there, if you don't now, can you see on your host computer
- How you will know what VM have what ip? how you will know how to connect to the one you want to connect?

With that, I can help you :)

Alvaro.


On Sat, Feb 27, 2016 at 2:32 PM, Evanilson Abril <[hidden email]> wrote:
  
      Hello, 

          I have being struggling with this problem for 3 days now and I Can figure out the solution, please help me!!

          I want to setup a development environment for my company using vagrant. Each developer has an machine on the LAN network but I want to be able to make these machines available on the public network, what I mean by that is be able to ping these machines from a different network (for example ping this machines from another country). 

          I used the setup on the vagrantup.com documents but its not working, I am using the following setup 

          
 config.vm.network "public_network", ip: "192.168.0.17"
  # default router
  config.vm.provision "shell",
    run: "always",
    inline: "route add default gw 192.168.0.1"

  # default router ipv6
  config.vm.provision "shell",
    run: "always",
    inline: "route -A inet6 add default gw fc00::1 eth1"

  # delete default gw on eth0
  config.vm.provision "shell",
    run: "always"
    inline: "eval `route -n | awk '{ if ($8 ==\"eth0\" && $2 != \"0.0.0.0\") print \"route del default gw \" $2; }'`" 

But I am not able to access this machine. By the way I am able to access them from the host machine, but not from a different network 
Please can someone help me ?


--
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/e9cead21-d77d-41d0-ad50-679682324851%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/CAHqq0ey5BXef1LzsD7O7cvB3CYShS2XJvBeCfQ3EZo4Einvtsw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Access Vagrant Box in Public Network

Evanilson Abril


Thank you for Replying Mr. Alvaro,

      I attached my VagrantFile and I am working on hp proliant dl360 g5 server and the ip address on this server is 68.180.x.x but on my mac the Lan IP is 192.168.2.4
      I am using dhcp 
      When I ping my server 68.180.x.x it respondes with no problem but when I assigned an ip for the vagrant box via dhcp it does not respond the ping from outside, it just responds the pings from the host machine (which is my server on 68.180.x.x)

     Please Mr. Alvaro help m, I am going crazy with this problem. I also tried to replace the nat interface using a bridge network but vagrant is not accepting.
On Friday, February 26, 2016 at 7:48:44 PM UTC-6, Alvaro Miranda Aguilera wrote:
Hello

Can you share the following please:

- Vagrantfile you are using
- Lan ip segment, ie 192.168.10.x
- It does dhcp or will be using fixed ip
- Whats the gateway there, if you don't now, can you see on your host computer
- How you will know what VM have what ip? how you will know how to connect to the one you want to connect?

With that, I can help you :)

Alvaro.


On Sat, Feb 27, 2016 at 2:32 PM, Evanilson Abril <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="I7DMvJAKBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">evanilso...@...> wrote:
  
      Hello, 

          I have being struggling with this problem for 3 days now and I Can figure out the solution, please help me!!

          I want to setup a development environment for my company using vagrant. Each developer has an machine on the LAN network but I want to be able to make these machines available on the public network, what I mean by that is be able to ping these machines from a different network (for example ping this machines from another country). 

          I used the setup on the <a href="http://vagrantup.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Fvagrantup.com\46sa\75D\46sntz\0751\46usg\75AFQjCNHOKXyEzmO0RtZ1me-_EOkqgtXEMA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Fvagrantup.com\46sa\75D\46sntz\0751\46usg\75AFQjCNHOKXyEzmO0RtZ1me-_EOkqgtXEMA&#39;;return true;">vagrantup.com documents but its not working, I am using the following setup 

          
 config.vm.network "public_network", ip: "192.168.0.17"
  # default router
  config.vm.provision "shell",
    run: "always",
    inline: "route add default gw 192.168.0.1"

  # default router ipv6
  config.vm.provision "shell",
    run: "always",
    inline: "route -A inet6 add default gw fc00::1 eth1"

  # delete default gw on eth0
  config.vm.provision "shell",
    run: "always"
    inline: "eval `route -n | awk '{ if ($8 ==\"eth0\" && $2 != \"0.0.0.0\") print \"route del default gw \" $2; }'`" 

But I am not able to access this machine. By the way I am able to access them from the host machine, but not from a different network 
Please can someone help me ?


--
This mailing list is governed under the HashiCorp Community Guidelines - <a href="https://www.hashicorp.com/community-guidelines.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\46sa\75D\46sntz\0751\46usg\75AFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\46sa\75D\46sntz\0751\46usg\75AFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;">https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: <a href="https://github.com/mitchellh/vagrant/issues" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\46sa\75D\46sntz\0751\46usg\75AFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\46sa\75D\46sntz\0751\46usg\75AFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;">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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="I7DMvJAKBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">vagrant-up+...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/vagrant-up/e9cead21-d77d-41d0-ad50-679682324851%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/e9cead21-d77d-41d0-ad50-679682324851%40googlegroups.com?utm_medium\75email\46utm_source\75footer&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/e9cead21-d77d-41d0-ad50-679682324851%40googlegroups.com?utm_medium\75email\46utm_source\75footer&#39;;return true;">https://groups.google.com/d/msgid/vagrant-up/e9cead21-d77d-41d0-ad50-679682324851%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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/19ae0e4a-3d25-4021-a9c9-51cad4450157%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vagrantfile.txt (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Access Vagrant Box in Public Network

VMTrooper
Evanilson, is your 68.x.x.x server able to ping your desktop?

Can you provide the following?
1. IP address, subnet mask, default gateway of your desktop machine that is running vagrant

2. IP address, subnet mask, default gateway of your Vagrant VM when it gets a DHCP address from public_network. NOT from when you set it to static.

--
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/16180899-cf8c-4f8e-93b9-db1c35f7961a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Access Vagrant Box in Public Network

Alvaro Miranda Aguilera
Hi There,

We did work this off list, and found the GW was incorrect, so basically we did the same check :)

Alvaro.

On Sun, Feb 28, 2016 at 4:00 AM, Trevor Roberts Jr <[hidden email]> wrote:
Evanilson, is your 68.x.x.x server able to ping your desktop?

Can you provide the following?
1. IP address, subnet mask, default gateway of your desktop machine that is running vagrant

2. IP address, subnet mask, default gateway of your Vagrant VM when it gets a DHCP address from public_network. NOT from when you set it to static.

--
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/16180899-cf8c-4f8e-93b9-db1c35f7961a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/CAHqq0ewP4wRihUZBhzA3CLvbVU7NzP0vWVbvQ%3D53wZAuHtF7qA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.