Results 1 to 2 of 2
Hi,
In our development box we are configured postgresql to work with Jboss. The thing is we have firewall iptables in our linux box. when the iptables is stopped we ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 07-14-2011 #1Just Joined!
- Join Date
- Jan 2009
- Posts
- 21
Postgresql giving connection timed out because of iptables
Hi,
In our development box we are configured postgresql to work with Jboss. The thing is we have firewall iptables in our linux box. when the iptables is stopped we can connect the postgres db locally using -h option, also we can connect thru a weblink we have created using Jboss. But when the iptables is started we can't connect the db locally using the -h option and the web is giving the below error.
Caused by: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
at org.postgresql.core.v3.ConnectionFactoryImpl.openC onnectionImpl(ConnectionFactoryImpl.java:136)
at org.postgresql.core.ConnectionFactory.openConnecti on(ConnectionFactory.java:66)
at org.postgresql.jdbc2.AbstractJdbc2Connection.<init >(AbstractJdbc2Connection.java:125)
at org.postgresql.jdbc3.AbstractJdbc3Connection.<init >(AbstractJdbc3Connection.java:30)
at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3C onnection.java:24)
at org.postgresql.Driver.makeConnection(Driver.java:3 93)
at org.postgresql.Driver.connect(Driver.java:267)
at org.jboss.resource.adapter.jdbc.local.LocalManaged ConnectionFactory.getLocalManagedConnection(LocalM anagedConnectionFactory.java:207).
We have defined the postgres,Jboss ports plus all the ports in the start up error logs in the iptables still same issue persists. I have also attached the iptables and Jboss startup error logs which is because of the postgres db.
Your replies are highly welcome.
- 07-15-2011 #2
You have a default policy of "drop" for the forwarding table, but no other rules that reference it. For simple, local setups like this one, I would advise creating a user defined table, then "jumping" (-J) all other tables to that table as a target. In that table, you can then define what you want to allow. That approach works well with single-homed boxes and will allow you to remove those input and output rules that are basically duplicates.
N


Reply With Quote
