Community discussions

 
Maribnet
just joined
Topic Author
Posts: 2
Joined: Tue May 30, 2017 10:00 pm

dst address not working

Sat Jan 05, 2019 6:03 pm

Hello

This is first time sharing in this forum and i hope to have advantage from you.
I have question about below roll:-

/ip hotspot profile
/ip hotspot user profile
set [ find default=yes ] on-login="/system script run QueuesSpeed_BAWAZIR" \
on-logout="/system script run QueuesSpeed_BAWAZIR"

/ip firewall mangle
add action=mark-packet chain=prerouting comment="Speeds By G.Bawazir" \
dst-address=!192.168.22.1 new-packet-mark=speeds

/system script
add name=QueuesSpeed_BAWAZIR policy=\
read,write,policy,test,password,sniff,sensitive source="{\r\
\n:local netspeed 2500; \r\
\n:local mxusers 5;\r\
\n:local mindownspeed 400; \r\
\n:local hotspotname \"hs-<hotspot1>\";\r\
\n#............................\r\
\n\r\
\n:local connected;\r\
\n:local content;\r\
\n:local mainqueue;\r\
\n:local addr;\r\
\n:local uname;\r\
\n\r\
\n\r\
\n:set connected [ :len [/ip hotspot active find] ];\r\
\n:if (\$connected=0) do={:set connected 1;}\r\
\n\r\
\n:foreach i in=[/queue simple find ] do={\r\
\n:set content [/queue simple get \$i comment;]\r\
\n:set mainqueue [/queue simple get \$i name;]\r\
\n:if (\$content != \"*\") do={\r\
\n:if (\$mainqueue != \$hotspotname) do={\r\
\n/queue simple remove \$i;\r\
\n}\r\
\n}\r\
\n}\r\
\n:log warning (\"Queues Cleared\");\r\
\n\r\
\n\r\
\n:if (\$connected>=\$mxusers) do={\r\
\n:log warning (\"Deviding Speeds By Static Speed\");\r\
\n:local minupspeed (\$mindownspeed/2);\r\
\n:local burstlimitdown (\$mindownspeed*2);\r\
\n:local burstthresholdup (\$minupspeed/2);\r\
\n:log warning (\"Connected: \$connected, Download: \$mindownspeed\\4B, Up\
load: \$minupspeed\\4B\");\r\
\n:foreach i in=[/ip hotspot active find] do={\r\
\n:set addr [/ip hotspot active get \$i address];\r\
\n:set uname [/ip hotspot active get \$i user];\r\
\n/queue simple add name=\$uname target=\$addr packet-marks=speeds max-lim\
it=\"\$minupspeed\\4B/\$mindownspeed\\4B\" burst-limit=\"\$mindownspeed\\4\
B/\$burstlimitdown\\4B\" burst-threshold=\"\$burstthresholdup\\4B/\$minups\
peed\\4B\" burst-time=\"7s/7s\" queue=ethernet-default/ethernet-default;\r\
\n}\r\
\n:log warning (\"Done\");\r\
\n} else= {\r\
\n:log warning (\"Deviding Speeds By Active Count\");\r\
\n:local maxdown ((\$netspeed)/\$connected);\r\
\n:local maxup (\$maxdown/2);\r\
\n:local burstlimitdown (\$maxdown*2);\r\
\n:local burstthresholdup (\$maxup/2);\r\
\n:log warning (\"Connected: \$connected, Download: \$maxdown\\4B, Upload:\
\_\$maxup\\4B\");\r\
\n:foreach i in=[/ip hotspot active find] do={\r\
\n:set addr [/ip hotspot active get \$i address];\r\
\n:set uname [/ip hotspot active get \$i user];\r\
\n/queue simple add name=\$uname target=\$addr packet-marks=\"speeds\" max\
-limit=\"\$maxup\\4B/\$maxdown\\4B\" burst-limit=\"\$maxdown\\4B/\$burstl\
imitdown\\4B\" burst-threshold=\"\$burstthresholdup\\4B/\$maxup\\4B\" burs\
t-time=\"7s/7s\" queue=ethernet-default/ethernet-default;\r\
\n}\r\
\n:log warning (\"Done\");\r\
\n}\r\
\n\r\
\n# Put Static Speeds for users here \r\
\n/queue simple set [ find name=username ] max-limit=64k/128k;\r\
\n}"

This roll to distripute speed according to active. but it's not the question i want . I want from you to describe " dst-address=!192.168.22.1 " that in ip fire wall mangle . should i leaved it as it is or change it .

Who is online

Users browsing this forum: No registered users and 7 guests