Script Giới Hạn Lưu Lượng Tải Xuống
#Video hướng dẫn https://youtu.be/wj11iwbBbdk #Thêm vào System -> Scheduler, script chỉ quét dung lượng download, vì xem video là download chứ upload gì ^^ #Dung lượng tính theo MB, ví dụ 1000 là 1000MB = 1GB :local DungLuong 1000; :local macAddress "XX:XX:XX:XX:XX:XX" :local Udownload [/ip kid-control device get [/ip kid-control device find mac-address="$macAddress"] bytes-down]; :local IP [/ip kid-control device get [/ip kid-control device find mac-address="$macAddress"] ip-address]; :if ($Udownload > $DungLuong * 1000000) do={ /ip kid-control device reset-counters [/ip kid-control device find mac-address="$macAddress"] /ip firewall address-list add list=BlockInternet address=$IP log info "Block $macAddress" :delay 10 /ip kid-control device reset-counters [/ip kid-control device find mac-address="$macAddress"] } #Bỏ chặn và reset traffic, thêm vào System -> Scheduler /ip firewall address-list remove [/ip firewall address-list find list=BlockInternet] /ip kid-control device reset-counters #Script "dán phát ăn ngay" /ip kid-control add sun=0s-23h59m mon=0s-23h59m tue=0s-23h59m wed=0s-23h59m thu=0s-23h59m fri=0s-23h59m sat=0s-23h59m /system scheduler add interval=1m name=ScanData on-event=":local DungLuong 1000;\r\ \n:local macAddress \"XX:XX:XX:XX:XX:XX\"\r\ \n:local Udownload [/ip kid-control device get [/ip kid-control device fin\ d mac-address=\"\$macAddress\"] bytes-down];\r\ \n:local IP [/ip kid-control device get [/ip kid-control device find mac-a\ ddress=\"\$macAddress\"] ip-address];\r\ \n:if (\$Udownload > \$DungLuong * 1000000) do={\r\ \n\t/ip kid-control device reset-counters [/ip kid-control device find mac\ -address=\"\$macAddress\"]\r\ \n\t/ip firewall address-list add list=BlockInternet address=\$IP\r\ \n\tlog info \"Block \$macAddress\"\r\ \n\t:delay 10\r\ \n\t/ip kid-control device reset-counters [/ip kid-control device find mac\ -address=\"\$macAddress\"]\r\ \n}" policy=\ ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \ start-date=2023-01-01 start-time=00:00:00 #Thay 12h bằng thời gian reset, ví dụ 1h (1 giờ), 1d (1 ngày),... /system scheduler add interval=12h name=Unblock on-event="/ip firewall address-list remove [/ip firewall address-list find list=BlockInternet]\r\n/ip kid-control device reset-counters" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=2023-01-01 start-time=00:00:00 /ip firewall filter add action=drop chain=forward src-address-list=BlockInternet
IP:
18.117.103.185
Go Back
Tham gia cộng đồng đam mê internet
👉 Group VietNam Network Setup 👈