pcc + failover routeros 7

Hello guys i follow the steps to do the pcc banlanced , i share the configuration for failover on pcc, i hope the next configuration help you, if you have any idea for a better configuration please share!

_### the ip on interface for wan1 and wan2
/ip address
add address=192.168.0.197/24 network=192.168.0.0 broadcast=192.168.0.255 interface=wan1
add address=192.168.70.197/24 network=192.168.70.0 broadcast=192.168.70.255 interface=wan2

##creating routing tables
/routing/table
add fib name=to_ISP1
add fib name=to_ISP2

###rules in magle for balance with pcc
/ip firewall mangle
add chain=prerouting dst-address=192.168.0.0/24 action=accept in-interface=lan
add chain=prerouting dst-address=192.168.70.0/24 action=accept in-interface=lan

add chain=prerouting in-interface=wan1 connection-mark=no-mark action=mark-connection new-connection-mark=ISP1_conn
add chain=prerouting in-interface=wan2 connection-mark=no-mark action=mark-connection new-connection-mark=ISP2_conn

add chain=prerouting in-interface=lan connection-mark=no-mark dst-address-type=!local per-connection-classifier=both-addresses:2/0 action=mark-connection new-connection-mark=ISP1_conn
add chain=prerouting in-interface=lan connection-mark=no-mark dst-address-type=!local per-connection-classifier=both-addresses:2/1 action=mark-connection new-connection-mark=ISP2_conn

add chain=prerouting connection-mark=ISP1_conn in-interface=lan action=mark-routing new-routing-mark=to_ISP1
add chain=prerouting connection-mark=ISP2_conn in-interface=lan action=mark-routing new-routing-mark=to_ISP2
add chain=output connection-mark=ISP1_conn action=mark-routing new-routing-mark=to_ISP1
add chain=output connection-mark=ISP2_conn action=mark-routing new-routing-mark=to_ISP2

/ip firewall nat
add chain=srcnat out-interface=wan1 action=masquerade
add chain=srcnat out-interface=wan2 action=masquerade
\

Routes for failover

/ip/route/
add dst-address=8.8.8.8 scope=10 gateway=192.168.0.1
add dst-address=8.8.4.4 scope=10 gateway=192.168.70.1

add distance=1 gateway=8.8.8.8 routing-table=to_ISP1 check-gateway=ping
add distance=2 gateway=8.8.4.4 routing-table=to_ISP1 check-gateway=ping

add distance=1 gateway=8.8.4.4 routing-table=to_ISP2 check-gateway=ping
add distance=2 gateway=8.8.8.8 routing-table=to_ISP2 check-gateway=ping

add distance=1 gateway=192.168.0.1 routing-table=to_ISP1
add distance=2 gateway=192.168.70.1 routing-table=to_ISP1
add distance=1 gateway=192.168.70.1 routing-table=to_ISP2
add distance=2 gateway=192.168.0.1 routing-table=to_ISP2

##mikrotik go to internet
/ip/route
add distance=1 gateway=192.168.0.1
add distance=2 gateway=192.168.70.1_

Documentation:
pcc:

failover:

Hi
aarntesia
Hope you having a good day

Thanks it really help me fix my config.

appreciate

Best regards

Thanks a lot for sharing the configuration example :slight_smile:
PCC works perfectly, but the Failover part needs a little more detail to make it work correctly

add distance=1 gateway=8.8.8.8 routing-table=to_ISP1 scope=10 target-scope=11 check-gateway=ping
add distance=2 gateway=8.8.4.4 routing-table=to_ISP1 scope=10 target-scope=11 check-gateway=ping

add distance=1 gateway=8.8.4.4 routing-table=to_ISP2 scope=10 target-scope=11 check-gateway=ping
add distance=2 gateway=8.8.8.8 routing-table=to_ISP2 scope=10 target-scope=11 check-gateway=ping

I have made little modification to work with one PPPOE (static IP) and eth2 (static IP)
It ,ork very nice.
But when both Wan eth are enabled, Winbox is stay in status logging. if disabled one of them, Winbox and http and router start working .
If both Wan are enabled there is no connection to router outside. Winbox stay in status Logging and http does not work. ?

You can not use 8.8.8.8 and 8.8.4.4 as recursive route with different ISP routing tables, it only has one destination and it’s have match ISP1 OR ISP2…