Hello, Mikrotik Users.
I want to log the VPN USER's(PPTP, L2TP) real ip address.
This is my logging script. But I have some problem.
/system script add name=pppactivelist source= {
:local userid;
: local i;
: local realip;
: local vpnip;
: local uptime;
: local crttime;
: local crtdate;
: local logmsg;
:foreach i in=[/ppp active find] do={
:set userid [/ppp active get $i];
:set realip [/ppp active get $i caller-id];
:set vpnip [/ppp active get $i address];
:set uptime [/system active get $i uptime];
:set crtdate [/system clock get date];
:set crttime [/system clock get time];
:set longmsg "TIME: $crtdate $crttime, USER_ID: $userid, REAL-IP: $realip, VPN-IP: $vpnip, UP-TIME: $uptime";
:log info (" $logmsg ");
}
}
/system scheduler
add disabled=no interval=1m name=pppactivelist on-event=pppactivelist start-time=startup
The Problem is that duplicated lines in log info exist.
I want to make a script schedule 3 minutes to record only new pptp user's connection informations in remote log server.
Could you help me how to make a script?
I means that every new pptp user's connection information should be logged in my remote log server.
Thank you for your reading.