Hi there,

If you're using VirtualBox, you can further isolate your VMs by using
Internal Networking. For example:

  Vagrant.configure("2") do |config|
    config.vm.box = "hashicorp/bionic64"

    config.vm.define "vm1" do |vm1|
      vm1.vm.network "private_network", ip: "192.168.0.2",
                           virtualbox__intnet: true
    end

    config.vm.define "vm2" do |vm2|
      vm2.vm.network "private_network", ip: "192.168.1.2",
                           virtualbox__intnet: true
    end

    config.vm.define "vm3" do |vm3|
      vm3.vm.network "private_network", ip: "192.168.2.2",
                           virtualbox__intnet: true
    end
  end

With this setup, you should be able to ssh into vm1/vm2/vm3, but the VMs
can't ping each other.

More information about the Internal Networking configuration for Vagrant
can be found here:
https://www.vagrantup.com/docs/providers/virtualbox/networking#virtualbox-internal-network

Cheers,
Jeff

On Wed, Sep 23, 2020 at 2:40 AM Erik Zilinsky <erik.zilin...@icontest.hu>
wrote:

> Hello guys, I have the following 3 private networks on the same host:
>
> VM1 - config.vm.network "private_network", ip: 192.168.0.2
> VM2 - config.vm.network "private_network", ip: 192.168.1.2
> VM3 - config.vm.network "private_network", ip: 192.168.2.2
>
> How can achieve isolated networks? Currently I can ping VM2 from VM1.
>
> I would like to achieve the following:
> - host can reach VMs
> - guests have internet connection
> - guests cannot reach each other
>
> Thanks in advance!
>
> Erik Zilinsky
>
> --
> 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/hashicorp/vagrant/issues
> Discuss: https://discuss.hashicorp.com/c/vagrant/24
> ---
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/771180ae-9033-4be0-84c6-f4487dc92d71n%40googlegroups.com
> <https://groups.google.com/d/msgid/vagrant-up/771180ae-9033-4be0-84c6-f4487dc92d71n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 

*Jeff Bonhag*he/him
Engineer II
*e* jbon...@hashicorp.com
------------------------------

<https://www.hashicorp.com/>

-- 
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/hashicorp/vagrant/issues
Discuss: https://discuss.hashicorp.com/c/vagrant/24
--- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/CAAf6GadQRVcpwbzhMW11zR%3Dcv_RvXAZpwu8mhLdEez4Mdam58Q%40mail.gmail.com.

Reply via email to