title: Can't connect to database through pgbouncer from a remote place
body: <p>I'm  developing .net application with connection to postgresql (npgsql). Due to a large amount of idle connections (npgsql can't terminate it) I had to install pgbouncer. I wrote a config file and set an auth_user_file.</p>
  
  <p>pgbouncer config:</p>
  
  <pre><code>[databases]
  dbr = host=HOST_DNS_NAME port=16252 dbname=app_database user=PGB_USER password=PGB_PASSWORD
  
  [pgbouncer]
  listen_port = 16252
  listen_addr = *
  auth_type = md5
  auth_file = /URL_TO_AUTH_FILE/users.txt
  logfile = pgbouncer.log
  pidfile = pgbouncer.pid
  admin_users = root
  stats_users = root
  default_pool_size = 50
  max_client_conn = 100
  log_connections = 1
  log_disconnections = 1
  log_pooler_errrors = 1
  unix_socket_dir = /tmp
  </code></pre>
  
  <p>I allowed communication on the 16252 port (iptables)</p>
  
  <pre><code>-A INPUT -m state --state NEW,ESTABLISHED -m tcp  -p tcp --dport 16252 -j ACCEPT
  
  netstat -na | grep 16252
  tcp        0      0 0.0.0.0:16252                0.0.0.0:*                   LISTEN
  unix  2      [ ACC ]     STREAM     LISTENING     2726363 /tmp/.s.PGSQL.16252
  </code></pre>
  
  <p>When I connect via SSH directly to the server and I want to connect through pgbouncer locally </p>
  
  <pre><code>psql -h HOST_DNS_NAME -p 16252 -U PGB_USER dbr
  </code></pre>
  
  <p>everything's fine. But when I want to connect remotely from another location through pgbouncer the psql client throws me following message:</p>
  
  <pre><code>    psql: could not connect to server: Connection refuses &lt;0x0000274D/10061&gt;
      Is the server running on host HOST_DNS_NAME and accepting TCP/IP connections on port 16252 
  </code></pre>
  
  <p>If I change only port to standart 5432 (direct postgresql), everything works well.</p>
  
  <p>Do you have any idea?</p>