Config generators

MikroTik load balancing generator

Dual-uplink load balancing or failover config for RouterOS 7.

Result
70% / 30% Traffic split
/routing table add name=to-wan1 fib
/routing table add name=to-wan2 fib
/ip firewall address-list add list=lan address=192.168.88.0/24
/ip firewall mangle
add chain=prerouting in-interface=ether1 connection-mark=no-mark action=mark-connection new-connection-mark=wan1-conn passthrough=yes
add chain=prerouting in-interface=ether2 connection-mark=no-mark action=mark-connection new-connection-mark=wan2-conn passthrough=yes
add chain=prerouting src-address-list=lan dst-address-type=!local connection-mark=no-mark per-connection-classifier=both-addresses:10/0 action=mark-connection new-connection-mark=wan1-conn passthrough=yes
add chain=prerouting src-address-list=lan dst-address-type=!local connection-mark=no-mark per-connection-classifier=both-addresses:10/1 action=mark-connection new-connection-mark=wan1-conn passthrough=yes
add chain=prerouting src-address-list=lan dst-address-type=!local connection-mark=no-mark per-connection-classifier=both-addresses:10/2 action=mark-connection new-connection-mark=wan1-conn passthrough=yes
add chain=prerouting src-address-list=lan dst-address-type=!local connection-mark=no-mark per-connection-classifier=both-addresses:10/3 action=mark-connection new-connection-mark=wan1-conn passthrough=yes
add chain=prerouting src-address-list=lan dst-address-type=!local connection-mark=no-mark per-connection-classifier=both-addresses:10/4 action=mark-connection new-connection-mark=wan1-conn passthrough=yes
add chain=prerouting src-address-list=lan dst-address-type=!local connection-mark=no-mark per-connection-classifier=both-addresses:10/5 action=mark-connection new-connection-mark=wan1-conn passthrough=yes
add chain=prerouting src-address-list=lan dst-address-type=!local connection-mark=no-mark per-connection-classifier=both-addresses:10/6 action=mark-connection new-connection-mark=wan1-conn passthrough=yes
add chain=prerouting src-address-list=lan dst-address-type=!local connection-mark=no-mark per-connection-classifier=both-addresses:10/7 action=mark-connection new-connection-mark=wan2-conn passthrough=yes
add chain=prerouting src-address-list=lan dst-address-type=!local connection-mark=no-mark per-connection-classifier=both-addresses:10/8 action=mark-connection new-connection-mark=wan2-conn passthrough=yes
add chain=prerouting src-address-list=lan dst-address-type=!local connection-mark=no-mark per-connection-classifier=both-addresses:10/9 action=mark-connection new-connection-mark=wan2-conn passthrough=yes
add chain=prerouting src-address-list=lan connection-mark=wan1-conn action=mark-routing new-routing-mark=to-wan1 passthrough=no
add chain=output connection-mark=wan1-conn action=mark-routing new-routing-mark=to-wan1 passthrough=no
add chain=prerouting src-address-list=lan connection-mark=wan2-conn action=mark-routing new-routing-mark=to-wan2 passthrough=no
add chain=output connection-mark=wan2-conn action=mark-routing new-routing-mark=to-wan2 passthrough=no
/ip route
add dst-address=0.0.0.0/0 gateway=192.0.2.1 routing-table=to-wan1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.0.2.1 distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=198.51.100.1 routing-table=to-wan2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=198.51.100.1 distance=2 check-gateway=ping
/ip firewall nat
add chain=srcnat out-interface=ether1 action=masquerade
add chain=srcnat out-interface=ether2 action=masquerade

Written for RouterOS 7. Remove existing default routes first, and apply it from the console, not over the link you are changing.

Get started

Helping ISPs scale operations

Join thousands of satisfied customers who have transformed their billing and network operations with ISPman. Our platform is designed to help you scale your business efficiently and effectively — streamline your processes and enhance your customer experience.

No setup fees Migration support included Cancel anytime

Live in a weekend

Guided onboarding

Support that answers

Real engineers, same day

Bring your own gear

MikroTik, Ruijie, OLTs