Hi guys, wondering if someone can give me any pointers on this…
I have a working PBR config based on address lists and Mangle: If the source address is from the list “Use-WAN1”, mark it with the appropriate connection mark. And vice-versa for WAN2.
However packets from addresses that are not part of either my “Use-WAN1” or “Use-WAN2” address lists are being marked with the WAN1 connection mark regardless. At first I assumed this was because WAN1 marking was higher in the mangle order so was getting marked with that first, but even if I swap the positions of rule 1 and 2 - I get the same WAN1 connection mark… Any ideas why packets that do not match either rule are being marked regardless?
Here is a print of my mangle rules:
0 ;;; Allow connected networks to exit Mangle chain so we don’t load balance to our connected networks
chain=prerouting action=accept dst-address-list=Local Networks in-interface-list=VLAN log=no log-prefix=“”
1 ;;; Sort the traffic into WAN1 stream
chain=prerouting action=mark-connection new-connection-mark=WAN1 passthrough=yes dst-address-type=!local src-address-list=Use-WAN1 connection-mark=no-mark
in-interface-list=VLAN log=yes log-prefix=“”
2 ;;; Sort the traffic into WAN2 stream
chain=prerouting action=mark-connection new-connection-mark=WAN2 passthrough=yes dst-address-type=!local src-address-list=Use-WAN2 connection-mark=no-mark
in-interface-list=VLAN log=yes log-prefix=“”
3 ;;; Add routing mark WAN1 to the packets based on the connection mark
chain=prerouting action=mark-routing new-routing-mark=Route-WAN1 passthrough=yes connection-mark=WAN1 in-interface-list=VLAN log=no log-prefix=“”
4 ;;; Add routing mark WAN2 to the packets based on the connection mark
chain=prerouting action=mark-routing new-routing-mark=Route-WAN2 passthrough=yes connection-mark=WAN2 in-interface-list=VLAN log=no log-prefix=“”
5 ;;; Ensure traffic from the router itself returns through the proper interface WAN1
chain=output action=mark-routing new-routing-mark=Route-WAN1 passthrough=yes connection-mark=WAN1 log=no log-prefix=“”
6 ;;; Ensure traffic from the router itself returns through the proper interface WAN2
chain=output action=mark-routing new-routing-mark=Route-WAN2 passthrough=yes connection-mark=WAN2 log=no log-prefix=“”
7 ;;; Identify which WAN interface the traffic came in and mark the connections appropriately WAN1
chain=prerouting action=mark-connection new-connection-mark=WAN1 passthrough=yes connection-mark=no-mark in-interface=WAN1 log=no log-prefix=“”
8 ;;; Identify which WAN interface the traffic came in and mark the connections appropriately WAN2
chain=prerouting action=mark-connection new-connection-mark=WAN2 passthrough=yes connection-mark=no-mark in-interface=WAN2 log=no log-prefix=“”
9 ;;; Mark “management” traffic from the router on WAN1
chain=output action=mark-routing new-routing-mark=Route-WAN1 passthrough=yes out-interface=WAN1 log=no log-prefix=“”
10 ;;; Mark “management” traffic from the router on WAN2
chain=output action=mark-routing new-routing-mark=Route-WAN2 passthrough=yes out-interface=WAN2 log=no log-prefix=“”