Home > Mobile >  How to configure PostgreSQL to accept specific IPV6 incoming connection
How to configure PostgreSQL to accept specific IPV6 incoming connection

Time:10-28

I'm trying to connect to my remote DB from inside Intellij.

So I think I need to be in pg_hba.conf

I have my IPV4 local connections:

host all all my.IP.V4.ip/32 md5

Question: beneath this is a line to configure IPV6, I have the address but I don't know what exactly to put for the IPV6 line after the "/"? Do I even need the slash?

host  all  all   1:2:3:4:5:6:7:8/???  md5

UPDATE: Hmm, so I have...

host   all  all  xxxx:xxxx:xxxx:ccc:xxxx:xxxx:xxxx/128 trust

...and my db client (intellij) is still asking for a username / password.

user:postgres....pass:none....is still failing

thanks in advance

CodePudding user response:

pg_hba.conf takes CIDR addresses, so yes, just like with IPv4 address you'll need the slash and the number behind it.

If you want to narrow the permissible connection down to one specific host you'll want to specify a /128.

host  all  all   1:2:3:4:5:6:7:8/128  md5
  • Related