iproute2 + netfilter problem

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi guys, i have a problem with a configuration what i'm trying to do.
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!!

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux