From: Andy Furniss <andy.furniss@dsl.pipex.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] why fwmark don't work
Date: Tue, 08 Feb 2005 01:41:11 +0000 [thread overview]
Message-ID: <420818B7.6030907@dsl.pipex.com> (raw)
In-Reply-To: <004101c50a0a$ca7b5c00$02c0a8c0@sazhost>
saz wrote:
> Hi guys im trying to make a port redirecction using iproute together with iptables mangle option .. but for some strange reason is not working yet, I know i can do it in a diferent way, but the idea is using packet marking and redirect the packets with a rule.
>
> I have two computers PC1 and PC2
>
> PC1: 192.168.0.1 this is the one connected to internet, and this machine make the redirection
> PC2: 192.168.0.2 this is the smtp server
>
> So this is what i do in PC1:
>
> first i mark all the packets incoming for 25 port with "1":
>
> iptables -t mangle -A PREROUTING -p tcp --dport 25 -j MARK --set-mark 1
>
> then i create a table called smtp:
>
> echo 200 smtp >> /etc/iproute2/rt_tables
>
> after that i set PC2 as default via for my smtp table:
>
> ip route add default via 192.168.0.2 table smtp
>
> and finally i make the rule for smtp table
>
> ip rule add fwmak 1 table smtp
>
> this would have to work, but is not redirecting nothing...
>
> i can see that is making the packets with 1 using the command iptables -t mangle -L PREROUTING -v but is not working, any one can help me?
I am not sure, but I think your rules will just make smtp packets try to
use 192.168.0.2 as a gateway rather than whatever your normal gateway
is. I guess you really need to dnat them to 192.168.0.2. using iptables.
Andy.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
prev parent reply other threads:[~2005-02-08 1:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-03 16:09 [LARTC] why fwmark don't work saz
2005-02-08 1:41 ` Andy Furniss [this message]
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=420818B7.6030907@dsl.pipex.com \
--to=andy.furniss@dsl.pipex.com \
--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.