Dynamic Qos without HotSpot Authen
จากภาพเราจะเห็นว่า Queue จะถูกสร้างขึ้น โดยอัตโนมัติ หลังจาก Client ได้รับ IP Address จาก DHCP-Server ในการ Config Dynamic Qos แบ่งออก เป็น 3 หลักใหญ่คือ
1. Client ได้รับ IP Address และ สร้าง Queue โดยอัตโนมัติ
2. Run Script check status waiting และ remove
3. Clear Client Static ทุกวัน เวลา 18.00น.
เริ่มจาก ขั้นที่ 1 ก่อน
- นำ Script วางลงใน Lease Script
## Start ##
:local scriptComment "DHCPMakeStatic"
:global leaseBound
:global leaseServerName
:global leaseActMAC
:global leaseActIP
:set scriptComment ("+" . $scriptComment)
:if ($leaseBound = 1) do={
/ip dhcp-server lease {
:foreach i in [find dynamic address=$leaseActIP] do={
make-static $i
}
/ip dhcp-server lease set [find server=dhcp3] rate-limit="1024k/1024k 2048k/2048k 750k/750k 16/16"
}
}
} else={
}
### END ###
ปล. อย่าลืมที่ HightLight ไว้ แก้ให้ตรง ตามชื่อ DHCP NAME
ขั้นที่ 2
- นำ Script check Status วางลงใน New Terminal
### Start ##
/system script
add name="status waiting" policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive source=":foreac\
h i in=[/ip dhcp-server lease find status=\"waiting\"] do={\r\
\n/ip dhcp-server lease remove \$i; \r\
\n}"
/system scheduler
add interval=30m name="Run remove waiting" on-event="status waiting" policy=\
### END ##
ขั้นที่ 3
- นำ Script Celar StaTic Client วางลงใน New Terminal
### Start ##
/system script
add name="remove lease" policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive source=":foreac\
h i in=[/ip dhcp-server lease find status=waiting] do={\t\r\
\n\t:if ([:len [/ip dhcp-server lease get \$i mac-address]] = 0) do={\r\
\n\t\t/ip dhcp-server lease remove \$i;\r\
\n\t}\r\
\n}"
/system scheduler
add interval=1d name="Run remove lease" on-event="remove Lease" policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=\
sep/24/2015 start-time=18:00:00
### END ##