Trying to make two vagrant VMs on my workstattion to talk

45 views
Skip to first unread message

John Riker

unread,
Feb 23, 2014, 9:04:17 AM2/23/14
to vagra...@googlegroups.com

I created two vagrant nodes on my laptop with two distinct ip addresses using private network configuration (config.vm.network :private_network, ip: “<ip address>”

How do I make them talk to each other?  If I ping the IP address for each host from the vagrant node, it succeeds. However, nslookup points the IP to some host on the general internet.

After doing some google search, tried turning iptables off….but that did not help.

Any ideas on what I may be missing?

Thanks,


Alvaro Miranda Aguilera

unread,
Feb 23, 2014, 4:20:09 PM2/23/14
to vagra...@googlegroups.com
Hello there

the easiest will be use /etc/hosts in the virtual machines in that way you will be able to use names in each of them.

regarding dns, is not that easy thing to do, if that was easy, like fire up a dns record and propagate over the internet, what will stop you to put google.com on your vm? or amazon.com?

name to ip is the normal dns resolution, the query is looking for a flag A (address), that's the normal resolution.

ip to name, is called reverse of the ip, the query is looking for a PTR record (reverse)

if in your network, your have dns, you can add the reverse zones you are using, and inside the reverse IP you are using.

However, i think etc hosts is the easiest way of do it.

If you check in the following link

https://github.com/kikitux/packer-vagrant-oracle/blob/master/vagrant/rac/Vagrantfile

I have a Vagrantfile that have the etc hosts in a s cript, and then that script is executed in the vms in the multimachine vagrant, so the same should work for you.

Hope this helps,
Alvaro.


--
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.
For more options, visit https://groups.google.com/groups/opt_out.

John Riker

unread,
Feb 23, 2014, 4:49:49 PM2/23/14
to vagra...@googlegroups.com
Thanks Alvaro for the suggestion. Pretty straightfoward and worked as expected. Thanks much for a quick and easy fix.


--
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/-UvjZx1QSRo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages