From: "saz" Date: Thu, 03 Feb 2005 16:09:51 +0000 Subject: [LARTC] why fwmark don't work Message-Id: <004101c50a0a$ca7b5c00$02c0a8c0@sazhost> MIME-Version: 1 Content-Type: multipart/mixed; boundary="----=_NextPart_000_003E_01C509F1.A5034370" List-Id: To: lartc@vger.kernel.org This is a multi-part message in MIME format. ------=_NextPart_000_003E_01C509F1.A5034370 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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? ------=_NextPart_000_003E_01C509F1.A5034370 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi guys im trying to make a port = redirecction using=20 iproute together with iptables mangle option .. but for some strange = reason is=20 not working yet, I know i can do it in a diferent way, but the idea = is=20 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=20 internet, and this machine make the redirection
PC2: 192.168.0.2 this is the smtp=20 server
 
So this is what i do in=20 PC1:
 
first i mark all the packets incoming = for 25=20 port with "1":
 
iptables -t mangle -A = PREROUTING -p tcp=20 --dport 25 -j MARK --set-mark 1
 
then i create a table called = smtp:
 
echo 200 smtp >>=20 /etc/iproute2/rt_tables
 
after that i set PC2 as default via for = my smtp=20 table:
 
ip route add default via = 192.168.0.2 table=20 smtp
 
and finally i make the rule for smtp=20 table
 
ip rule add fwmak 1 table=20 smtp
 
this would have to work, but is not = redirecting=20 nothing...
 
i can see that is making the packets = with 1 using=20 the command iptables -t mangle -L PREROUTING -v but is = not=20 working, any one can help me?
------=_NextPart_000_003E_01C509F1.A5034370-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/