Professional Documents
Culture Documents
Manual - Routing Table Matcher - MikroTik Wiki
Manual - Routing Table Matcher - MikroTik Wiki
Contents
Introduction
Application Example
Add routes to routing table
Mangle rule
Routing rules
Conclusion
Introduction
Sometimes ISP's are giving different local and overseas bandwidth. To set up QoS you had to make static
address list of local IP addresses, keep track of Ip ranges used in your country and update address list
accordingly. Here you can find article describing mentioned approach.
With introduction of routing-table matcher it is possible to match packet which destination address
is resolved in specific routing table. So we just need BGP peering with ISP and ask them to send all
routes local to your country, add them to routing table and set up mangle rules accordingly.
Application Example
Consider following setup:
R1 is ISP router sending BGP routes R2 is client's main gateway and clients local network is 192.168.1.0/24
After setting up bgp peering (which is not covered in this article) we get following BGP routes
Next step is to add all received BGP rotues to another routing table, to do that we set up routing filters
As you can see now routes are added to "local" routing table
...
Mangle rule
Following mangle rule will match all packets that destination is resolved in "local" routing table.
Routing rules
Now when we try to send packets from the client for example to address 10.10.10.4, mangle rule will not
match anything. This is because by default every destination is resolved in "main" routing table.
To fix this we have to explicitly specify to resolve all packets coming from client in "local" routing table.
Conclusion
To verify if packets are actually matched:
As you can see from the logs only packets coming from the client are matched. The reason for this is because
routing-table matcher is matching only packet which destination address is resolved in local routing table.
In our example 192.168.1.10 as destination is resolved in "main" routing table.
From what was said above, this approach is useful only for upload traffic marking and shaping.