How to set PPPOE user expired ?

In PPPOE Mikrotik user management, there are several methods that can be used to make it expire.

You can delete a user, disable it (enable it again if the user has made a payment) or by providing a notification on the user's device that it is time for the internet to renew the payment.

Let's do it...

First, create PPPOE server, on the left menu click PPP and click PPPoE Servers tab.

then click on + icon like picture below, and set the interface your client conneted.


 

set the ip pool for PPPOE user, and set the user profile for an active period of 30 days with upload 3Mbps and download 5Mbps.

/ip pool add name=poolPPPOE30d ranges=192.168.110.2-192.168.110.254
/ppp profile add name=pppoeMonthly local-address=192.168.110.1 remote-address=poolPPPOE30d rate-limit=3M/5M
adding user PPPOE via terminal
/ppp secret add name=tester password=test123 service=pppoe profile=pppoeMonthly local-address=192.168.110.1


now, testing your client connect router to the mikrotik, and login with username and password you create above.


where locate script expired user pppoe ?

open the profile you create (double click on profile), and open on script tab, and paste On Up column


 

this script automatic add to system schedule and auto remove script if user has expired, and you can enable again if user has been renew the payment.

you can change on experiment 30d with 7d (for 7 days) or 1h (for1 hours) or 5m (for 5 minutes) expired.

Script to set disable user expired on 30 days

{
:local usernya $user;
:if ([/system schedule find name=$usernya]="") do={
/system schedule add name=$usernya interval=30d on-event="/ppp secret disable [find name=$usernya]\r\n/ppp active remove [find name=$usernya]\r\n/system schedule remove [find name=$usernya]"
}
}

you can also make notification to user devices, tutorial on the next post.

0 Response to "How to set PPPOE user expired ?"

Post a Comment