private_network IP assignment

22 views
Skip to first unread message

Sorcerer Stone

unread,
Sep 2, 2019, 1:50:49 PM9/2/19
to Vagrant

Hello All,

My host OS is Win10pro with Hyper-V disabled.

I need to have a Linux development environment to test build different independent apps. So, I installed Virtualbox, Vagrant, Ubuntu.

 

These apps need exposed IP to run from the host (Win10 in my case).

For single app, this IP assignment can be done e.g.

config.vm.network "private_network", ip: "192.168.33.10"

 

Is it recommended or even possible to assign different IP assignments to different apps within the vagrantfile?

Or use just a single IP as above and all apps using the same IP for host to access (via different ports)?

 

If multiple IP is a possible solution, can I tag onto the vagrantfile with lines like:

 

config.vm.network "private_network", ip: "192.168.33.10"

config.vm.network "private_network", ip: "192.168.33.11"

config.vm.network "private_network", ip: "192.168.33.12"

 

 

Thanks in advance.

Sorcerer

Alvaro Miranda Aguilera

unread,
Sep 8, 2019, 5:39:30 AM9/8/19
to vagra...@googlegroups.com

hello

Virtualbox will create a virtual switch


HOST -> Switch <-VM

This is how the networking works

if you add more VMS and/or more IPs they will be connected to the virtual switch

                           <- VM with ip 192.168.33.10
HOST -> Switch <- VM with ip 192.168.33.11
                           <- VM with ip 192.168.33.12

So it will work just fine.

is no different than from your host pc accessing different ips over the network

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/93e48314-407c-491c-bee8-7b4d126e00df%40googlegroups.com.


--
Alvaro

Reply all
Reply to author
Forward
0 new messages