NetFilter
[Top] [All Lists]

Re: Fwd: Routing to and from an IP on an interface

To: Petr Pisar <xpisar@fi.muni.cz>
Subject: Re: Fwd: Routing to and from an IP on an interface
From: Jan Engelhardt <jengelh@linux01.gwdg.de>
Date: Wed, 14 Mar 2007 03:05:03 +0100 (MET)
Cc: netfilter@lists.netfilter.org
Delivered-to: sp-com-lists@consult.net
Delivered-to: netfilter-list1@securepoint.com
In-reply-to: <slrnevcv6v.610.xpisar@album.ics.muni.cz>
List-archive: </pipermail/netfilter>
List-help: <mailto:netfilter-request@lists.netfilter.org?subject=help>
List-id: General discussion and user questions <netfilter.lists.netfilter.org>
List-post: <mailto:netfilter@lists.netfilter.org>
List-subscribe: <https://lists.netfilter.org/mailman/listinfo/netfilter>, <mailto:netfilter-request@lists.netfilter.org?subject=subscribe>
List-unsubscribe: <https://lists.netfilter.org/mailman/listinfo/netfilter>, <mailto:netfilter-request@lists.netfilter.org?subject=unsubscribe>
References: <1173760381.45f6297d9a03d@mail.dreamtoy.net> <slrnevcv6v.610.xpisar@album.ics.muni.cz>
Sender: netfilter-bounces@lists.netfilter.org
On Mar 13 2007 10:28, Petr Pisar wrote:
>On 2007-03-13, Nathan @ Netdigix Systems <lists@netdigix.com> wrote:
>> Hi I have an issue where the internal interface wants to always talk
>> from the primary ip address,  what kind of rule can I add to make the
>> traffic comming from a specific source ip leave the router interface
>> from a specific secondary ip address?
>>
>Source IP address, if not specified by bind(2), depends on routing
>table.
>
>You can add rule which specifies source address explicitly like this:
>
>ip route add default via <MY_GW> dev <OUT_DEV> src <SRC_IP>
>
>Maybe, the dev part is optionable.

You can also use netfilter's SNAT to force a specific IP on outgoing
connections.


Jan
-- 


<Prev in Thread] Current Thread [Next in Thread>