This is an old revision of the document!
PCC Load Balancer on RouterOS v7
- On this example here is the case:
- Eth1 connect to ISP1 (192.168.0.2/24)
- Eth2 connect to ISP2 (192.168.1.2/24)
- Eth3 connect to Local Network (10.1.1.1/24)
- First, set the IP addresses:
- If using DHCP, add them on IP > DHCP Client
- If set as static, IP > Address List
- Next, add the firewall rule:
- 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 Connection Mark: no-mark on tab Action: Action: mark connection New Connection Mark: ISP1 Click OK
Add (+) on tab General: Chain: prerouting In Interface: ether2 Connection Mark: no-mark on tab Action: Action: mark connection New Connection Mark: ISP2 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 Extra: Dst Address Type: ! local 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 Extra: Dst Address Type: ! local on tab Action: Action: mark connection New Connection Mark: ISP2 Passthrough (checked) Click OK
- Create the Routing Table, on Routing > Tables:
Add (+) Name: to-ISP1 FIB (checked)
Add (+) Name: to-ISP2 FIB (checked)
- 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 Output Chain, on IP > Routes:
Add (+) Dst Address: 0.0.0.0/0 Gateway: 192.168.0.1 Routing table: to-ISP1 Click Apply, OK
Add (+) Dst Address: 0.0.0.0/0 Gateway: 192.168.1.1 Routing table: to-ISP2 Click Apply, OK
