Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /ip route add check-gateway=ping comment="For recursion via ISP2" distance=1 dst-address=4.2.2.2/32 gateway=$"remote-address" scope=10
- /ip route add check-gateway=ping comment="Unmarked via ISP2" distance=2 gateway=4.2.2.2;
- /ip route add comment="Marked via ISP2 Main" distance=1 gateway=4.2.2.2 routing-mark=to_isp2;
- /ip route add comment="Marked via ISP1 Backup1" distance=2 gateway=4.2.2.2 routing-mark=to_isp1;
- /ip firewall mangle set [find comment="Connmark in from ISP2"] in-interface=$"interface";
- /ip firewall nat add action=src-nat chain=srcnat ipsec-policy=out,none out-interface=$"interface" to-addresses=$"local-address" comment="NAT via ISP2" place-before=1;
- if ([/ip route rule find comment="From ISP2 IP to Inet"] ="") do={
- /ip route rule add comment="From ISP2 IP to Inet" src-address=$"local-address" table=to_isp2
- } else={
- /ip route rule set [find comment="From ISP2 IP to Inet"] disabled=no src-address=$"local-address"
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement