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

From: "Dustin Butler" <dustin(at)intrcomm(dot)net>
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 13:32:21
Message-ID: 20090903133221.9ED9D80C90C@webmail.intrcomm.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

I've done this with outgoing connections for port 25 and 80. Have to be root though and affects the entire server. I used iptables and SNAT (source address translation)

iptables -I POSTROUTING -t nat -p tcp --dport 80 -o eth1 -j SNAT --to-source xxx.xx.xxx.xx

This probably won't go to list not sure why I can't post yet

Dustin Butler
Intrcomm Technology

Skype: dustinbutler

------ Original Message ------
From: dimitris(dot)sakellarios(at)telesuite(dot)gr
Date: Wed, 02 Sep 2009 20:23:18 +0300
To: pgsql-php(at)postgresql(dot)org
Subject: [PHP] How to select the source ip address for a connection to the database server

Hi,

I am currentlyworking with PHP5+PGSQL 8.2.13 and i have the
following problem to solve and i need your help.

The server hosting PHP+psqlclienthas 1 physical network
interfaces with multiplesubinterfaces using different IPs.

One of those IPis 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 sourceto 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 databasemake use
ofservers default interface IP as source.

Thanks in advance for your help.

Browse pgsql-php by date

  From Date Subject
Next Message Arun Oakley 2009-09-04 04:19:59 pg_connect() error
Previous Message Greg Stark 2009-09-03 12:51:16 Re: How to select the source ip address for a connection to the database server