From: "saz" Date: Fri, 14 Jan 2005 14:04:27 +0000 Subject: [LARTC] iproute2 + netfilter problem Message-Id: <000801c4fa41$f5c80080$02c0a8c0@sazhost> MIME-Version: 1 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0005_01C4FA28.D04B2D00" List-Id: To: lartc@vger.kernel.org This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C4FA28.D04B2D00 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi guys, i have a problem with a configuration what i'm trying to do.=20 I have two computers with linux, A and B, connected in the same network = with this configuration: PC1 A: 192.168.192.1 PC2 B: 192.168.192.30 The PC1 A is a firewall doing nat... this one is connected to the = internet via an adsl modem and of course it have its own public ip , and = the router B is a smtp server but connected behind the router A, what = i'm trying to do is redirect the smtp incoming traffic of the router A = to the router B using iproute2 and nerfilter tools This is the configuration on the router A: iptables -t mangle -A POSTROUTING -p tcp --dport 25 -j MARK --set-mark 1 = ( this marks the smtp packets with 1 ) i create a table called "smtp" in the rt_tables file. ip rule add fwmark 1 table smtp ( this is the rule for my table smtp ) and finally i declare a via in my smtp table, so the smtp traffic would = have to go by this way. ip route add default via 192.168.192.30 table smtp Ok... for example if i make a telnet to PC1 on the 25 port.. this should = redirect me to PC2 where is my real smtp server, but is not working... = any idea of why ? the PC2 have not a firewall.. Thank you!! ------=_NextPart_000_0005_01C4FA28.D04B2D00 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi guys, i have a problem with a = configuration what=20 i'm trying to do.
I have two computers with linux, A = and B,=20 connected in the same network with this configuration:
 
PC1 A: 192.168.192.1
 
PC2 B: 192.168.192.30
 
The PC1 A is a firewall doing nat... = this one is=20 connected to the internet via an adsl modem and of course it have = its own=20 public ip , and the router B is a smtp server but connected behind the = router A,=20 what i'm trying to do is redirect the smtp incoming traffic of the = router A to=20 the router B using iproute2 and nerfilter tools
 
This is the configuration on the router = A:
 
iptables -t mangle -A = POSTROUTING=20 -p tcp --dport 25 -j MARK --set-mark 1 ( this marks the = smtp=20 packets with 1 )
 
i create a table called "smtp"  in = the=20 rt_tables file.
 
ip rule add fwmark 1 table = smtp (=20 this is the rule for my table smtp )
 
and finally i declare a via in my smtp = table, so=20 the smtp traffic would have to go by this way.
 
ip route add default via = 192.168.192.30=20 table smtp
 
Ok... for example if i make a = telnet to=20 PC1 on the 25 port.. this should redirect me to PC2 where is = my real=20 smtp server, but is not working... any idea of why ? the PC2 = have not=20 a firewall..
 
Thank you!!
------=_NextPart_000_0005_01C4FA28.D04B2D00-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/