Page 1 of 1

why cannot ping 80 port via host only adapter?

Posted: 27. Nov 2016, 16:40
by dorothy kitty
I have set virtualmachine vm1:centos 6.4,apache,mysql,without iptables,with host-only adapter,IP192.168.56.102
then I can use other virtualmachine which used host only adapter to ping vm1(192.168.56.102),success.
I also can use my host pc(win7)to ping vm1(192.168.56.102),success.
even I can use SSH to log in vm1 with port 22,but ping 192.168.56.102:22 failed.
when i ping 192.168.56.102:80(apache port), failed.
what's the problem??

Re: why cannot ping 80 port via host only adapter?

Posted: 27. Nov 2016, 17:05
by socratis
Because you cannot "ping" a specific port maybe?

Re: why cannot ping 80 port via host only adapter?

Posted: 27. Nov 2016, 17:59
by dorothy kitty
socratis wrote:Because you cannot "ping" a specific port maybe?
Then, how to browse 192.168.56.102:80,I have not got any example in this site.

Re: why cannot ping 80 port via host only adapter?

Posted: 27. Nov 2016, 18:19
by socratis
You don't have an example on this site, because it's not a problem of this site (or VirtualBox) if you cannot connect to a specific port. The job of VirtualBox is done when you displayed that you can connect to 192.168.56.102 from another VM or your host.

Now, if there is anyone "listening" to port 80 in your VM, that another question and not one for VirtualBox. My thinking is that the configuration of the Apache server is not correct. I remember seeing something that the default Apache configuration allowed only access from 127.0.0.1, the localhost only. Check your Apache configuration.

And if you want a way to test whether a port is open, ping is not the way to do it, since ping works over ICMP, not TCP. Search for "port scan" for your OS.