1

I've got pgAdmin running on my XP machine. There's a Centos machine running a Postgres server on the network. The Postgres server pg_hba.conf file has the following lines

TYPE      DATABASE    USER      CIDR-ADDRESS       METHOD
host      all         all       10.0.0.68/32       trust
local     mydb        myuser                       password
local     all         postgres                     ident
host      mydb        myuser    10.0.0.68/32       password
host      all         postgres  10.0.0.68/32       trust

My postgresql.conf file has the following line:

listen_address = 'localhost, 10.0.20.10'

nmap -sS 10.0.20.10 shows:

PORT      STATE     SERVICE
5432/tcp  open      postgresql

I can ssh into a bash shell on the server, but I can't connect with pgAdmin. I get the following:

could not connect to server: No route to host(0x00002751/10065) Is the server running on host "10.0.20.10" and accepting TCP/IP connections on port 5432?

I've no idea what the problem is.

3
  • Make sure that Postgres server was restarted (e.g. listen_address change requires such restart). I guess that might be rather some firewall issue. Commented Sep 2, 2011 at 17:29
  • Try to reach port 5432 with ssh, Try it on numeric ip-adres (instead of hostname) in pgadmin3 (could be a stale DNS entry) Is there any NAT/firewalling involved? Commented Sep 4, 2011 at 14:05
  • 1
    Yes it was a firewall issue. 'service iptables stop' enabled the connection. I'll just write a rule to allow the connection. Thanks for the input. Commented Sep 5, 2011 at 8:07

2 Answers 2

2

@Aidan found the solution himself:

It was a firewall issue.

service iptables stop

enabled the connection. I'll just write a rule to allow the connection.

Sign up to request clarification or add additional context in comments.

1 Comment

you could just have easily added an iptable rule to forward to the right port instead of bringing down your firewall.
2

Suppose server's IP address is 10.0.20.10 then you could just add these iptable rules as @Dark Star1 proposed in comments:

iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d 10.0.20.10 --dport 5432 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -s 10.0.20.10 --sport 5432 -d 0/0 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.