From: Tony Clayton Subject: Re: SNAT & default route Date: Mon, 23 Jun 2003 20:40:08 -0400 Sender: netfilter-devel-admin@lists.netfilter.org Message-ID: <20030624004008.GW32443@gambit.enfusion-group.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Chris Wilson , netfilter-devel Return-path: To: Luca Raggi Content-Disposition: inline In-Reply-To: Errors-To: netfilter-devel-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: List-Id: netfilter-devel.vger.kernel.org On Mon, Jun 23, 2003 at 09:23:08AM -0700, Luca Raggi wrote: > ... > iptables -t nat -A PREROUTING -j CONNMARK --save-mark > ... > iptables -t nat -A POSTROUTING -m mark --mark 0x11 -j SNAT --to-source > $IP1 > iptables -t nat -A POSTROUTING -m mark --mark 0x12 -j SNAT --to-source > $IP2 > iptables -t nat -A POSTROUTING -m mark --mark 0x13 -j SNAT --to-source > $IP3 > ... > # ...commands to replicate all the routes in the three tables omitted... > ip route add default via $GW1 table t1 > ip route add default via $GW2 table t2 > ip route add default via $GW3 table t3 Hi Luca, I think what you want is: ip route add default via $GW1 src $IP1 table t1 ip route add default via $GW2 src $IP2 table t2 ip route add default via $GW3 src $IP3 table t3 and skip the SNAT altogether. Good luck Tony