Hello:
I’ve successfully configured PPTP-SERVER and USER-MANAGER and addressed users-IP by an IP-POOL.
now i want to distinguish between users, when they are connecting through LAN and WAN interfaces.
I’m thinking of using two different IP-POOLs, one for the time that user connects form inside(LAN) and the other one for the time that the same user connects from outside(WAN).
how can i implement this?
And restricting some users to just connect through LAN, and some to connect through WAN and some can connect from both LAN and WAN.
I Solved this by scheduling a script to run every 30 seconds and disconnect the users connecting from outside that do not have wan text in comment field of user-man but its not the best solution because it puts load on the RB.
Any better solutions?
:local lansubnet (192.168.1.0 & (255.255.255.0))
:foreach i in=[/tool user-manager session find where active=yes] do={
:local clientip [/tool user-manager session get $i calling-station-id];
:local user [/tool user-manager session get $i user];
:local inetaddr ($clientip & (255.255.255.0));
:local comment [/tool user-manager user get [/tool user-manager user find where name=$user] comment];
# :put "user name is $user & Ip: $clientip network: $inetaddr comment: $comment";
:if ( $inetaddr != $lansubnet && $comment != "wan" ) do={
:log info "user: $user connected from $clientip and must be disconected ";
/tool user-manager session close-session $i
}
}