Advertisement
Guest User

Untitled

a guest
Feb 6th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1.  
  2. /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
  3. /ip route add check-gateway=ping comment="Unmarked via ISP2" distance=2 gateway=4.2.2.2;
  4. /ip route add comment="Marked via ISP2 Main" distance=1 gateway=4.2.2.2 routing-mark=to_isp2;
  5. /ip route add comment="Marked via ISP1 Backup1" distance=2 gateway=4.2.2.2 routing-mark=to_isp1;
  6. /ip firewall mangle set [find comment="Connmark in from ISP2"] in-interface=$"interface";
  7. /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;
  8. if ([/ip route rule find comment="From ISP2 IP to Inet"] ="") do={
  9. /ip route rule add comment="From ISP2 IP to Inet" src-address=$"local-address" table=to_isp2
  10. } else={
  11. /ip route rule set [find comment="From ISP2 IP to Inet"] disabled=no src-address=$"local-address"
  12. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement