❤❤❤❤Mikrotik Script 11: Recursive gateway failover script just copy and paste ❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤

Wed, 22 Jan 2025 18:04:46 +0000

⁣/interface ethernet
set [ find default-name=ether1 ] name=WAN1
set [ find default-name=ether2 ] name=WAN2

/ip pool
add name=ISP1 ranges=192.168.88.2-192.168.88.254
add name=ISP2 ranges=192.168.98.2-192.168.98.254
/ppp profile
set *0 local-address=192.168.88.1 remote-address=ISP1
add local-address=192.168.88.1 name=10Mb-ISP1 only-one=yes rate-limit=10M/10M \
remote-address=ISP1
add local-address=192.168.88.1 name=10Mb-ISP2 only-one=yes rate-limit=10M/10M \
remote-address=ISP2
add local-address=192.168.88.1 name=20Mb-ISP1 only-one=yes rate-limit=20M/20M \
remote-address=ISP1
add local-address=192.168.88.1 name=20Mb-IPS2 only-one=yes rate-limit=20M/20M \
remote-address=ISP2
add local-address=192.168.88.1 name=30Mb-ISP1 only-one=yes rate-limit=30M/30M \
remote-address=ISP1
add local-address=192.168.88.1 name=30Mb-ISP2 only-one=yes rate-limit=30M/30M \
remote-address=ISP2

/interface pppoe-server server
add authentication=pap disabled=no interface=ether5 one-session-per-host=yes \
service-name=service1
/ip address
add address=192.168.10.10/24 interface=WAN1 network=192.168.10.0
add address=192.168.0.183/24 interface=WAN2 network=192.168.0.0
add address=192.168.88.1/24 interface=ether5 network=192.168.88.0
/ip dns
set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4
/ip firewall address-list
add address=192.168.88.2-192.168.88.254 list=ISP1
add address=192.168.98.2-192.168.98.254 list=ISP2
/ip firewall mangle
add action=mark-routing chain=prerouting new-routing-mark=to_ISP1 \
passthrough=yes src-address-list=ISP1
add action=mark-routing chain=prerouting new-routing-mark=to_ISP2 \
passthrough=yes src-address-list=ISP2
/ip firewall nat
add action=masquerade chain=srcnat src-address-list=ISP1
add action=masquerade chain=srcnat src-address-list=ISP2
/ip route
add distance=1 gateway=10.1.1.1 routing-mark=to_ISP1 scope=20
add distance=2 gateway=1.1.1.1 routing-mark=to_ISP1 scope=20 target-scope=20
add distance=1 gateway=1.1.1.1 routing-mark=to_ISP2 scope=20 target-scope=20
add distance=2 gateway=10.1.1.1 routing-mark=to_ISP2
add distance=1 gateway=10.1.1.1
add check-gateway=ping distance=1 dst-address=1.1.1.1/32 gateway=8.8.4.4 \
scope=20 target-scope=20
add distance=1 dst-address=8.8.4.4/32 gateway=192.168.0.1 scope=20 \
target-scope=20
add distance=1 dst-address=8.8.8.8/32 gateway=192.168.10.1 scope=10
add check-gateway=ping distance=1 dst-address=10.1.1.1/32 gateway=8.8.8.8 \
scope=10

/ppp secret
add name=1122 password=1122 profile=20Mb-IPS2 service=pppoe