I'm trying to configure PCC load balancing on my v7 Mikrotik but no luck so far. there's barely any traffic that goes through WAN2 if no traffic at all! when I disable WAN1 the traffic starts to go through WAN2 normally.
WAN1 has a private static IP address with many public IP addresses to use, and WAN2 has a dynamic gateway, so I'm using DHCP-Client with a script to add PCC routes.
I used the configuration from this YouTube video from Mikrotik's official channel https://www.youtube.com/watch?v=nlb7XAv57tw&t=640s
Code: Select all
/routing table add name="to_WAN1" fib
/routing table add name="to_WAN2" fib
/ip firewall mangle
add action=mark-connection chain=prerouting connection-mark=no-mark \
connection-state=new in-interface=WAN1 new-connection-mark=\
WAN1_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
connection-state=new in-interface=WAN2 new-connection-mark=\
WAN2_conn passthrough=yes
add action=mark-routing chain=output connection-mark=WAN1_conn \
new-routing-mark=to_WAN1 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN2_conn \
new-routing-mark=to_WAN2 passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
connection-state=new dst-address-type=!local \
in-interface-list=LAN new-connection-mark=WAN1_conn passthrough=yes \
per-connection-classifier=both-addresses-and-ports:2/0 hotspot=auth
add action=mark-connection chain=prerouting connection-mark=no-mark \
connection-state=new dst-address-type=!local \
in-interface-list=LAN new-connection-mark=WAN2_conn passthrough=yes \
per-connection-classifier=both-addresses-and-ports:2/1 hotspot=auth
add action=mark-routing chain=prerouting connection-mark=WAN1_conn \
in-interface-list=LAN new-routing-mark=to_WAN1 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=WAN2_conn \
in-interface-list=LAN new-routing-mark=to_WAN2 passthrough=yes
/ip firewall nat
add action=src-nat chain=srcnat comment="Srcnat home to public ip" \
out-interface="WAN1" src-address-list=Home to-addresses=\
x.x.x.x
add action=src-nat chain=srcnat comment="Srcnat clients to WAN1 public ip" \
out-interface="WAN1" src-address-list=Clients to-addresses=\
x.x.x.x
add action=masquerade chain=srcnat out-interface=WAN2 comment="WAN2 masquerade"
/ip route
add check-gateway=ping routing-table="to_WAN1" gateway=x.x.x.x comment=WAN1
add check-gateway=ping distance=1 gateway=x.x.x.x comment=WAN1
/ip dhcp-client
add add-default-route=no interface=WAN2 script="{
:local rmark "WAN2"
:local count [/ip route print count-only where comment="WAN2"]
:if ($bound=1) do={
:if ($count = 0) do={
/ip route add check-gateway=ping routing-table="to_WAN2" gateway=$"gateway-address" comment=WAN2
/ip route add check-gateway=ping distance=2 gateway=$"gateway-address" comment=WAN2
} else={
:if ($count = 1) do={
:local test [/ip route find where comment="WAN2"]
:if ([/ip route get $test gateway] != $"gateway-address") do={
/ip route set $test gateway=$"gateway-address"
}
} else={
:error "Multiple routes found"
}
}
} else={
/ip route remove [find comment="WAN2"]
}
}" use-peer-dns=no use-peer-ntp=no
Any ideas what's wrong?