routing mail traffic through a second interface

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

 



Hi,

I have been trying for a few days now to route mail traffic on a different connection than rest of traffic using iproute2, I already did some posts regarding this problem, and thanks to help of guys here and 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 making it as the mta level.

I did :
iptables âA OUTPUT âi eth0 ât mangle âp tcp ââdport 25 âj MARK ââsetâmark 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

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


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


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

Here is the tcpdump log when doing telnet 213.41.143.209 25 :

13:12:36.296170 81.48.224.208.51061 > 213.41.143.209.smtp: S 3495988204:3495988204(0) win 5808 <mss 1452,sackOK,timestamp 7706419 0,nop,wscale 0> (DF) [tos 0x10]
13:12:36.437196 213.41.143.209.smtp > 81.48.224.208.51061: S 687160518:687160518(0) ack 3495988205 win 16800 <mss 1412,nop,nop,sackOK,nop,wscale 0,nop,nop,timestamp 536203422 7706419> (DF)
13:12:38.703028 213.41.143.209.smtp > 81.48.224.208.51060: S 1256669228:1256669228(0) ack 3496982511 win 16800 <mss 1412,nop,nop,sackOK,nop,wscale 0,nop,nop,timestamp 536203426 7706045> (DF)
13:12:39.292786 81.48.224.208.51061 > 213.41.143.209.smtp: S 3495988204:3495988204(0) win 5808 <mss 1452,sackOK,timestamp 7706719 0,nop,wscale 0> (DF) [tos 0x10]
13:12:39.428299 213.41.143.209.smtp > 81.48.224.208.51061: S 687160518:687160518(0) ack 3495988205 win 16800 <mss 1412,nop,nop,sackOK,nop,wscale 0,nop,nop,timestamp 536203428 7706719> (DF)
13:12:40.398787 213.41.143.209.smtp > 81.48.224.208.51059: S 957484233:957484233(0) ack 3482227097 win 16800 <mss 1412,nop,nop,sackOK,nop,wscale 0,nop,nop,timestamp 536203430 7705616> (DF)


Thanks for your help !

Julien




[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