pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedProblem with the conection
3+ messages / 3 participants
[nested] [flat]
* Problem with the conection
@ 2009-03-12 16:09 mjgacto@ugr.es
2009-03-16 05:49 ` Re: Problem with the conection Tommy Cheng <csckcac@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: mjgacto@ugr.es @ 2009-03-12 16:09 UTC (permalink / raw)
To: pgsql-admin
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Problem with the conection
2009-03-12 16:09 Problem with the conection mjgacto@ugr.es
@ 2009-03-16 05:49 ` Tommy Cheng <csckcac@gmail.com>
2009-03-16 16:00 ` Re: Problem with the conection eugene.obrien@convergys.com
0 siblings, 1 reply; 3+ messages in thread
From: Tommy Cheng @ 2009-03-16 05:49 UTC (permalink / raw)
To: mjgacto@ugr.es; pgsql-admin
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, <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
> 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
>
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Problem with the conection
2009-03-12 16:09 Problem with the conection mjgacto@ugr.es
2009-03-16 05:49 ` Re: Problem with the conection Tommy Cheng <csckcac@gmail.com>
@ 2009-03-16 16:00 ` eugene.obrien@convergys.com
0 siblings, 0 replies; 3+ messages in thread
From: eugene.obrien@convergys.com @ 2009-03-16 16:00 UTC (permalink / raw)
To: Tommy Cheng <csckcac@gmail.com>; mjgacto@ugr.es; pgsql-admin
Also may want to set 255.255.255.255/0 trust and then test access. I
found that this seems to allow access from anywhere and then maybe tie
it down.
________________________________
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Tommy Cheng
Sent: Sunday, March 15, 2009 10:50 PM
To: mjgacto@ugr.es; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Problem with the conection
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, <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
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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2009-03-16 16:00 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-03-12 16:09 Problem with the conection mjgacto@ugr.es
2009-03-16 05:49 ` Tommy Cheng <csckcac@gmail.com>
2009-03-16 16:00 ` eugene.obrien@convergys.com
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox