I have mikrotik connected to filials through ipsec site to site esp tunnels. Router has 2 ISPs both has static white ips. ISP1 is main ISP2 is reserve.
Routes
add check-gateway=ping comment="Infocom Mark" disabled=no distance=1 \
dst-address=0.0.0.0/0 gateway=ISP1GW pref-src=0.0.0.0 \
routing-table=Infocom scope=30 suppress-hw-offload=no target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
ISP1 pref-src="" routing-table=main scope=30 suppress-hw-offload=\
no target-scope=10
add check-gateway=ping comment="DCTel Mark" disabled=no distance=1 \
dst-address=0.0.0.0/0 gateway=ISP2 pref-src=0.0.0.0 \
routing-table=DCTel scope=30 suppress-hw-offload=no target-scope=10
add check-gateway=ping disabled=no distance=2 dst-address=0.0.0.0/0 gateway=\
ISP2 pref-src=0.0.0.0 routing-table=main scope=30 \
suppress-hw-offload=no target-scope=10
I am using ipsec policies whith 2 active peers(both my ISPs) for failover.
/ip ipsec policy
add dst-address=192.168.11.0/24 peer=co_infocom-infocom,co_dctel-dctel \
proposal=ikev2_site-to-site_proposal src-address=192.168.1.0/24 tunnel=\
yes
add dst-address=192.168.4.0/24 peer=step_infocom-infocom,step_dctel-dctel \
proposal=ikev2_site-to-site_proposal src-address=192.168.1.0/24 tunnel=\
yes
I and using mangle for Active DualWan.
This is working variant. Found Experimentaly
/ip firewall mangle
add action=mark-connection chain=input comment="Connmark in from Infocom" \
connection-mark=no-mark in-interface=ether1-vib-Infocom \
new-connection-mark=INFOCOM-conn passthrough=no
add action=mark-connection chain=input comment="Connmark in from DCTel" \
connection-mark=no-mark in-interface=ether2-vib-DCTel \
new-connection-mark=DCTEL-conn passthrough=no
add action=mark-connection chain=forward comment=\
"Connmark forward from Infocom" connection-mark=no-mark in-interface=\
ether1-vib-Infocom new-connection-mark=INFOCOM-conn-f passthrough=no
add action=mark-connection chain=forward comment=\
"Connmark forward from DCTel" connection-mark=no-mark in-interface=\
ether2-vib-DCTel new-connection-mark=DCTEL-conn-f passthrough=no
add action=mark-routing chain=output comment=\
"Route marked local out via Infocom" connection-mark=INFOCOM-conn \
dst-address-type=!local new-routing-mark=Infocom passthrough=no
add action=mark-routing chain=output comment=\
"Route marked local out via DCTel" connection-mark=DCTEL-conn \
dst-address-type=!local new-routing-mark=DCTel passthrough=no
add action=mark-routing chain=prerouting comment=\
"Route marked transit out via Infocom" connection-mark=INFOCOM-conn-f \
dst-address-type=!local in-interface-list=!WAN new-routing-mark=Infocom \
passthrough=no
add action=mark-routing chain=prerouting comment=\
"Route marked transit out via DCTel" connection-mark=DCTEL-conn-f \
dst-address-type=!local in-interface-list=!WAN new-routing-mark=DCTel \
passthrough=no
But I cant understand why classic variant not working(marking all packets in prerouting chain). I can ping and access other filials they can ping me but opening ports just hangs from filial to center.
/ip firewall mangle
add action=mark-connection chain=prerouting comment="Connmark in from Infocom" \
connection-mark=no-mark in-interface=ether1-vib-Infocom \
new-connection-mark=INFOCOM-conn passthrough=no
add action=mark-connection chain=prerouting comment="Connmark in from DCTel" \
connection-mark=no-mark in-interface=ether2-vib-DCTel \
new-connection-mark=DCTEL-conn passthrough=no
add action=mark-routing chain=output comment=\
"Route marked local out via Infocom" connection-mark=INFOCOM-conn \
dst-address-type=!local new-routing-mark=Infocom passthrough=no
add action=mark-routing chain=output comment=\
"Route marked local out via DCTel" connection-mark=DCTEL-conn \
dst-address-type=!local new-routing-mark=DCTel passthrough=no
add action=mark-routing chain=prerouting comment=\
"Route marked transit out via Infocom" connection-mark=INFOCOM-conn \
dst-address-type=!local in-interface-list=!WAN new-routing-mark=Infocom \
passthrough=no
add action=mark-routing chain=prerouting comment=\
"Route marked transit out via DCTel" connection-mark=DCTEL-conn \
dst-address-type=!local in-interface-list=!WAN new-routing-mark=DCTel \
passthrough=no