[CentOS] control outgoing IP address?

Wed Jun 18 13:17:01 UTC 2008
Barry Brimer <lists at brimer.org>


On Wed, 18 Jun 2008, Les Mikesell wrote:

> Barry Brimer wrote:
>>> I'd like to consolidate some services that have been assigned by IP (dns, 
>>> syslog etc.) onto one machine by giving it IP aliases to accept 
>>> connections for the old addresses until all the references are fixed. 
>>> However, I'd like to have it use it's original IP as the source for 
>>> outbound connections. Where do you control that?
>> 
>> There may be settings in each application that control that, but in case 
>> there are not .. you should be able to do something like :
>> 
>> iptables -t nat -A POSTROUTING -p tcp --sport 334 -j SNAT --to 2.3.4.5
>> 
>
> Is there no way to control the default source address?

In some applications you can .. but it is application dependent.  what 
applications are you looking to do this with?

Barry