Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Julien <dyna@tri-oxyde.org>
To: netfilter@lists.netfilter.org
Subject: routing mail traffic through a second interface
Date: Sun, 25 Jul 2004 21:05:45 +0200	[thread overview]
Message-ID: <41040489.3030201@tri-oxyde.org> (raw)

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



             reply	other threads:[~2004-07-25 19:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-25 19:05 Julien [this message]
     [not found] <20040726042628.25004.71017.Mailman@vishnu.netfilter.org>
2004-07-26 12:43 ` routing mail traffic through a second interface Samuel Jean
  -- strict thread matches above, loose matches on Subject: below --
2004-07-26 12:47 Samuel Jean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41040489.3030201@tri-oxyde.org \
    --to=dyna@tri-oxyde.org \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox