Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2009
    Posts
    4

    Unanswered: accessing DB across lan

    I've accessed databases across a LAN for over a year using this in my pg_hba file.

    # TYPE DATABASE USER CIDR-ADDRESS METHOD

    # IPv4 local connections:
    host all all 127.0.0.1/32 trust
    host all all 192.168.0.1/32 trust
    host all all 192.168.0.199 trust
    # IPv6 local connections:
    host all all ::1/128 trust
    host all all 127.0.0.1/32 trust
    host all all 192.168.0.1/32 trust
    host all all 192.168.0.199 trust

    Now, when I have that in the file, postgres will not start. If I change it back to normal, everything is fine.

    Can anyone spot an error in what I'm doing? I'm using 8.4, but had 8.3 when I had a crash last week.

  2. #2
    Join Date
    Aug 2009
    Location
    Olympia, WA
    Posts
    337
    Put a subnet mask in for 192.168.0.199

  3. #3
    Join Date
    Oct 2009
    Posts
    4
    I tried adding this line:

    host all all 255.255.255.0 trust

    and I also tried this line:

    host all all 192.168.0.199 255.255.255.0 trust

    and it will try to start, then say that it started, then stopped.

  4. #4
    Join Date
    Aug 2009
    Location
    Olympia, WA
    Posts
    337
    The subnet mask part is /32

    host all all 192.168.0.199/32 trust
    or
    host all all 192.168.0.1/24 trust
    to allow access from any computer on your local network. And I assume you know not to use trust isn't a great option.

  5. #5
    Join Date
    Oct 2009
    Posts
    4
    Thanks, I always wondered what the /32 /24 meant. I'm not all that experienced with postgres.

    I"m not worrieda bout security, It's nothing that is all that necessary of security.

  6. #6
    Join Date
    Oct 2009
    Posts
    4
    Thank you, it restarted this time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •