I'm trying to portforward a PostgreSQL port using my DLINK ADSL Router. I have the following IP addresses.
Public Internet IP 197.321.321.32 PostgreSQL 22.214.171.124:5432 (Port To Forward CentOS 7)
I've configured PostgreSQL to allow remote connections as well as disabled firewalld and selinux for testing purposes.
listen_addresses = '*'
# LAN connections host dbname usname 126.96.36.199/24 md5 # Internet connections host dbname usname 197.321.321.0/24 md5
All the computers on the LAN can connect to PostgreSQL fine.
Then I did the port forwarding.
Server Name External Port Protocol Internal Port Server IP Address Use Interface Lan Loopback Schedule Rule pbpgsql 5432 to 5432 TCP 5432 to 5432 188.8.131.52 ppp0.1 Disabled Always
I tried to telnet to test the port
telnet 197.321.321.321.32 5432
Which gives me the response
telnet: connect to address 197.321.321.32: Connection refused
Why is this? I can't connect to the PostgreSQL port from outside the LAN but inside the LAN it works fine