Hello,
I have a GL.Inet GL-MT300N-V2 Mango.
I want to use the slide switch to toggle between routing all traffic through wireguard, and disabling wireguard completely.
The wireguard connection works, the slide switch status is registered correctly and the scripts are called properly. Switching from wireguard_off to wireguard_on works as intended, but the script to turn wireguard off does not work. If wireguard is disabled, I can not connect to the web from connected devices, but the router itself is connected to the internet (I can ping websites from the router).
To create the scripts, I copied the exact commands from LuCi, and changing the status works in LuCI, but not using the scripts.
Here are the scripts:
*cat /usr/bin/wireguard_on*
ubus call network.interface.fritzwg up
uci del firewall.cfg0fad58
uci add firewall forwarding # =cfg10ad58
uci set firewall.@forwarding[-1].src='lan'
uci set firewall.@forwarding[-1].dest='wg'
uci del firewall.cfg0e92bd.enabled
uci commit
*cat /usr/bin/wireguard_off*
uci del firewall.cfg0fad58
uci add firewall forwarding # =cfg10ad58
uci set firewall.@forwarding[-1].src='lan'
uci set firewall.@forwarding[-1].dest='wan'
uci set firewall.cfg0e92bd.enabled='0'
ubus call network.interface.fritzwg down
uci commit
cfg0e92db is the "Allow_Wireguard_OUT" rule.
Why does the script not work, but changing the same settings in LuCI does the trick?
Best regards,
Spatz