Help Setup Network with Vagrant

23 views
Skip to first unread message

Evanilson Abril

unread,
Mar 13, 2016, 6:03:33 PM3/13/16
to Vagrant
Hello everyone, 

    I trying to setup the following network in Vagrant: 


  












I want to make the Load Balancer available from outside but the private network to be visible or accessible by the load balancer, I tried by making the private network (in the picture) a public network but when I make the private network and assign IP address for each web server it says "Network is unreachable". 

Can someone help me please ?

Alvaro Miranda Aguilera

unread,
Mar 13, 2016, 6:09:56 PM3/13/16
to vagra...@googlegroups.com
Hello,

Can you put the IPs you want to have on each of those units, and what you have done in Vagrantfile.

Will help to understand what you have tried, whats failing and what do you think is missed.

Thanks
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/5a3b87d1-1f13-46b8-a2c6-36e814d6c20c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joaquin Menchaca

unread,
Mar 18, 2016, 2:33:40 PM3/18/16
to Vagrant
First.  I am not sure of the scope.   What exactly do you mean "outside"? Load balancer on your network outside your laptop?  On localhost?  What is your provider?  This assumes that your provider is virtualbox.

If you have a private network specified inside your Vagrantfile for your systems, they will use the first available network, e.g. vboxnet0.  You can access these directly from 127.0.0.1, as Virtualbox adds routes to those private IPs, e.g. 192.168.50.8 and 192.168.50.9.

Here's an idea.  You can have two private networks, vboxnet0 and vboxnet1.  These could be 192.168.50.0/24 and 10.10.10.0/24.  The loadbalancer would be connected to vboxnet0 and vboxnet1, e.g. 192.168.50.2 and 10.10.10.2.  The web servers would only be on vboxnet1.   All web traffic would come into vboxnet0, and pass this to systems within vboxnet1, e.g. 10.10.10.8 and 10.10.10.9.

You can simulate traffic on your Mac, localhost, e.g. locust, to the loadbalancer on 192.168.50.2.  If will then forward traffic on 10.10.10.8 and 10.10.10.9.  Now, in reality, this is not a true simulation, because all systems can be accessed from 127.0.0.1, but it is a near approximation.

Another pattern, is to create a load balancer on the host itself, such as Mac OS X, which then talks to the two private IPs directly, which again are accessible from 127.0.0.1 through the virtual NIC and corresponding routes created by VirtualBox.

Note that this is not so much a question of Vagrant, but rather Virtualbox.  Vagrant only automates the least common denominator, that is, what is available across all virtual systems.  The above scenarios would work with Vagrant's control.  To get into more advanced network configurations, you'd need to get into vboxmanage tool, which is also available through Vagrant, but then you lock it into only Virtualbox provider in this scenario. 
Reply all
Reply to author
Forward
0 new messages