Side toggle switch on GL MT-300N v.2 for Wireguard peers

I wanted to have the toggle switch on the GL MT-300n v.2 "Mango" router switch between Wireguard peers rather than just turn it on/off. Thanks to others on this forum, I found the file "/usr/bin/switchaction" which scripts the actions for the toggle switch. I modified the two sections needed (one for the left position on the switch and then 'else' part, for the right). It works perfect (I think).

If I am connected to one Wireguard peer 'VPN -1', and I want to connect to peer 'VPN -2' instead, toggling the switch does:

uci set wireguard.@proxy[0].main_server="VPN - 2"
uci commit wireguard
/etc/init.d/wireguard reload

Looking at the /etc/config/wireguard file, I see that it does change the profile information correctly. The VPN light on the router does dark then lights up again. Checking the external IP address, it changes as expected.

Is there anything else I should be doing for security or best practice as well? When I change the peer I am connected to from the GUI, what else (if anything) is it doing that I am not including? I do have the Internet Kill Switch enabled as well in case that matters.

OpenWrt version: 19.07.8, r11364-ef56c85848
GLI GUI version: 3.216


Seems like you're probably running the GL-inet supplied firmware. Is that the case? If so, you'll need to ask your question in the gl-inet forums since the firmware they provide (while it is based on OpenWrt) is very different than the official versions of OpenWrt that are supported on these forums.

Will do, thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.