From: Dimitris Sakellarios <dimitris.sakellarios@telesuite.gr>
To: 'Bob McConnell' <rmcconne@lightlink.com>
Cc: pgsql-php@postgresql.org
Subject: Re: How to select the source ip address for a connection to the database server
Date: Sun, 6 Sep 2009 16:13:26 +0300
Message-ID: <AEFA6E9872F74EAC83B4BDAA52FA5676@toshiba> (raw)
In-Reply-To: <4AA30914.7080102@lightlink.com>
References: <20090902202318.hp0bplmn4kkc48k0@zeus.netdynamics.gr>
<4AA30914.7080102@lightlink.com>
Bob hi I would be very interested in giving me some small hint of how you
did that in PERL so I can start from someplace in PHP.
BR.
-----Original Message-----
From: pgsql-php-owner@postgresql.org [mailto:pgsql-php-owner@postgresql.org]
On Behalf Of Bob McConnell
Sent: Sunday, September 06, 2009 3:58 AM
To: dimitris.sakellarios@telesuite.gr
Cc: pgsql-php@postgresql.org
Subject: Re: [PHP] How to select the source ip address for a connection to
the database server
dimitris.sakellarios@telesuite.gr wrote:
>
> 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.
>
> Thanks in advance for your help.
That is the way sockets normally work, the primary address is always
used for outgoing connections. It can not be changed without some low
level programming. It is necessary to bind the socket to the specific IP
address before opening the connection. I have done it with Perl, but not
PHP.
Bob McConnell
N2SPP
--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php
__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4398 (20090905) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4398 (20090905) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
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: dimitris.sakellarios@telesuite.gr, rmcconne@lightlink.com
Subject: Re: How to select the source ip address for a connection to the database server
In-Reply-To: <AEFA6E9872F74EAC83B4BDAA52FA5676@toshiba>
References: <20090902202318.hp0bplmn4kkc48k0@zeus.netdynamics.gr> <4AA30914.7080102@lightlink.com> <AEFA6E9872F74EAC83B4BDAA52FA5676@toshiba>
* 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