I would like to set a route when a VPN client connects to the VPN server.
If the client disconnects again then this route must also be removed again
If the route is not removed again, the gateway will otherwise be listed as unknown in the route and when reconnecting the client will receive a different interface id, which is required for the gateway in /ip routes.
Under /PPP/Profiles I have the option of storing a script for the On-Up and On-Down events. Within the events, you can access the interface with the $interface variable.
Since I have many VPN clients, I must have a list/variable that connects the VPN clients and the subnets for the routes.
VpnRoutes [[VPN-000001;192.168.111.0/24];[VPN-000002;192.168.112.0/24];.......]
Unfortunately, the variable for the $interface sometimes results in <ovpn-VPN-000001> or sometimes even *f00001 and cannot be used.
I hope someone has a good idea or even another possibility for me.
My goal is to operate a CloudHostedRouter to which many VPN clients (gateways) log on and I can reach the local networks behind all gateways if I log on as a VPN client myself.
Greetings Dennis