Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Both boxes in question are RHEL5.

I have a python RPC server running on localhost port 8000. When a client running on the same machine tries to connect, everything works great. When a remote client attempts to connect, we get no response.

netstat shows the process running at 127.0.0.1:8000, which seems to be the problem if I want to allow remote connectors.

I've forwarded the ports on the router, and using tcpdump I can watch the RPC calls come in to port 8000, but they all fail and the RPC Server never gets the message.

The server config allows me to put the host name in: server = SimpleXMLRPCServer(("localhost", 8000))

Trying our domain in place of localhost still results in 127.0.0.1 since our /etc/hosts file looks like:

127.0.0.1      localhost.localdomain localhost
127.0.0.1  staging.<ourdomain>.com

I then changed /etc/hosts to:

127.0.0.1  localhost.localdomain localhost
192.168.1.140 staging.<ourdomain>.com testserver

I've changed the local IP to the server IP, and still nothing. netstat will show the IP from the hosts file on the staging..com line.

How do I get a process to run on :::8000, or 0.0.0.0:8000, or any permutation that would allow a remote client to connect?

share|improve this question

4 Answers 4

Default listen all ports (ipv6+ipv4)

0.0.0.0 = bind all ipv4
share|improve this answer

Have you tried changing it to listen on "0.0.0.0"?

server = SimpleXMLRPCServer(("0.0.0.0", 8000))
share|improve this answer
    
Or, if you can't bind to 0.0.0.0, try: server = SimpleXMLRPCServer(("192.168.1.140", 8000)) Also, since you're on RHEL, make sure that SELinux isn't beating up on your application. –  Seth Nov 3 '09 at 4:14
    
binding to 0.0.0.0 results in the same unresponsiveness. Binding to 192* seems to be the right thing to do, but is my /etc/hosts set up right? or should it include our external IP? –  user24773 Nov 3 '09 at 4:54

Firewall?

service iptables stop

Obviously, don't run like that forever, but, just to test... assuming there are no other security issues.

After that, just open up the port.

share|improve this answer
    
iptables has been stopped. –  user24773 Nov 3 '09 at 3:00

Quick checklist: Does the output of netstat -ln display a listening service on ::8000 ? better yet lsof If not, change the code to listen to all interfaces or the specific one in question.

Is iptables disabled?

Can you connect to that port and ip from another host on the same subnet? This would rule out an intermediate firewall or other issue with your natted inbound connection.

Since this is a tcp connection there is also the possibility that your connection can just not be established, which may happen if the server doesn't have a route back or something of that nature, although that is unlikely if you are already connected inbound via ssh.

share|improve this answer
    
showing no other processes listening on port 8000. iptables is disabled. I try to run the client from another machine in the same subnet and get "unreachable host" or "no route to host", this is with netstat showing the server running on 192.168.1.140:8000 –  user24773 Nov 3 '09 at 17:42
    
Can you telnet from host B to 192.168.1.140:8000 ? Can you ping 192.168.1.140 from host B and get a response packet? Can you give us the output of netstat -ln (Edited to remove anything sensitive) Also just verify that iptables -L -n -v returns nothing, and neither does iptables -t nat -L -n -v –  MattyB Nov 3 '09 at 18:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.