FUP Allowance & Speed

I need to make a Fair User Policy for my customers.

Default all customers will be getting 2M Download Speed.

There will be packages like example: 3Mbps with 10GB, 5Mbps with 30GB, 10Mbps with 50GB, etc..

Once the customer reaches to given allowance/capacity reduce speed to default (2M). Again customer can increase speed by purchase of allowance/capacity.

Please help. Thanks.

I also have a need for this, so following…

I’m also need this kind of stuff,

In my experience you need Radius to do this, you can’t do this from Mikrotik as RB Device cannot count total Monthly / Weekly user traffic!

Hotspot, hotspot + radius, pppoe + radius. All do it.

{

Variables:

:local limitedProfile “Paket-Harian”
:local limitedSlowProfile “FUP”
:local trafLimit 800000000

Code:

:local uList [/ip hotspot user find profile=$limitedProfile]
:foreach u in=$uList do={
:local traf ([/ip hotspot user get $u bytes-in] + [/ip hotspot user get $u bytes-out])
:local uActive [/ip hotspot active find user=[/ip hotspot user get $u name]]
:if ([:len $uActive] != 0) do={
:set traf ($traf + [/ip hotspot active get $uActive bytes-in] + [/ip hotspot active get $uActive bytes-out])
}

:put (“User (” . [/ip hotspot user get $u name] . ") traf: " . $traf)
:if ($traf > $trafLimit) do={
/ip hotspot user set $u profile=$limitedSlowProfile
:put (“User (” . [/ip hotspot user get $u name] . “) mencapai batas FUP yg ditentukan”)
:if ([:len $uActive] != 0) do={
/queue simple set max-limit=256k/256k [find name=[/ip hotspot user get $u name]]
#/ip hotspot active remove $uActive #Hapus tanda pagar jika anda ingin User yg active dikeluarkan dari jaringan
:put (“User (” . [/ip hotspot user get $u name] . “) kecepatannya akan diturunkan”)
}
:log warning (“User (” . [/ip hotspot user get $u name] . “) sudah melebihi batas FUP”)
}
}
}