I'm trying to expose on my local network a very simple Ruby server running on Linux.
server = TCPServer.new(hostname, port)
My Linux VM runs on a NAT virtual network 192.168.73.X
.
The port I use is 1564
so I forwarded it using the "Virtual Network Editor" in VMware.
Then I use the 192.168.73.133
as the hostname
in my ruby code.
This works great and if I try to connect to my server from the host machine (including with the IP of my host machine 192.168.1.118
.
The problem is that I can't access it from an other computer on the network.
I'm guessing that the hostname needs to be changed but I have no idea what to put (except the IP of the host but ruby crashes when I do that). I also read that I needed to create a route in my linux but I can't figure out which one...
So I think that my question is: What route should I add to my linux in order to be able to put the IP address of the host in the host name?
Thank you for your help.
Ok I'm mad at myself... It was a simple Windows Firewall issue (the NAT was well configured and I didn't need to add a route).
To disable the firewall:
Thank everybody for the help.
If your virtual machine is NATed, then you have to connect to the host. And the host will redirect the traffic to the guest. No route, no firewall settings, nothing else. You have a vmare daemon which do the job.
If you fail to connect, this is because your host don't redirect the traffic.
Use
netstat -anlptu
to see if the vmvare daemon is binded to the 1564 port. If not, you have a misconfiguration problem with your vmware NAT.SpacemanSpiff made me think about another problem: if your guest computer have several NICs, then you can have a routing problem. Not inside the host computer, but inside the guest.
Ensure your guest can reach computers on your local network. Use traceroute.
Either set the default route to the NATed NIC, either add a route to your local network via the NATed NIC.