/ip address
add address=
172.72.1.1/30 interface=ether12 network=172.72.1.0
add address=
192.168.1.2/24 comment=Shatel-I interface=ether1 network=\
192.168.1.0
add address=
192.168.2.2/24 comment=Shatel-Il interface=ether2 network=\
192.168.2.0
add address=
192.168.3.2/24 comment=datak-l interface=ether3 network=\
192.168.3.0
ip firewall mangle
add action=mark-routing chain=prerouting dst-port=443 new-routing-mark=HTTPS \
passthrough=no protocol=tcp
add chain=prerouting dst-address-list=local src-address-list=local
add action=mark-connection chain=forward connection-mark=no-mark \
in-interface=Shatel-I new-connection-mark=ISP1_conn passthrough=no
add action=mark-connection chain=forward connection-mark=no-mark \
in-interface=Shatel-ll new-connection-mark=ISP2_conn passthrough=no
add action=mark-connection chain=forward connection-mark=no-mark \
in-interface=Shatel-lll new-connection-mark=ISP3_conn passthrough=no
add action=mark-connection chain=forward connection-mark=no-mark \
in-interface=ether4 new-connection-mark=ISP4_conn
add action=mark-connection chain=prerouting connection-mark=no-mark \
in-interface=Shatel-I new-connection-mark=ISP1_conn
add action=mark-connection chain=prerouting connection-mark=no-mark \
in-interface=Shatel-ll new-connection-mark=ISP2_conn
add action=mark-connection chain=prerouting connection-mark=no-mark \
in-interface=Shatel-lll new-connection-mark=ISP3_conn
add action=mark-connection chain=prerouting connection-mark=no-mark \
in-interface=ether4 new-connection-mark=ISP4_conn
add action=jump chain=prerouting connection-mark=no-mark in-interface=ether12 \
jump-target=policy_routing src-address-list=local
add action=mark-routing chain=prerouting connection-mark=ISP1_conn \
new-routing-mark=ISP1_traffic src-address-list=local
add action=mark-routing chain=prerouting connection-mark=ISP2_conn \
new-routing-mark=ISP2_traffic src-address-list=local
add action=mark-routing chain=prerouting connection-mark=ISP3_conn \
new-routing-mark=ISP3_traffic src-address-list=local
add action=mark-routing chain=prerouting connection-mark=ISP4_conn \
new-routing-mark=ISP4_traffic src-address-list=local
add action=mark-routing chain=output connection-mark=ISP1_conn \
new-routing-mark=ISP1_traffic
add action=mark-routing chain=output connection-mark=ISP2_conn \
new-routing-mark=ISP2_traffic
add action=mark-routing chain=output connection-mark=ISP3_conn \
new-routing-mark=ISP3_traffic
add action=mark-routing chain=output connection-mark=ISP4_conn \
new-routing-mark=ISP4_traffic
add action=mark-connection chain=policy_routing dst-address-type=!local \
new-connection-mark=ISP1_conn per-connection-classifier=src-address:4/0
add action=mark-connection chain=policy_routing dst-address-type=!local \
new-connection-mark=ISP3_conn per-connection-classifier=src-address:4/1
add action=mark-connection chain=policy_routing dst-address-type=!local \
new-connection-mark=ISP2_conn per-connection-classifier=src-address:4/2
add action=mark-connection chain=policy_routing dst-address-type=!local \
new-connection-mark=ISP4_conn per-connection-classifier=src-address:4/3
/ip route
add check-gateway=arp distance=1 gateway=Shatel-I routing-mark=Javad
add check-gateway=arp distance=7 gateway=Shatel-I routing-mark=HTTPS
add check-gateway=arp distance=8 gateway=Shatel-ll routing-mark=HTTPS
add check-gateway=arp distance=9 gateway=Shatel-lll routing-mark=HTTPS
add check-gateway=arp distance=10 gateway=*1D routing-mark=HTTPS
add check-gateway=arp distance=1 gateway=Shatel-I routing-mark=ISP1_traffic
add check-gateway=arp distance=1 gateway=Shatel-ll routing-mark=ISP2_traffic
add check-gateway=arp distance=1 gateway=Shatel-lll routing-mark=ISP3_traffic
add check-gateway=arp distance=1 gateway=ether4 routing-mark=ISP4_traffic
add check-gateway=arp distance=1 gateway=Shatel-lll routing-mark=rs
add check-gateway=arp distance=3 gateway=Shatel-ll
add check-gateway=arp distance=4 gateway=Shatel-lll
add check-gateway=arp distance=6 gateway=Shatel-I
add check-gateway=arp disabled=yes distance=5 gateway=*1D
add check-gateway=ping distance=1 dst-address=
4.2.2.2/32 gateway=Shatel-ll
add check-gateway=ping distance=1 dst-address=
4.2.2.3/32 gateway=Shatel-ll
add check-gateway=ping distance=1 dst-address=
4.2.2.4/32 gateway=Shatel-lll
add check-gateway=ping distance=1 dst-address=
4.2.2.5/32 gateway=Shatel-lll
add distance=1 dst-address=
10.10.0.0/16 gateway=172.72.1.2
add distance=1 dst-address=
172.0.0.0/8 gateway=172.72.1.2
/ip firewall nat
add action=masquerade chain=srcnat out-interface=Shatel-I src-address-list=\
local
add action=masquerade chain=srcnat out-interface=Shatel-ll src-address-list=\
local
add action=masquerade chain=srcnat out-interface=Shatel-lll src-address-list=\
local
add action=masquerade chain=srcnat out-interface=ether4 src-address-list=\
local
/tool netwatch
add down-script="tool netwatch set disabled=no [find host=\"4.2.2.3\"]" host=\
4.2.2.2 interval=10s up-script="tool netwatch set disabled=yes [find host=\
\"4.2.2.3\"]\r\
\ndelay 500ms\r\
\nip route set disabled=no [find gateway \"Shatel-II\"]"
add disabled=yes down-script=\
"ip route set disabled=yes [find gateway=\"Shatel-II\"]" host=4.2.2.3 \
interval=10s up-script=\
"ip route set disabled=no [find gateway=\"Shatel-II\"]"
add down-script="tool netwatch set disabled=no [find host=\"4.2.2.5\"]" host=\
4.2.2.4 interval=10s up-script="tool netwatch set disabled=yes [find host=\
\"4.2.2.5\"]\r\
\ndelay 500ms\r\
\nip route set disabled=no [find gateway=\"Shatel-III\"]"
add disabled=yes down-script=\
"ip route set disabled=yes [find gateway=\"Shatel-III\"]" host=4.2.2.5 \
interval=10s up-script=\
"ip route set disabled=no [find gateway=\"Shatel-III\"]"
/interface ethernet
...
/interface pppoe-client
add disabled=no interface=ether1 max-mru=1480 max-mtu=1480 name=Shatel-I \
password="xxxx" user=xxxx
add disabled=no interface=ether2 max-mru=1480 max-mtu=1480 name=Shatel-ll \
password=xxxx user=xxxx
add disabled=no interface=ether3 max-mru=1480 max-mtu=1480 name=Shatel-lll \
password=xxxx user=xxxx