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

Re: policy routing

Cenk Hasirlioglu <cenkh@efes.net.tr> writes:

> There is third network behind another router and we want to
> route packets coming from this network to a different
> next-hop, not to default gateway.
> How can i do that policy routing with iproute or ipchains
> (kernel 2.2.x)

These two statements should be enough to get packets from the internal
network using the other gateway (I call it

ip route add default via proto static table 5 
ip rule add from to 0/0 lookup 5 priority 999

After this issue an "ip route flush cache" ...

Note, before the default route statement you may have to throw some routes to
your other local networks if you still with wish to talk to them properly.
Something like "ip route add throw table 5".

There is an excellent iproute2 document that explains all these things but
iirc it is a little short on details covering your particular scenario.

Good luck,
fraser campbell <fraser@starnix.com>                          starnix inc.
tollfree: (905) 771-0017                        thornhill, ontario, canada
http://www.starnix.com/             professional linux services & products

Reply to: