From: Greg Stark <gsstark@mit.edu>
To: Andrew McMillan <andrew@morphoss.com>
Cc: dimitris.sakellarios@telesuite.gr
Cc: pgsql-php@postgresql.org
Subject: Re: How to select the source ip address for a connection to the database server
Date: Thu, 3 Sep 2009 13:51:16 +0100
Message-ID: <407d949e0909030551x4d5374bo4311583d80e67eb2@mail.gmail.com> (raw)
In-Reply-To: <1251977488.8237.154.camel@happy.home.mcmillan.net.nz>
References: <20090902202318.hp0bplmn4kkc48k0@zeus.netdynamics.gr>
<1251977488.8237.154.camel@happy.home.mcmillan.net.nz>
On Thu, Sep 3, 2009 at 12:31 PM, Andrew McMillan<andrew@morphoss.com> wrote:
> 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.
I don't think you need to be root to select a source address. But
that's not helpful since libpq doesn't support binding to a particular
interface. That would be a useful feature and we should probably add
it to the TODO.
You should note that the source address isn't actually a very secure
way to protect your connections since any other host on that network
could spoof your address.
It sounds like what you're looking for is to control the interface the
packets are routed through. This is separate from the source address
as packets are often routed through multiple hosts along their way.
Routing rules are not something individual applications normally get
involved in. If the connections are being routed through the wrong
interface then you have a global problem, not just with the database
and it requires system-wide configuration changes.
--
greg
http://mit.edu/~gsstark/resume.pdf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: gsstark@mit.edu, andrew@morphoss.com, dimitris.sakellarios@telesuite.gr
Subject: Re: How to select the source ip address for a connection to the database server
In-Reply-To: <407d949e0909030551x4d5374bo4311583d80e67eb2@mail.gmail.com>
References: <20090902202318.hp0bplmn4kkc48k0@zeus.netdynamics.gr> <1251977488.8237.154.camel@happy.home.mcmillan.net.nz> <407d949e0909030551x4d5374bo4311583d80e67eb2@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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