MikroTik Route Filter Generator

Build RouterOS v7 routing filters for BGP, OSPF and RIP from templates, then copy the commands to your router.

What it does

The commands are built in your browser. Your values are not sent to a server or saved. It does not connect to your router, so you stay in control of what runs. IPv4 only for now.

Examples

BGP: advertise only your own subnet

/routing/filter/rule/add chain=bgp-out comment="route-filter-generator" rule="if (dst in 203.0.113.0/24) {accept}"
/routing/bgp/connection/set [find name="upstream"] output.filter-chain=bgp-out

OSPF: redistribute only selected static routes

/routing/filter/rule/add chain=ospf-out comment="route-filter-generator" rule="if (protocol static && dst in 192.168.0.0/16) {accept}"
/routing/ospf/instance/set [find name="default"] out-filter-chain=ospf-out redistribute=static

RouterOS rejects any route a chain does not accept. A BGP connection with no output chain tries to advertise every active route it can find.

Generator

Please complete the check below to open the generator.