Community discussions

MikroTik App
 
mohamed4868
just joined
Topic Author
Posts: 4
Joined: Mon Sep 02, 2019 1:09 pm

FUP Allowance & Speed

Fri Sep 06, 2019 9:09 pm

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.
 
User avatar
CZFan
Forum Guru
Forum Guru
Posts: 2098
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Krugersdorp (Home town of Brad Binder)
Contact:

Re: FUP Allowance & Speed

Thu Sep 12, 2019 12:58 am

I also have a need for this, so following...
 
tarzq28
just joined
Posts: 10
Joined: Wed May 17, 2017 2:34 pm
Location: Indonesia
Contact:

Re: FUP Allowance & Speed

Sat Dec 28, 2019 10:44 am

I'm also need this kind of stuff,
 
User avatar
ingdaka
Trainer
Trainer
Posts: 452
Joined: Thu Aug 30, 2012 3:06 pm
Location: Albania
Contact:

Re: FUP Allowance & Speed

Sat Dec 28, 2019 11:40 pm

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!
 
allstarcomps
newbie
Posts: 36
Joined: Sat Jul 08, 2017 10:36 pm
Location: San Diego, CA, USA
Contact:

Re: FUP Allowance & Speed

Mon Dec 30, 2019 1:49 pm

Hotspot, hotspot + radius, pppoe + radius. All do it.
 
syahendra
just joined
Posts: 1
Joined: Mon Apr 09, 2012 8:32 am

Re: FUP Allowance & Speed

Sat Feb 01, 2020 6:57 am


{
# 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")
}
}
}

Who is online

Users browsing this forum: No registered users and 33 guests