Với script sau đây: tính năng kiểm tra Internet tự động trên Router Mikrotik – giúp tự động kiểm tra tình trạng kết nối Internet và giải quyết sớm những vấn đề kết nối của bạn.
/system scriptadd name="Auto-Reconnect-PPPoE" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitivesource={:local down1 (ping 8.8.8.8 count=3 interface=pppoe-out1):local down2 (ping 8.8.8.8 count=3 interface=pppoe-out2):if ($down1 = 0) do={:log info "PPPoE-out1 is down, disconnecting and reconnecting PPPoE-out2"/interface pppoe-client disable [find where name="pppoe-out1"]/interface pppoe-client enable [find where name="pppoe-out2"]}:if ($down2 = 0) do={:log info "PPPoE-out2 is down, disconnecting and reconnecting PPPoE-out1"/interface pppoe-client disable [find where name="pppoe-out2"]/interface pppoe-client enable [find where name="pppoe-out1"]}}/system scheduleradd interval=1m name="Auto-Reconnect-PPPoE" on-event=Auto-Reconnect-PPPoE policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive
Lưu ý: Bạn cần chỉnh sửa tên pppoe cho phù hợp cấu hình của bạn.
