From mboxrd@z Thu Jan 1 00:00:00 1970 From: Date: Thu, 16 Aug 2007 15:25:39 +0000 Subject: Re: [LARTC] two providers. Message-Id: <8cd844dfd487463b1d7e5a8238b15c35@localhost> List-Id: References: <136729277.20070816154811@yandex.ru> In-Reply-To: <136729277.20070816154811@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org > So, there's a trouble. > > I have debian etch linux. 2.6.18-4 kernel. > > On this computer i have three interfaces: eth0 - my lan, eth1, eth2 - > providers. > > By default all internet traffic routed through eth2. But i NEED to > route mail and icq (tcp110, tcp25, tcp5190) through eth1. How can i do > that? A while ago ive used a similar configuration, what ive done was: - create additionall routing table add all regular entries to it with changed default gateway for the second provider like: ip route add xxx.xxx.xxx.xxx via yyy.yyy.yyy.yyy table 2 ... ip route add default via IP_OF_2ND_GATEWAY table 2 - mark desired traffic with iptables iptables -I FORWARD -s LAN_NET/MASK -p tcp --dport XXX -j MARK --set-mark 2 - use ip rules to direct marked packets via alternative routing table ip rule add fwmark 2 table 2 - and maby add additionall rule to make all packages originating at eth1 ip to go via table 2 ip rule add from ETH1_IP table 2 should be more or less something like this, though i dont recall if syntax was exactly like ive wrote above. big dissadvantage of this solution is utilisation of marks, that might be used for another purpose. -- Radek 'Goblin' Pieczonka _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc