PCC Load Balancer on RouterOS v6

  • On this example here is the case:
  1. Eth1 connect to ISP1 (192.168.0.2/24)
  2. Eth2 connect to ISP2 (192.168.1.2/24)
  3. Eth3 connect to Local Network (10.1.1.1/24)
  • First, set the IP addresses:
  1. If using DHCP, add them on IP > DHCP Client
  2. If set as static, IP > Address List
  • Next, add the firewall rule:
  1. Click on IP > Firewall > tab NAT
Add (+)
on tab General:
Chain: srcnat
Out Interface: ether1
on tab Action:
Action: masquerade
Click OK

Add (+)
on tab General:
Chain: srcnat
Out Interface: ether2
on tab Action:
Action: masquerade
Click OK
  • Set DHCP Server for the Local network.
  • Accept the connection, IP > Firewall > tab Mangle:
Add (+)
on tab General:
Chain: prerouting
Dst Address: 192.168.1.0/24 (The IP of ISP1)
on tab Action:
Action: accept
Click OK
Add (+)
on tab General:
Chain: prerouting
Dst Address: 192.168.1.1/24 (The IP of ISP2)
on tab Action:
Action: accept
Click OK
Add (+)
on tab General:
Chain: prerouting
Dst Address: 10.1.1.0/24 (The Local Network)
on tab Action:
Action: accept
Click OK
  • Mark the connection, IP > Firewall > tab Mangle:
Add (+)
on tab General:
Chain: prerouting
In Interface: ether1
on tab Action:
Action: mark connection
New Connection Mark: ISP1
Passthrough (checked)
Click OK
Add (+)
on tab General:
Chain: prerouting
In Interface: ether2
on tab Action:
Action: mark connection
New Connection Mark: ISP2
Passthrough (checked)
Click OK
  • Set the PCC, on IP > Firewall > tab Mangle:
Add (+)
on tab General:
Chain: prerouting
In Interface: ether3
Connection Mark: ISP1
on tab Advance:
Per Connection Classifier: both addresses | 2 / 0
on tab Action:
Action: mark connection
New Connection Mark: ISP1
Passthrough (checked)
Click OK

Add (+)
on tab General:
Chain: prerouting
In Interface: ether3
Connection Mark: ISP2
on tab Advance:
Per Connection Classifier: both addresses | 2 / 1
on tab Action:
Action: mark connection
New Connection Mark: ISP2
Passthrough (checked)
Click OK
  • Set the PCC Mark Routing, on IP > Firewall > tab Mangle:
Add (+)
on tab General:
Chain: prerouting
In Interface: ether3
Connection Mark: ISP1
on tab Action:
Action: mark routing
New Routing Mark: to-ISP1
Passthrough (unchecked)
Click OK
Add (+)
on tab General:
Chain: prerouting
In Interface: ether3
Connection Mark: ISP2
on tab Action:
Action: mark routing
New Routing Mark: to-ISP2
Passthrough (unchecked)
Click OK
  • Set the Output Chain, on IP > Firewall > tab Mangle:
Add (+)
on tab General:
Chain: output
Connection Mark: ISP1
on tab Action:
Action: mark routing
New Routing Mark: to-ISP1
Passthrough (unchecked)
Click OK
Add (+)
on tab General:
Chain: output
Connection Mark: ISP2
on tab Action:
Action: mark routing
New Routing Mark: to-ISP2
Passthrough (unchecked)
Click OK
  • Set the Route, on IP > Route:
Add (+)
Dst Address: 0.0.0.0/0
Gateway: 192.168.0.1
Check Gateway: ping
Routing Mark: to-ISP1
Click Apply, OK
Add (+)
Dst Address: 0.0.0.0/0
Gateway: 192.168.1.1
Check Gateway: ping
Routing Mark: to-ISP2
Click Apply, OK
  • Set the Failover Route, on IP > Route:
Add (+)
Dst Address: 0.0.0.0/0
Gateway: 192.168.1.1
Distance: 2
Check Gateway: ping
Routing Mark: to-ISP1
Click Apply, OK

Add (+)
Dst Address: 0.0.0.0/0
Gateway: 192.168.0.1
Distance: 2
Check Gateway: ping
Routing Mark: to-ISP2
Click Apply, OK
Edit this page