1

I would like to configure my Postgres DB to be accessed by any IP 10.8.101.*. I know I have to create a rule in pg_hba.conf but I'm not sure what it should look like. My LAN IP is currently 10.8.101.128 so I thought this would work:

# TYPE  DATABASE        USER            ADDRESS                 METHOD
host    all             all             10.8.101.0/128         md5

But I'm getting an error could not load pg_hba.conf. Does anyone know how to do this properly?

4

The /128 in the address is the NUMBER OF BITS to match... not a range.

So you would want 10.8.101.0/24 (match the first 24 bits).

As an additional example, if you wanted to restrict it to 10.8.101.128 to 10.8.101.255 then you'd do 10.8.101.128/25

Please see the address subsection in the documentation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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