ip connection on local p2p network

Started by Nonamealmost 21 years ago3 messagesgeneral
Jump to latest
#1Noname
Typing80wpm@aol.com

I just installed the windows postgresql on one of the five machines in our office, which happens to be 192.0.0.9 according to ipconfig. I have installed pg explorer on another machine which happens to be 192.0.0.101 .... What changes do I have to make in the various .conf files for the postgresql server, (and in pg explorer) so that I can connect to the server from the other workstation, hence proving to myself that I could use postgres on our small office network. Thanks for your help!

#2Shelby Cain
alyandon@yahoo.com
In reply to: Noname (#1)
Re: ip connection on local p2p network
--- typing80wpm@aol.com wrote:

I just installed the windows postgresql on one of
the five machines in our office, which happens to be
192.0.0.9 according to ipconfig. I have installed
pg explorer on another machine which happens to be
192.0.0.101 .... What changes do I have to make
in the various .conf files for the postgresql
server, (and in pg explorer) so that I can connect
to the server from the other workstation, hence
proving to myself that I could use postgres on our
small office network. Thanks for your help!

Shouldn't you be using 192.168.x.x addresses
internally? I don't believe 192.0.x.x is a valid
range for the non-routable non-public ip ranges.

Assuming a single NIC in the server machine, change
listen_addresses to "*" in postgresql.conf to listen
on all interfaces. You may want to tailor the
specific addresses to listen on instead if you have
more than one network.

You'll need to add a line to pg_hba.conf. As an
example, assuming you have 192.168.0.0/255.255.255.0
you'd add a line like "host all all 192.168.0.0/8
md5". That would enable non-ssl connections for all
users/databases and use md5 challenge/response for
password authentication over the wire.

Regards,

Shelby Cain

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#3Tony Caduto
tony_caduto@amsoftwaredesign.com
In reply to: Noname (#1)
Re: ip connection on local p2p network

add the following to pg_hba.conf
host all all 192.0.0.0/8 md5

this will let every PC on you network access the PC

or you could add one entry for each host you would like to have access

host all all 192.0.0.101/32 md5
host all all 192.0.0.102/32 md5

If you don't want to use a password, change md5 to trust.

finally you must modify the postgresql.conf file like so:

(this is what it looks like by default)
#listen_addresses = 'localhost' # what IP interface(s) to listen on;
# defaults to localhost, '*' = any

change it to this:
listen_addresses = '*' # what IP interface(s) to listen on;
# defaults to localhost, '*' = any

notice the listen_addresses is uncommented.

That's all you need to do.

--
Tony Caduto
AM Software Design
Home of PG Lightning Admin for Postgresql 8.x
http://www.amsoftwaredesign.com

typing80wpm@aol.com wrote:

Show quoted text

I just installed the windows postgresql on one of the five machines in
our office, which happens to be 192.0.0.9 according to ipconfig. I
have installed pg explorer on another machine which happens to be
192.0.0.101 .... What changes do I have to make in the various .conf
files for the postgresql server, (and in pg explorer) so that I can
connect to the server from the other workstation, hence proving to
myself that I could use postgres on our small office network. Thanks
for your help!