From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oscar Mechanic Date: Sat, 14 Oct 2006 11:56:14 +0000 Subject: Re: [LARTC] Problem with two providers:Need to route packets on Message-Id: <1160826974.4371.12.camel@OSCARLAPLIN> List-Id: References: <000601c6ef81$692240f0$3b66c2d0$%lartc@neuf.fr> In-Reply-To: <000601c6ef81$692240f0$3b66c2d0$%lartc@neuf.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org There is a simple way a hard way to do this. You could use connmark in iptables. And then use ip rule & routes to set route based on that. As I am not going to replicate this to test I wont try and guess commands. Easiest configure 2 IP's on server. DNAT like iptables -t nat -I PREROUTING 1 -i ethA -j DNAT --to-destination <10.0.0.A> iptables -t nat -I PREROUTING 1 -i ethB -j DNAT --to-destination <10.0.0.B> ip rule add from 10.0.0.B lookup 120 ip route add default via table 120 Thats the easiest I can think of. On Sat, 2006-10-14 at 13:10 +0200, KORTA wrote: > Hello, > > > > i would like to know how to resolve a problem. > > > > I have a debian router with 3 interfaces (LAN, and two internet > providers (Provider A, Provider B)). > > > > The default route is configured to use the provider A > > > > The problem is that, > > When an external connection arrives from provider B to an internal > server (with nat), the packet is routed to the default route: > > I explain: > > - A packet arrives from provider B in direction of a internal > server > > - The router performs nat operation > > - The internal server generates a response > > - The router routes the packet on the interface Provider A > > > > Consequently, The connection cannot been established > > > > I want to know if its possible to configure my debian router to route > packets to the interface on which packet arrives. In the example, > packets should have been routed by the interface connected to provider > B > > > > If yes, do you know how to do that ? > > > > Thanks. > > > > > > > _______________________________________________ > LARTC mailing list > LARTC@mailman.ds9a.nlhttp://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc