/ip firewall mangle
add action=mark-routing chain=prerouting disabled=no dst-address-list=\
sem-ballance new-routing-mark=sem-ballance passthrough=no
add action=accept chain=prerouting comment=\
"====================================================================" \
disabled=no dst-address=192.168.88.0/29 src-address=192.168.88.0/29
add action=accept chain=prerouting disabled=no dst-address=10.10.1.0/24 \
src-address=192.168.88.0/29
add action=accept chain=prerouting disabled=no dst-address=10.10.2.0/24 \
src-address=192.168.88.0/29
add action=mark-routing chain=prerouting comment="SEM BALLANCE" disabled=no \
dst-port=443 new-routing-mark=rota-segura passthrough=no protocol=tcp
add action=accept chain=prerouting disabled=no dst-address=10.10.3.0/24 \
src-address=192.168.88.0/29
add action=accept chain=prerouting disabled=no dst-address=10.10.4.0/24 \
src-address=192.168.88.0/29
add action=mark-connection chain=prerouting comment=\
"====================================================================" \
connection-mark=no-mark disabled=no in-interface=LINK1 new-connection-mark=\
LINK1_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark disabled=no \
in-interface=LINK2 new-connection-mark=LINK2_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark disabled=no \
in-interface=LINK3 new-connection-mark=LINK3_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark disabled=no \
in-interface=LINK4 new-connection-mark=LINK4_conn passthrough=yes
add action=jump chain=prerouting comment=\
"====================================================================" \
connection-mark=no-mark disabled=no in-interface=LOCAL jump-target=\
policy_router
add action=mark-routing chain=prerouting comment=\
"====================================================================" \
connection-mark=LINK1_conn disabled=no new-routing-mark=LINK1_trafic \
passthrough=yes src-address=192.168.88.0/29
add action=mark-routing chain=prerouting connection-mark=LINK2_conn disabled=no \
new-routing-mark=LINK2_trafic passthrough=yes src-address=192.168.88.0/29
add action=mark-routing chain=prerouting connection-mark=LINK4_conn disabled=no \
new-routing-mark=LINK4_trafic passthrough=yes src-address=192.168.88.0/29
add action=mark-routing chain=prerouting connection-mark=LINK3_conn disabled=no \
new-routing-mark=LINK3_trafic passthrough=yes src-address=192.168.88.0/29
add action=mark-routing chain=output comment=\
"====================================================================" \
connection-mark=LINK1_conn disabled=no new-routing-mark=LINK1_trafic \
passthrough=yes
add action=mark-routing chain=output connection-mark=LINK2_conn disabled=no \
new-routing-mark=LINK2_trafic passthrough=yes
add action=mark-routing chain=output connection-mark=LINK3_conn disabled=no \
new-routing-mark=LINK3_trafic passthrough=yes
add action=mark-routing chain=output connection-mark=LINK4_conn disabled=no \
new-routing-mark=LINK4_trafic passthrough=yes
add action=mark-connection chain=policy_router comment=\
"====================================================================" \
disabled=no dst-address-type=!local new-connection-mark=LINK1_conn \
passthrough=yes per-connection-classifier=both-addresses:4/0
add action=mark-connection chain=policy_router disabled=no dst-address-type=\
!local new-connection-mark=LINK2_conn passthrough=yes \
per-connection-classifier=both-addresses:4/1
add action=mark-connection chain=policy_router disabled=no dst-address-type=\
!local new-connection-mark=LINK3_conn passthrough=yes \
per-connection-classifier=both-addresses:4/2
add action=mark-connection chain=policy_router disabled=no dst-address-type=\
!local new-connection-mark=LINK4_conn passthrough=yes \
per-connection-classifier=both-addresses:4/3