Skip site navigation (1) Skip section navigation (2)

Re: How to select the source ip address for a connection to the database server

From: Andrew McMillan <andrew(at)morphoss(dot)com>
To: dimitris(dot)sakellarios(at)telesuite(dot)gr
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: How to select the source ip address for a connection to the database server
Date: 2009-09-03 11:31:28
Message-ID: 1251977488.8237.154.camel@happy.home.mcmillan.net.nz (view raw or flat)
Thread:
Lists: pgsql-php
On Wed, 2009-09-02 at 20:23 +0300, dimitris(dot)sakellarios(at)telesuite(dot)gr
wrote:
> Hi,
> 
> I am currently working with PHP5+PGSQL 8.2.13 and i have the following
> problem to solve and i need your help.
> 
> The server hosting PHP+psql client has 1 physical network interfaces
> with multiple subinterfaces using different IPs.
> 
> One of those IP is dedicated to my domain, but it is not servers
> default IP address since i share the server.
> 
> So the problem that i need to solve is how am i going to be able to
> use-select my domains IP address as source to connect to the remote
> databases.
> 
> Is there any configuration to settle default source IP the client will
> use?
> 
> At the moment all my attempts to connect to the database make use of
> servers default interface IP as source.

Nope, unless you're root you're unlikely to be able to choose the source
address for your connection, and even then it would be tricky.

You probably need to either live with the fact that the people you share
your hosting with might also be able to connect to your database, so if
you are paranoid you might want to make sure it is an SSL connection,
and protect it with a reasonable password.

Or you could shell out some more money for a non-shared server, and then
perhaps you might not need to have the database remote in the first
place.

Cheers,
					Andrew McMillan.

------------------------------------------------------------------------
http://andrew.mcmillan.net.nz/                     Porirua, New Zealand
Twitter: _karora                                  Phone: +64(272)DEBIAN
                        Beware of Bigfoot!
------------------------------------------------------------------------

In response to

Responses

pgsql-php by date

Next:From: Greg StarkDate: 2009-09-03 12:51:16
Subject: Re: How to select the source ip address for a connection to the database server
Previous:From: dimitris.sakellariosDate: 2009-09-02 17:23:18
Subject: How to select the source ip address for a connection to thedatabase server

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group