Policy Routing in RouterOS 3.x

From MikroTik Wiki
Revision as of 04:03, 5 November 2008 by Cdiggity (talk | contribs)
Jump to: navigation, search

Using mangle is not required for policy (aka static) routing with RouterOS 3.x. This is an example of routing between networks without using mangle.

The example network setup:

RouterOS 3 policy routing example network.png

Assuming addresses are assigned to all interfaces as above, static routes must be added to tell router1 that the 192.168.22.0/24 subnet is accessible via router2 and to tell router2 that the 192.168.20.0/24 subnet is accessible through router1. On router1:

/ip route add dst-address=192.168.22.0/24 gateway=192.168.21.2 disabled=no
/ip route rule add dst-address=192.168.22.0/24 action=lookup table=main

on router2:

/ip route add dst-address=192.168.20.0/24 gateway=192.168.21.1 disabled=no
/ip route rule add dst-address=192.168.20.0/24 action=lookup table=main