Unable to connect to vagrant container from a remote machine

48 views
Skip to first unread message

praveen...@gmail.com

unread,
Jun 21, 2017, 7:59:40 PM6/21/17
to Vagrant
Hi all,

I have created a container in Vagrant which I have to connect from a remote computer. But when I ping to  IP of container from remote computer, i am getting Request timedout error.

$ping 192.168.66.90

Request timeout for icmp_seq 0

Request timeout for icmp_seq 1

Request timeout for icmp_seq 2

Request timeout for icmp_seq 3

Request timeout for icmp_seq 4


Kindly help in resolving this issue

Antony Stone

unread,
Jun 21, 2017, 8:07:39 PM6/21/17
to vagra...@googlegroups.com
On Thursday 22 June 2017 at 01:59:40, praveen...@gmail.com wrote:

> Hi all,
>
> I have created a container in Vagrant which I have to connect from a remote
> computer.

Please define "remote":

What's the IP address of the machine you are trying to ping from?

We can see from the information below that you're trying to ping the address
192.168.66.90.

If that is not in the same network segment as the machine you're pinging from,
please show us the routing table for *both* machines, so we can see whether
the requests are likely to reach the target, and whether the replies are
likely to return.

Also, what happens if you start from the Vagrant machine and try to ping the
"remote computer"? Does that show anything different?

> But when I ping to IP of container from remote computer, i am
> getting *Request timedout error.*
>
> *$ping 192.168.66.90*
>
> Request timeout for icmp_seq 0
>
> Request timeout for icmp_seq 1
>
> Request timeout for icmp_seq 2
>
> Request timeout for icmp_seq 3
>
> Request timeout for icmp_seq 4

Regards,


Antony.

--
"If I've told you once, I've told you a million times - stop exaggerating!"

Please reply to the list;
please *don't* CC me.

praveen...@gmail.com

unread,
Jun 21, 2017, 8:39:29 PM6/21/17
to Vagrant, Antony...@vagrant.open.source.it
Hi Antony Stone,


Thanks for the reply. Please find my answers below:

1) The remote computer I meant t say is a different computer other than the one which is having the vagrant container.
2) I made typo in earlier post, the IP address is 192.168.65.90   (not 192.168.66.90)
3)  IP of machine from which I am pinging: 172.25.44.127
     IP of Vagrant container that I am trying to ping from other machine: 192.168.65.90
4) Routing table of machine from which I am pinging:

[root@blade7 ycsb-0.5.0]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         172.25.44.1     0.0.0.0         UG    100    0        0 eno1
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
172.25.44.0     0.0.0.0         255.255.255.0   U     100    0        0 eno1
192.168.1.0     0.0.0.0         255.255.255.0   U     100    0        0 enp2s0d1
192.168.2.0     0.0.0.0         255.255.255.0   U     100    0        0 enp2s0
192.168.65.0    0.0.0.0         255.255.255.0   U     0      0        0 vboxnet0
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0


Routing table of the vagrant container that I am trying to ping from other machine:

[root@m1 vagrant]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.2.2        0.0.0.0         UG    100    0        0 enp0s3
9.0.1.0         44.128.0.2      255.255.255.0   UG    0      0        0 vtep1024
9.0.2.0         44.128.0.3      255.255.255.0   UG    0      0        0 vtep1024
10.0.2.0        0.0.0.0         255.255.255.0   U     100    0        0 enp0s3
44.128.0.0      0.0.0.0         255.255.240.0   U     0      0        0 vtep1024
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
192.168.65.0    0.0.0.0         255.255.255.0   U     100    0        0 enp0s8

5) I am able to ping to 172.25.44.127 (remote machine) from Vagrant container . 


Kindly help in being able to ping to  the vagrant container from remote machine 

Alvaro Miranda Aguilera

unread,
Jun 22, 2017, 3:59:03 AM6/22/17
to vagra...@googlegroups.com, Antony...@vagrant.open.source.it
Hello.

from this:

Kindly help in being able to ping to  the vagrant container from remote machine 

By default containers in docker have a private IP that exists only between the VM (in this case) and the docker container.

The docker way to expose services is exposing ports, either on a random one or on a custom one.

If you want to assign routable IP to the docker network, is duable but fair advanced, I would suggest do it first without Vagrant to learn the process and then see if the same setup can be easily implemented by Vagrant.

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/7e5d7735-f002-4a08-8f37-7c335ba3f671%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages