Tag Archives: duplicated sessions

MikroTik – remove stale or duplicated PPP connections in active connections …

Sometimes it happens that PPP connections become duplicated on MikroTik. Today I have decided to find a solution for that as it is happening for quite some time. The script is relatively simple and I am running it via scheduler:

:foreach i in [/ppp secret find] do={
:local username [/ppp secret get $i name]
:local sessions [/ppp active print count-only where name=$username]
:if ( $sessions > 1) do={
:log warning (“Disconnecting username: ” . $username .” as duplicate entry was found in active connection table.” )
/ppp active remove [find where name=$username]
}
}