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 so I thought this would work:

# TYPE  DATABASE        USER            ADDRESS                 METHOD
host    all             all            md5

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

1 Answer 1


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

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

As an additional example, if you wanted to restrict it to to then you'd do

Please see the address subsection in the documentation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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