VMs cannot communicate within a private network

22 views
Skip to first unread message

shawn....@gmail.com

unread,
Jan 7, 2016, 8:44:03 PM1/7/16
to Vagrant
Hello all,

I am new to Vagrant and I encounter a problem when I tried to set up two VMs (in the same Vagrantfile). The Vagrantfile looks like:

````
Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/trusty64"

  config.vm.define "m2" do |m|
    m.vm.network "private_network", ip: "192.168.1.101"
    m.vm.provision "shell" do |shell|
      shell.path = "2.sh"
    end
  end

  config.vm.define "m3" do |m|
    m.vm.network "forwarded_port", guest: 80, host: 9000
    m.vm.network "private_network", ip: "192.168.1.102"
    m.vm.provision "shell" do |shell|
      shell.path = "3.sh"
    end
  end
end
````

I set up a PostgreSQL and an NFS server on the machine "m2". However, I cannot access to either of them on "m3". nmap shows that the ports 5432 (PostgreSQL) and 2049 (nfs) were both closed. I could ping and ssh "m2" from "m3". 

I should have the correct PostgreSQL and nfs settings for ingoing connections. And I tried to set iptables but the problem was still there. Have anyone encountered the same problem? How did you solve it?

Many thanks.

Alvaro Miranda Aguilera

unread,
Jan 8, 2016, 7:13:36 PM1/8/16
to vagra...@googlegroups.com
Hello.

Is the network 192.168.1.x available in the host?

If that network is used in the host it may cause problems.

The vagrantfile looks good, the first thing I will test is using a network that is not used. 192.168.1. is common at home networks


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/dc76fb22-5089-4485-aa9e-1836e1d892da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages