Community discussions

MikroTik App
 
routerGuy3000
just joined
Topic Author
Posts: 1
Joined: Thu Jan 04, 2024 5:40 am

RouterOS API - User Toggle VPN@Router

Thu Jan 04, 2024 5:51 am

I am writing a utility [here](https://github.com/tmheath/vpnUsrCtl/bl ... er/main.go) to
allow each user from any device on the network to control all traffic on the device whether
will be routed via vpn or normal, the router by default sends *all* traffic via vpn. I *think*
that I got the command for adding the mangle rule figured out, but I don't know how to then,
when it comes time to delete the added command determine that command that was added.
At first I thought get the index immediately after adding but I don't think that this will work
if the user disconnects and then another user disconnects, then the first connects, deleting
his added rule, and then the second disconnects, wouldn't this error or worse delete a later
added rule or am I misunderstanding?

Thanks.... first forum post and not certain I'm doing everything correct, please correct me if
I'm not.

Who is online

Users browsing this forum: No registered users and 5 guests