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. On Sunday, March 13, 2016 at 3:03:33 PM UTC-7, Evanilson Abril wrote: > Hello everyone, > > I trying to setup the following network in Vagrant: > > > > <https://lh3.googleusercontent.com/-TjBZG5_M0_g/VuXhiCVpQzI/AAAAAAAACm0/8NYnu61O-DIcb8yefVOmN_XAi3XLSsxZA/s1600/nginx_ssl.png> > > > > > > > > > > > > > > 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 ? > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/f465210a-427d-42cb-af34-dc020995587e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
