Sunday, February 27, 2011

Checkpoint Source Based Routing (PBR)

The best and easiest way to do is via SmartSPLAT

You will setup your new environment with in seconds!



In this example, the client node 192.168.0.70 will go to internet through Router1 ,  DMZ network 172.16.0.0/24 will go to internet through Router 2, all other clients will go through Router 0

Define the tables,
echo 100 route1 >> /etc/iproute2/rt_tables
echo 200 route2 >> /etc/iproute2/rt_tables

Define the routes for that tables,
ip route add default via 10.1.1.1 table route1
ip route add default via 10.2.2.1 table route2

Define the client or network that will use these tables
ip rule add from 192.168.0.70 table route1
ip rule add from 172.16.0.0/24 table route2

Define the routes to access each other
ip route add 172.16.0.0/24 dev eth3 table route1
ip route add 192.168.0.0/24 dev eth4 table route2

To be persistent after reboot add them to :     /etc/rc.local
Make routes active:                                     ip route flush cache
To view Routes :                                         ip rule list /  ip route show