Bài Viết Tiêu Biểu

Đảm bảo tính sẵn sàng internet trên router mikrotik bằng Script khi có 2 pppoe

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 script
add name="Auto-Reconnect-PPPoE" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive
source={
: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 scheduler
add 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.

Để lại một bình luận

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *