Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id BF928634AAC for ; Mon, 16 Mar 2009 02:50:43 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 20480-09 for ; Mon, 16 Mar 2009 02:50:19 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.232]) by mail.postgresql.org (Postfix) with ESMTP id DA08D6340C4 for ; Mon, 16 Mar 2009 02:49:51 -0300 (ADT) Received: by rv-out-0506.google.com with SMTP id g9so1962211rvb.3 for ; Sun, 15 Mar 2009 22:49:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=+vDGnzzKWs+3HxDNsTWDSyx4snJ9dryD09t/CRRdoRY=; b=te8wBJp3DcmcxvTW7bAHVSJvTbP30rAX3bLietcgBi7ffV9qMlB6+dbxowe9vVReoj 16oYG6kMiaCaY2CmEW7rcH8bCsFX24BuAKN8RP/m/cTfHs57cru60qKyYm9C+3U/VZ24 ZzHuM5uTPXb8HNenqX3imO1lFmcE/88k9oekY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Cm5nEakCiZWjQ5BwmULyFgN2vcMY4r8cSr8CE+mkL9yykqp9xJvM/2mgMOuMtlEJmC wLev688iEdmWqodC6X+Ro4ed5AWhOf2/Jq8+IuJh/uuoHImnBPrNu282ZAeZT1in2FKw D6skTqsZ0D4u59jHftNd//oVjQWZfw8aRt37Y= MIME-Version: 1.0 Received: by 10.141.116.17 with SMTP id t17mr2081994rvm.268.1237182590639; Sun, 15 Mar 2009 22:49:50 -0700 (PDT) In-Reply-To: <1155.150.214.205.107.1236874150.squirrel@goliat13.ugr.es> References: <1155.150.214.205.107.1236874150.squirrel@goliat13.ugr.es> Date: Mon, 16 Mar 2009 13:49:50 +0800 Message-ID: <2267dd9e0903152249i3894951eie0c68a4e5e976211@mail.gmail.com> Subject: Re: Problem with the conection From: Tommy Cheng To: mjgacto@ugr.es, pgsql-admin@postgresql.org Content-Type: multipart/alternative; boundary=000e0cd214d2d6600904653604df X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001, NORMAL_HTTP_TO_IP=0.001 X-Spam-Level: X-Archive-Number: 200903/171 X-Sequence-Number: 31671 --000e0cd214d2d6600904653604df Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit try adding these few lines: host database user 161.0.0.0/8 md5 host database user 161.0.0.0/8 trust # "local" is for Unix domain socket connections only local all all trust make sure other "public" 161.x.x.x ip cannot access your server because i don't think 161.x.x.x is a private subnet. On Fri, Mar 13, 2009 at 12:09 AM, wrote: > I have problem with the conection to my database postgres. > I have no problem with the conection in my server (150.xxx.xxx.xxx) and in > the computers with ip near my server. For example if my server > ip is 150.111.111.111 I can connect with 150.111.111.222 or 150.111.111.113 > > I connect using the following code: > try{ > Class.forName("org.postgresql.Driver").newInstance(); > return > > DriverManager.getConnection("jdbc:postgresql://150.xxx.xxx.xxx/database?charSet=LATIN1", > user,password); > } > catch(ClassNotFoundException e){ > } > > The problem happens when I try to connect with the java program to my > server in a computer with 161.x.x.x ip. > In the log file I find this message. > > Mar 11 11:42:01 ec3 kernel: SFW2-INext-ACC-TCP IN=eth0 OUT= > MAC=00:30:48:70:1f:e9:00:07:0d:b7:64:00:08:00 SRC=161.xxx.xxx.xxx > DST=150.xxx.xxx.xxx LEN=48 TOS=0x00 PREC=0x00 TTL=116 ID=30787 DF > PROTO=TCP SPT=1708 DPT=5432 WINDOW=65535 RES=0x00 SYN URGP=0 OPT > (0204056401010402) > > In the computer with ip 161.xxx.xxx.xxx they open port 5432 (for using > postgres) and I include this lines in the pg_hba.conf file > > host database user 150.111.111.111 255.255.255.255 trust > host database user 150.111.111.222 255.255.255.255 trust > host database user 161.xxx.xxx.xxx 255.255.255.255 trust > > Can someone help me with this problem? > Thanks. > > MJ > > > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin > --000e0cd214d2d6600904653604df Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable try adding these few lines:
host =C2=A0 =C2=A0database user =C2=A0 =C2= =A0 161.0.0.0/8 =C2=A0=C2=A0 md5
host= =C2=A0 =C2=A0database user =C2=A0 =C2=A0 16= 1.0.0.0/8 =C2=A0=C2=A0 trust
# "local" is for Unix domain = socket connections only
local=C2=A0=C2=A0 all=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 all= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 trust

make sure other "public&qu= ot; 161.x.x.x ip cannot access your server because i don't think 161.x.= x.x is a private subnet.

On Fri, Mar 13, 2009 at 12:09 AM, <mjgacto@ugr.es> wrote:
I have problem with the conection to my database postgres.
I have no problem with the conection in my server (150.xxx.xxx.xxx) and in<= br> the computers with ip near my server. For example if my server
ip is 150.111.111.111 I can connect with 150.111.111.222 or 150.111.111.113=

I connect using the following code:
try{
=C2=A0 =C2=A0 =C2=A0Class.forName("org.postgresql.Driver").newIn= stance();
=C2=A0 =C2=A0 =C2=A0return
DriverManager.getConnection("jdbc:postgresql://150.xxx.xxx.xxx/databas= e?charSet=3DLATIN1",
user,password);
=C2=A0 =C2=A0}
=C2=A0 =C2=A0catch(ClassNotFoundException e){
}

The problem happens when I try to connect with the java program to my
server in a computer with 161.x.x.x ip.
In the log file I find this message.

Mar 11 11:42:01 ec3 kernel: SFW2-INext-ACC-TCP IN=3Deth0 OUT=3D
MAC=3D00:30:48:70:1f:e9:00:07:0d:b7:64:00:08:00 SRC=3D161.xxx.xxx.xxx
DST=3D150.xxx.xxx.xxx LEN=3D48 TOS=3D0x00 PREC=3D0x00 TTL=3D116 ID=3D30787 = DF
PROTO=3DTCP SPT=3D1708 DPT=3D5432 WINDOW=3D65535 RES=3D0x00 SYN URGP=3D0 OP= T
(0204056401010402)

In the computer with ip 161.xxx.xxx.xxx they open port 5432 (for using
postgres) and I include this lines in the pg_hba.conf file

host =C2=A0 =C2=A0database user =C2=A0 =C2=A0 150.111.111.111 =C2=A0 =C2=A0= =C2=A0 =C2=A0255.255.255.255 =C2=A0 =C2=A0trust
host =C2=A0 =C2=A0database user =C2=A0 =C2=A0 150.111.111.222 =C2=A0 =C2=A0= =C2=A0 =C2=A0255.255.255.255 =C2=A0 =C2=A0trust
host =C2=A0 =C2=A0database user =C2=A0 =C2=A0 161.xxx.xxx.xxx =C2=A0 =C2=A0= =C2=A0 =C2=A0255.255.255.255 =C2=A0 =C2=A0trust

Can someone help me with this problem?
Thanks.

=C2=A0MJ


--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

--000e0cd214d2d6600904653604df--