1
Virtual private networks / Is there a way to programatically change Wireguard settings?
« on: March 28, 2021, 11:18:48 am »
Mullvad has a Bash script that appears to query their API to (1) get a list of their Wireguard server's public keys and locations, (2) generate your private key, (3) query their API to register your public key with Mullvad under your account, (4) save the API's response with the local interface address, and (5) write a Wireguard configuration file based on all of this info. The script is here: https://mullvad.net/media/files/mullvad-wg.sh
I am wondering if in OPNsense, one can change the Wireguard settings programmatically, and if so, how? Is there an API to change the settings you see in the GUI?
I am interested in creating a cron job that can periodically (1) rotate the Mullvad endpoint, and (2) change the private key and other related settings. Mullvad's own script seems like a helpful starting point. If there is an API in OPNsense to change these settings, then this seems very doable. Any insights would be greatly appreciated.
Also, does OPNsense have bash installed by default?
I am wondering if in OPNsense, one can change the Wireguard settings programmatically, and if so, how? Is there an API to change the settings you see in the GUI?
I am interested in creating a cron job that can periodically (1) rotate the Mullvad endpoint, and (2) change the private key and other related settings. Mullvad's own script seems like a helpful starting point. If there is an API in OPNsense to change these settings, then this seems very doable. Any insights would be greatly appreciated.
Also, does OPNsense have bash installed by default?