Getting L2TP Dial Out User

Good day, to all you mikrotik people!

I’m as fresh as can be with mikrotik scripting, I’m currently battling with understanding the syntax and such..

I’m just wondering if it’s possible what I’m trying to achieve.

I want to create a function on my dude server, the function should be able to retrieve the string value of the user from the l2tp interface. I don’t know if this is possible, can someone please help?

I couldn’t find a related post to help me, sorry if there’s one.

i am not 100% sure how you’d do it on the dude, but i can give you the commands inside routeros for this. consider the following setup:

[

me@mikrotik] /interface l2tp-server> :put [get [find name="<l2tp-mfx-78F108BF1B4B>" and running] user ]
mfx-78F108BF1B4B

so as long you know the name of the l2tp interface, you can query the sessions under /interface l2tp-server and get the propery user for a corresponding record.

Thanx for the reply.. U kinda understand that code, I’m just curious.. That last part? You state the L2TP connection name again? Is that just the syntax for mikrotik code?

I also see you’re working from the l2tp-server interface.. Will it work from the client?

I tried that code in the mikrotikos and It’s telling me that there’s no such item..

Mine’s the same as yours except for the name of the interface and I’m running it from the client