pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Campbell <greg.campbell@us.michelin.com>
To: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Port blocked by iptables firewall
Date: Fri, 12 Dec 2003 15:47:43 -0500
Message-ID: <3FDA296F.83305998@us.michelin.com> (raw)

I just installed a new Red Hat 9 server with PostgreSQL 7.2-3.

After enabling tcpip_sockets (true) in postgresql.conf and restarting
the postmaster, I was not able to connect to the server remotely,
apparently because the port (5432) was not being responded to. 

Using a working server I would use #psql -h hostname -d my_db_name -U
my_username

The response was 
could not connect to the server: connection refused 
Is the server running on host xxx.xxx.xxx.xxx and accepting 
TCP/IP connections on port 5432?

Yes the server was running. I could use it via localhost. I even used
#nmap -sT -O localhost
where the port showed open. 

I found RH9 seems to have upgrade its security using iptables instead of
ipchains -- and the default security level (high) was keeping me out. I
did not want to completely drop my security level (a test of dropping it
to medium and using configure opened too much stuff). 

The trick seems to be to either use lokkit (gnone-lokkit in GUI) or hand
code iptables rules. The lokkit utilities are making changes to the
/etc/sysconfig/iptables file, which in-turn work with the firewall to
intercept packets as they going to or coming from NICs.

Hand coding iptables rules is not recommended for newbies. 
The man iptables and iptables --help are essential. There are some
helpful links at 
www.redhat.com/support/resources/networking/firewall.htm

iptables --list, is a pretty safe start

I just used lokkit and chose Customize. I included 5432 in the optional
ports area. 

I had not seen any posting on this topic, so I thought I'd share.



view thread (4+ messages)  latest in thread

Message-ID: <3FDA296F.83305998@us.michelin.com>
Permalink:  ../3FDA296F.83305998@us.michelin.com/
Also on:    postgresql.org/message-id/3FDA296F.83305998@us.michelin.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: greg.campbell@us.michelin.com
  Subject: Re: Port blocked by iptables firewall
  In-Reply-To: <3FDA296F.83305998@us.michelin.com>
  References: <3FDA296F.83305998@us.michelin.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox