Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #add parent
- :if ([:len ([/queue simple find name=total])] <1 do="{<br">/queue simple add target-addresses="192.168.10.0/24" max-limit=2M/2M interface=all priority=7 name="total-bw"
- }
- #import ip yang ada di ARP list
- :local ipusers [/ip arp find]
- :foreach h in $ipusers do={
- :local ipuser [/ip arp get $h address]
- :if ([:len $ipuser] >0) do {
- #ambil ipnya selain ip public
- :local ippublic [/ip arp get $h interface]
- :if ($ippublic !="eth-public") do {
- #add diqueue
- :if ( [:len ( [/queue simple find name=$ipuser] ) ] <1 br="" do="">:if ([:len ([/queue simple find name=others])]>0) do { /queue simple remove [find name=others] }
- /queue simple add target-addresses=$ipuser limit-at=256k/256k max-limit=512k/512k interface=all parent=total priority=7 name=$ipuser
- }
- }
- }
- }
- :if ([:len ([/queue simple find name=others])] <1 br="" do="">/queue simple add target-addresses="192.168.10.0/24" limit-at=256k/256k max-limit=512k/512k interface=all parent=total priority=7 name="others"
- }
- #delete yang tidak aktif
- :local ipold [/queue simple find]
- :foreach o in $ipold do={
- :local iplama [/queue simple get $o name]
- :if ([:len $iplama] >0) do {
- :if ( $iplama !="total") do={
- :if ($iplama !="others") do={
- :if ([:len ([/ip arp find address=$iplama])] <1 do="{<br">/queue simple remove [find name=$iplama]
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement