All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien <dyna@tri-oxyde.org>
To: lartc@vger.kernel.org
Subject: [LARTC] routing mail on a different gateway
Date: Fri, 23 Jul 2004 19:29:55 +0000	[thread overview]
Message-ID: <41016733.9090702@tri-oxyde.org> (raw)

Hi,

I have a linux box with two dsl modems on it (connection is done via 
pppoe), I'm trying to route default traffic on the primary connection 
(ppp0) and mail traffic on another one (ppp1). This traffic will come 
from the localhost.

I run Slackware 9.1 (Kernel 2.4.22), recompiled with necessary options 
for using iproute2.

According to the advanced routing howto, I did the following :

iptables −A OUTPUT −t mangle −p tcp −−dport 25 −j MARK −−set−mark 1

I use "-A OUTPUT" since I want to alter locally generated packets.

echo 201 mail.out >> /etc/iproute2/rt_tables
ip rule add fwmark 1 table mail.out
/sbin/ip route add default via [Second's ISP Gateway] dev ppp1 table 
mail.out

I get no error message, and ip rule ls and ip route show params where 
recorded, iptables -t mangle -lnV shows no problem too.

When I do telnet smtp.someisp.com 25, I see with tcpdump the packets 
going out through the interface ppp1 :

14:32:40.693429 62.212.120.196.34515 > 193.252.22.80.smtp: S 
4069327741:4069327741(0) win 5808 <mss 1452,sackOK,timestamp 929359 
0,nop,wscale 0> (DF) [tos 0x10]

But the problem is that there are originated from 62.212.120.196, which 
is the ip of ppp0, not ppp1. So packets can't take the way back.

How can I change the "from" ip of packets that are routed through ppp1 ?

Thanks for your help.

Julien

PS: I did a quite similar post in the netfilter list, and thanks to the 
guys there I succeeded solving the base problem (at start no packet was 
going out at all on ppp1) but now I know that lartc list exists, I think 
asking here is better.

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

             reply	other threads:[~2004-07-23 19:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-23 19:29 Julien [this message]
2004-07-24 11:18 ` [LARTC] routing mail on a different gateway Julien

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=41016733.9090702@tri-oxyde.org \
    --to=dyna@tri-oxyde.org \
    --cc=lartc@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.