Answer the question
In order to leave comments, you need to log in
How to implement vpn connection log on mikrotik?
By default, the memory log contains brief information about who and what time connected / disconnected. But when a bunch of other events pour in this log, information on vpn connections goes away. Therefore, it must be written in a separate log.
But if you write from a topic, for example, pptp, then there is a large amount of debugging information that is not needed and in the logs it appears as "pptp debug packet". And you only need "pptp ppp info".
How to implement?
Answer the question
In order to leave comments, you need to log in
Create a new log for yourself in System/logging with Topics=pptp,ppp,info,account
In the corresponding PPP profile, you can add scripts to connect / disconnect users:
UP
:local pppuser
:local localAddr
:local remoteAddr
:local callerId
:local calledId
:local interfaceName
:set pppuser $"user"
:set localAddr $"local-address"
:set remoteAddr $"remote-address"
:set callerId $"caller-id"
:set calledId $"called-id"
:set interfaceName [/interface get $interface name]
:log info message="$interfaceName $callerId @ $remoteAddr connected"
:local pppuser
:local localAddr
:local remoteAddr
:local callerId
:local calledId
:local interfaceName
:set pppuser $"user"
:set localAddr $"local-address"
:set remoteAddr $"remote-address"
:set callerId $"caller-id"
:set calledId $"called-id"
:set interfaceName [/interface get $interface name]
:log info message="$callerId @ $remoteAddr disconnected"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question