Route Chosen IPs/Customers Through a Chosen ISP (PBR)
Chosen customers, servers or networks always go out through the ISP you pick; the rest keep the main path.
Policy Based Routing with routing rules: chosen source addresses look up another table whose default route goes through the chosen ISP. Local destinations keep the main table so LAN-to-LAN traffic does not go through the ISP. On v6 the menu is /ip route rule and routes use routing-mark; on v7 the table is created in /routing table and rules live in /routing rule.
- A masquerade NAT for the chosen ISP's WAN must already exist (out-interface to that ISP), or customers get no internet through it.
- Rules are read from the top. If there are other rules (e.g. from another generator), keep the local rules above the PBR rules.
- Do not combine with PCC Load Balancing for the same IP: PCC sets a routing mark in mangle, which wins over routing rules. Leave that IP out of PCC's customer networks.
How to use: Copy the script, open Winbox → New Terminal, paste. Or Download .rsc, upload it in Files, then run /import file-name=routing-per-ip.rsc.
RouterOS v6 / v7 · added 11 November 2026
readyRouterOS v6 / v7
Terminal <routing-per-ip>
More in Routing & Failover