Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Uwe A. P. Wuerdinger" <wuerdinger@x-tec.de>
To: netfilter@lists.samba.org
Subject: iptables problem with multible routes [sum]
Date: Fri, 05 Jul 2002 13:09:42 +0200	[thread overview]
Message-ID: <3D257E76.4080400@x-tec.de> (raw)

Hi list,
I have aproblem originally posted to debian-firewall@lists.debian.org
maybe you guys can help me

---snip---

-------- Original Message --------
Subject: iptables problem with multible routes
Date: Fri, 05 Jul 2002 12:10:07 +0200
From: "Uwe A. P. Wuerdinger" <wuerdinger@x-tec.de>
Organization: X-tec Institute for Computer and network Security GmbH
Newsgroups: mailinglist.debian.firewall

Hi List,
I have a problem with iptables (kernel 2.4.18)
and multible routes.

Setup:
My Firewall (FW) has 3 interfaces
eth0 = Internal
eth1 = dedicatet router connection
ppp0 (PPPoE DSL link on eth2)

a kernel default route pointing to ppp0
an a second routingtable (me-prov) with an other default route
pointing to the router connected to eth1.
I have a NAT rule in place for MASQing the networks on eth0.
For the nat Traffic I mark my packets that should use
the me-prov defaulttable with a 0x1

# iptables -t mangle -I PREROUTING 1 -p tcp -i eth0 --dport 22 \
-j MARK --set-mark 0x01

works like expected.
The packet gets NATed end send out to eth1.

My problem is when I do the same for localy generated packets
(e.g. the mailserver running on the FW) with
# iptables -t mangle -I OUTPUT 1 -p tcp --dport 25 \
-j MARK --set-mark 0x01

The packed got routed out to eth1, as expected but has the Source IP
of ppp0.
What can I do to get that packets the right source IP for eth1?

-------- Original Message --------
Subject: Re: iptables problem with multible routes
Date: Fri, 05 Jul 2002 12:36:12 +0200
From: "Uwe A. P. Wuerdinger" <wuerdinger@x-tec.de>
Organization: X-tec Institute for Computer and network Security GmbH
Newsgroups: mailinglist.debian.firewall
References: <3D25707F.8020002@x-tec.de> <20020705100805.GT31085@virus.home>

Jean Christophe ANDRÃ0/00 wrote:

 > mlist-debianfirewall@x-tec.de écrivait :
 >
 >>The packed got routed out to eth1, as expected but has the Source IP of
 >>ppp0. What can I do to get that packets the right source IP for eth1
 >>
 >
 > Check your NAT rule: you probably need to precise the output interface as
 > "-o ppp0" to only NAT when it goes thought the DSL line.


NOP that would break the NATing of the internal traffic that should go
out to eth1:

iptables -t mangle -I PREROUTING 4 -p tcp -i eth0 --dport 22 \
-j MARK --set-mark 0x01

---snip---

greets Uwe
-- 
X-Tec GmbH
Institute for Computer and Network Security
WWW : http://www.x-tec.de/



                 reply	other threads:[~2002-07-05 11:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3D257E76.4080400@x-tec.de \
    --to=wuerdinger@x-tec.de \
    --cc=netfilter@lists.samba.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