so , when I tried to ping each vm from one to the other, i am not getting any reply from the pinged machine.
Here is one example:
cd vm1
vagrant ssh
ping 192.168.15.11
i got no reply from the vm2 and it is the same for the vm2 , i got no reply from the vm1.
so please if anyone can help me in fixing that it will be handy. i need vm1 and vm2 in the same network (so i would like to be able to ping between vm1 and vm2) please. Any little info will help.
I use virtualbox in Fedora Linux 36, and tried to setup like your setup vagrant vm in different folder and with ip private network. and is working well and normal, my vagrant vm centos1 can ping vm centos2, and vice versa. look at my SS below
Hi mate,
thanks again. could you share you vagrant configuration files for the 2 vms please?
We tried again yesterday to put everything under a single file but for some reason the private ip addresses we set up don’t get created. Maybe if you have a chance you can look it up with us?
My Vagrantfile is default like default everybody run vagrant init in the terminal. I just uncomment private network and change same with your private network in vagrant. But did you know if virtualbox only allow private ip address in range 192.168.56.0/26? if you don’t know you can read this official article form virtualbox for networking in host only network.
Did you know vagrant can use all kind of type available network like you use virtualbox as guest VM? vagrant can use host only networking, bridge networking and NAT networking which is use port forwarding in vagrant.
if you want use bridge network in vagrant virtual box you can use this:
config.vm.network “public_network”, :bridge => ‘br0’, :dev => ‘br0’, ip: “192.168.1.10”
br0 is your bridge network in your host OS. So if you vagrant up or reload you can access your vagrant vm with virtualbox provier from other host/computer/laptop in the same network or LAN.