Re: routing mail traffic through a second interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Julien,

Julien <dyna@xxxxxxxxxxxxx> wrote:

> Hi,
>
> I have been trying for a few days now to route mail traffic on a=20
different connection than rest of traffic using iproute2, I already
did=20 some posts regarding this problem, and thanks to help of guys
here and=20 in the lartc mailing list I succedeed to have a little
improvement.
>
> Here are the box infos :
>
> Slackware 9.1 (Linux 2.4.22)
> Two dsl connections via pppoe
>
> I only care about locally generated mail traffic but I didn't succeed=20
making it as the mta level.
>
> I did :
> iptables =E2=88=92A OUTPUT =E2=88=92i eth0 =E2=88=92t mangle =E2=88=92p
t= cp =E2=88=92=E2=88=92dport 25 =E2=88=92j MARK
=E2=88=92=E2=88=92set=E2=88= =92mark 1
> echo 201 mail.out >> /etc/iproute2/rt_tables
> ip rule add fwmark 1 table mail.out
> ip route add default via [Second's ISP Gateway] dev ppp1 table mail.out
>

Why not use the ROUTE target ?

Let's say your normal flow goes through ppp0 by default.

def_int=ppp0
iptables -t mangle -I OUTPUT -o $def_int -p tcp --dport 25 -j ROUTE --oif
ppp1 --continue

So now, all traffic generated from the computer itself will use ppp1 as
the outgoing interface. Do not forget the --continue which means the
packet will continue traversing other rules.

> In order to make packets go out with correct source ip address :
iptables -t nat --append POSTROUTING -p tcp --dport 25 --jump SNAT=20
--to-source [Second's ISP external IP]
>

Correct.

> The current situation :
> I can see with tcpdump packets going out, and back but if I do telnet=20
someisp.com 25 I see nothing in the terminal.
>

Are you sniffing on ppp1 ?
Did you enable NAT of local connection ?

> I really don't know what can be wrong and found no answer neither in the=20
> mailing list archive, in the lartc howto or in the advanced routing
howto= .
>

I can actually not answer.  Please provide more details such as related
Conntrack entries, commands you executed to troubleshoot, etc.



-- 
Samuel Jean
SysAdmin & NetAdmin
at cookinglinux.org



-- 
Samuel Jean
SysAdmin & NetAdmin
at cookinglinux.org




[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux