Port forwarding doesn’t work in VirtualBox (Vagrant)

port-forwardingvagrantvirtualization

I have got VirtualBox (Vagrant actually) with CentOs. I have got port forwarding there (NAT). For example, I have got some application in my box bound to port 8080. Port is forwarded. So I can connect to this port from my host and guest machine.

telnet 127.0.0.1 8080

But I can't execute anything from my host machine:

telnet 127.0.0.1 8080
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
HEAD / HTTP/1.0
....sleeeeeep.....

But it works from my vagrant ssh session.

How to fix it?

Best Answer

Ok, it was firewall problem.

service iptables stop
chkconfig iptables off