Quantcast
Channel: MikroTik
Viewing all articles
Browse latest Browse all 23620

General • Routing a group of internal IPs through specific ISP

$
0
0
Hello!

I have two ISPs with basic redundancy set up, using "distance" property, so all of the packets are going either through ISP1 or ISP2, depending on which one is reachable.
However, I would like for some devices' data to forcefully go via my secondary ISP, no matter what.
How should I proceed?

Thanks in advance!
Code:
/ip firewall mangleadd action=mark-connection chain=input comment="ISP 1" dst-address=[ISP1_IP] \    in-interface=WAN1 new-connection-mark=ISP1-in passthrough=noadd action=mark-connection chain=input comment="ISP 2" dst-address=[ISP2_IP] \    in-interface=WAN2 new-connection-mark=ISP2-in passthrough=noadd action=mark-routing chain=output comment="ISP 1" connection-mark=ISP1-in \    new-routing-mark=ISP1 passthrough=noadd action=mark-routing chain=output comment="ISP 2" connection-mark=ISP2-in \    new-routing-mark=ISP2 passthrough=no/ip firewall natadd action=masquerade chain=srcnat comment="ISP 1 NAT" out-interface=WAN1add action=masquerade chain=srcnat comment="ISP 2 NAT" out-interface=WAN2/ip routeadd comment="ISP1 Routing Mark" distance=1 gateway=[ISP1_GW] routing-mark=\    ISP1add comment="ISP2 Routing Mark" distance=1 gateway=[ISP1_GW] routing-mark=\    ISP2add check-gateway=ping comment=ISP1Route distance=1 gateway=[ISP1_GW]add check-gateway=ping comment=ISP2Route distance=2 gateway=[ISP1_GW]

Statistics: Posted by MarcSutton — Wed Jan 15, 2025 11:04 am



Viewing all articles
Browse latest Browse all 23620

Trending Articles