Community discussions

MikroTik App
 
rbuserdl
Member Candidate
Member Candidate
Topic Author
Posts: 270
Joined: Thu Mar 22, 2018 1:53 pm

Logging to disk when any vpn user is connecting or disconnecting

Tue Jan 18, 2022 5:44 pm

Hello Team,

I would like to log to disk when a l2tp user is connecting or disconnecting to the Mikrotik VPN server
Currently, with the default settings, I can see something like this:
12:26:42 l2tp,ppp,info <l2tp-user>: connected 
12:26:46 l2tp,ppp,info <l2tp-user>: disconnected 
I need more lines for this (To have events from more days ago)
Also I added the following action:
/system logging action
add disk-file-name=vpn.log disk-lines-per-file=10000 name=VPN target=disk
If I add a rule for "l2tp" topic with this action, it continues being logged to memory
If I disable the rule for "info", this is not logged
If I add a log prefix to the firewall rule which is accepting the l2tp connections, a lot of useless lines are logged

I did not found how to accomplish this.
Any idea?

Thanks in advance.
Regards,
Damián
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2984
Joined: Mon Apr 08, 2019 1:16 am

Re: Logging to disk when any vpn user is connecting or disconnecting

Tue Jan 18, 2022 5:52 pm

Use "topics=l2tp" when setting up the logging rules.
Or "topics=ppp" or a combination of l2tp and ppp.

"topics=info" is logged to memory by default.
One can also negate things with "!", like "l2tp,!debug"
To stop l2tp to come with the info, then use "info,!l2tp".
One can have multiple lines with the same topic, but different additional conditions, and different actions.

.
Klembord-2.jpg
You do not have the required permissions to view the files attached to this post.
 
rbuserdl
Member Candidate
Member Candidate
Topic Author
Posts: 270
Joined: Thu Mar 22, 2018 1:53 pm

Re: Logging to disk when any vpn user is connecting or disconnecting

Tue Jan 18, 2022 6:08 pm

Thanks bpwl for your response,
When I tried this before, does not work but it does this time
I added the following rule:
/system logging
add action=VPN topics=l2tp,ppp,info
When only used the "l2tp" topic, I got more events (I dont need so much), so I had to use the 3 topics
I dont know why before did not work.

Thanks a lot
Regards,
Damián

Who is online

Users browsing this forum: baragoon, holvoetn, PI07R3K, uxertxo, woodmiller007 and 69 guests