PCC setup for 3 WAN/PPoE (adsl) connections:
First set up route rules:
/ip route rule
add action=lookup comment="" disabled=no routing-mark=to_wlan1 table=to_wlan1
add action=lookup comment="" disabled=no routing-mark=to_wlan2 table=to_wlan2
add action=lookup comment="" disabled=no routing-mark=to_wlan3 table=to_wlan3
add action=lookup comment="" disabled=no dst-address=0.0.0.0/0 src-address=0.0.0.0/0 table=main
second, set up routing table with policy routing (routing marks needed from mangle)
/ip route
add comment="PRIMARY route for \"to_wlan1\" marked traffic (>ADSL1)" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-mark=to_wlan1 scope=30 target-scope=10
add check-gateway=ping comment="1st Backup route for \"to_wlan1\" marked traffic (>ADSL2)" disabled=no distance=2 dst-address=0.0.0.0/0 gateway=pppoe-out2 routing-mark=to_wlan1 scope=30 target-scope=10
add check-gateway=ping comment="2nd Backup route for \"to_wlan1\" marked traffic (>ADSL3)" disabled=no distance=3 dst-address=0.0.0.0/0 gateway=pppoe-out3 routing-mark=to_wlan1 scope=30 target-scope=10
add check-gateway=ping comment="PRIMARY route for \"to_wlan2\" marked traffic (>ADSL2)" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out2 routing-mark=to_wlan2 scope=30 target-scope=10
add check-gateway=ping comment="1st Backup route for \"to_wlan2\" marked traffic (>ADSL1)" disabled=no distance=2 dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-mark=to_wlan2 scope=30 target-scope=10
add check-gateway=ping comment="2nd Backup route for \"to_wlan2\" marked traffic (>ADSL3)" disabled=no distance=3 dst-address=0.0.0.0/0 gateway=pppoe-out3 routing-mark=to_wlan2 scope=30 target-scope=10
add comment="PRIMARY route for \"to_wlan3\" marked traffic (>ADSL3)" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out3 routing-mark=to_wlan3 scope=30 target-scope=10
add comment="1st Backup route for \"to_wlan3\" marked traffic (>ADSL2)" disabled=no distance=2 dst-address=0.0.0.0/0 gateway=pppoe-out2 routing-mark=to_wlan3 scope=30 target-scope=10
add comment="2nd Backup route for \"to_wlan3\" marked traffic (>ADSL1)" disabled=no distance=3 dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-mark=to_wlan3 scope=30 target-scope=10
Third, set up mangle:
A: Incoming traffic from WAN to the router needs to know what return gateway to use:
/ip firewall mangle
add action=mark-connection chain=input comment="Traffic fr router via interface WAN1 get conn mark \"wlan1_conn\"" disabled=no in-interface=WAN1 new-connection-mark=wlan1_conn passthrough=yes
add action=mark-connection chain=input comment="Traffic fr router via interface WAN2 get conn mark \"wlan2_conn\"" disabled=no in-interface=WAN2 new-connection-mark=wlan2_conn passthrough=yes
add action=mark-connection chain=input comment="Traffic fr router via interface WAN3 get conn mark \"wlan3_conn\"" disabled=no in-interface=WAN3 new-connection-mark=wlan3_conn passthrough=yes
B: Traffic leaving router with routing mark from incoming WAN interface get routing mark to route to that same interface again:
/ip firewall mangle
add action=mark-routing chain=output comment="" connection-mark=wlan1_conn disabled=no new-routing-mark=to_wlan1 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=wlan2_conn disabled=no new-routing-mark=to_wlan2 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=wlan3_conn disabled=no new-routing-mark=to_wlan3 passthrough=yes
C: PCC routing marker:
/ip firewall mangle
add action=mark-routing chain=prerouting comment="NEW! PCC Both 3/0" disabled=no dst-address-type=!local in-interface=Local new-routing-mark=to_wlan1 passthrough=yes per-connection-classifier=src-address:3/0
add action=mark-routing chain=prerouting comment="NEW! PCC Both 3/1" disabled=no dst-address-type=!local in-interface=Local new-routing-mark=to_wlan2 passthrough=yes per-connection-classifier=src-address:3/1
add action=mark-routing chain=prerouting comment="NEW! PCC Both 3/2" disabled=no dst-address-type=!local in-interface=Local new-routing-mark=to_wlan3 passthrough=yes per-connection-classifier=src-address:3/2
[I use routing marker since this router is also QoS and in forward chain is making connection marks followed by package markers. You can mark package only once. This way they don't interfere. (You can mark twice, but only last one then is valid)]
Fourth, set up NAT:
/ip firewall nat
add action=masquerade chain=srcnat comment="Traffic leaving WAN1 port (ADSL1) get WAN1 port IP address" disabled=no out-interface=pppoe-out1
add action=masquerade chain=srcnat comment="Traffic leaving WAN2 port (ADSL2) get WAN2 port IP address" disabled=no out-interface=pppoe-out2
add action=masquerade chain=srcnat comment="Traffic leaving WAN3 port (ADSL3) get WAN3 port IP address" disabled=no out-interface=pppoe-out3
One important remark I have to make here that has not so much to do with PCC but more with the PPoE interfaces (it took me days to find out!):
When the PPoe interface gets authenticated it dynamically places some MSS change rules in the forward chain of mangle. If you now at the same time already have static rules in forward chain build for proper working of router (Qos for instance) then these MSS change filter are not getting any traffic since proper mangle setup already arranged package to leave the router in previous static filters. This will make your interent connection very erratic and poor. So basically I copied these dynamic rules into static ones and put them in fron to all other forward chain filters. Now internet connectivity over PoE-adsl works fine.
Comments and or questions please!
If some guru's can agree or discuss on this setup, or after alteration, I might add this one to the WiKi manual for reference.