Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm having a problem with configuring my postgresql server. I've installed PostgreSQL 9.0.2 on slackware 13.1x64 and it runs fine but I can't add a IP that could connect to PostgreSQL remotely.

The logs show me this:

LOG:  invalid IP mask "trust": Name or service not known
CONTEXT:  line 83 of configuration file "/usr/local/pgsql-9.0.2/data/pg_hba.conf"
FATAL:  could not load pg_hba.conf

And on that line I have:

host    all         all         **.**.***.*         trust

The ** is my real IP address. But PostgreSQL tells me I need to set ip mask ? What's that I'm doing wrong ?

Thanks in advance,
Me

share|improve this question

1 Answer 1

up vote 7 down vote accepted

You need to specify an IP address of the form: 192.168.0.1/24 where "/24" is an alternative representation of your Subnet-Mask.

For a local area network you often see 255.255.255.0 as a Subnet-Mask. Each part of that Mask can be translated to an 8-Bit representation (255 = 11111111). So for 3 x 255 you've got 3x 8-Bit which leads to a total of 24-Bits and there you go. Of course, you'll find more detailed explanations on the internet.

Just use http://www.subnet-calculator.com/ or ask your provider for your Subnet-Mask.

share|improve this answer
    
I know that. But I'm using a real IP - internet IP address not a local... :) –  tftd Jan 20 '11 at 13:15
1  
pg_hba.conf wants an IP mask, not an IP address. Try 127.0.0.1/32 or whatever your IP address is. –  Alex Holst Jan 20 '11 at 13:18
    
Thanks. That solved my problem! :) –  tftd Jan 20 '11 at 13:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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