I’m moving away from OpenVPN to Wireguard but one function I use on the RUTX50, is the ability to send the device an SMS to turn the OpenVPN on and off.
I need similar functionality for the wg VPN and I’m assuming 2 custom scripts will need to be created.
Can anyone let me know what the customs scripts will look like.
Hi, I was getting an error returned, so never having done so, and with no previous knowledge, I used the CLI to look at the various config files along with the helpful intro page at RUTX50 Mobile Utilities - Teltonika Networks Wiki
What I found that worked, were a couple of custom SMS rules in the SMS Utilities, that I created and contain …
To turn ON …
#!/bin/sh
uci set network.[insert wg tunnel name].disabled=‘0’
uci commit network
To turn OFF
#!/bin/sh
uci set network.[insert wg tunnel name].disabled=‘1’
uci commit network
I’m not sure if I need to do a commit or not … any idea if I need to use a commit or even if I have to ‘restart’ anything … I assume by adding a last line of …
/etc/init.d/network restart
Hopefully it won’t need a restart.
My thanks for your reply; it set me off on this journey of discovery. If anyone can CONFIRM my conclusions above, I’d be really grateful.
I kept getting command failures but when I ran ‘ubus list network.interface.*’, I realised the wg interface was missing. I enabled the wg interface in Services > VPN > Wireguard > [insert Tunnel name] set to ‘on’ … and Voila!, the commands are executing.
Thanks for your help, it is really appreciated … Mike