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.

I am trying to configure my PostgreSQL server to have remote access, but it was impossible to make, and when I try to allow the access on Iptables result that I can't restart the iptables.

Look the configuration on pg_hba.conf

"local" is for Unix domain socket connections only

local   all         all                               ident sameuser

IPv4 local connections:

host    all         all         127.0.0.1/32          ident sameuser
host    all         all         184.172.135.142/24    trust

IPv6 local connections:

host    all         all         ::1/128               ident sameuser
host    all         all         184.172.135.142/24    trust

The configuration on the postgresql.conf is the normal

listen_address='*'

and the line opening the port on the iptables is this:

-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 5432 -j ACCEPT

and the error on the iptables is this:

Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: mangle filter             [  OK  ]
Unloading iptables modules:                                [  OK  ]
'pplying iptables firewall rules: iptables-restore v1.3.5: iptables-restore: unable to initialize table 'mangle

Error occurred at line: 2
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
                                                           [FAILED]

I am using a centos, vps server

share|improve this question
    
Thanks, Scott!!!! –  hidura Apr 11 '11 at 4:04

1 Answer 1

up vote 0 down vote accepted

It seems that you have typo/error in your iptables rules config. You can check what rules you have using iptables-save or iptables --line-numbers -n -L, and fix the broken rule. Usually, they are stored in /etc/sysconfig/iptables.

share|improve this answer
    
Thanks! I fixed my issue with iptables, now the problem is on PostgreSQL: LOG: database system is ready LOG: transaction ID wrap limit is 2147484146, limited by database "postgres" LOG: invalid entry in file "/var/lib/pgsql/data/pg_hba.conf" at line 74, token "184.172.135.142/128" FATAL: missing or erroneous pg_hba.conf file HINT: See server log for details. LOG: invalid entry in file "/var/lib/pgsql/data/pg_hba.conf" at line 74, token "184.172.135.142/128" FATAL: missing or erroneous pg_hba.conf file HINT: See server log for details. –  hidura Apr 9 '11 at 17:44

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.