[CentOS] Routing

Banyan He

banyan at rootong.com
Wed Mar 20 11:45:51 UTC 2013


I'm actually doing it. The route2 feature can be useful in this case. 
You can mark the packets and route2 will do the favor for you. It's just 
different table will be used for the tagged packets. Here is what I use,

1       smtp
2       http
3       ssh
4       lan

     $IPTABLES -N Cid6642X27340.0 -t mangle
     $IPTABLES -t mangle -A PREROUTING -p tcp -m tcp  --dport 25 -j 
Cid6642X27340.0
     $IPTABLES -t mangle -A Cid6642X27340.0  -s 10.28.2.238   -j MARK 
--set-mark 0x1

ip route add 1.1.28.0/24 via 1.1.28.2 dev tun-SINs table smtp
ip route add default via 1.1.4.2 dev tun-SIN-EDG table smtp

------------
Banyan He
Blog: http://www.rootong.com
Email: banyan at rootong.com

On 3/20/2013 7:37 PM, Tom Grace wrote:
> On 20/03/13 11:28, Prabhpal S. Mavi wrote:
>> Is it possible that i can identify the source traffic and forward it to
>> the specific interface.
>>
>> i.e.
>>
>> Remote packet coming from 192.168.21.0 should be forward to 192.168.20.20
>> (eth1)
>>
>>
>> Is that possible ?
> It's possible, but it is far more typical to have destination based
> routing. You could look at
> http://www.novell.com/support/kb/doc.php?id=7008874 for pointers.
>
> What is the end goal, the list might have some pointers that are easier
> to manage.
>
> Tom
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>




More information about the CentOS mailing list