Edward2025
New Around Here
Thank you! It works excellent.If you are attempting to access router gui it will never work using router wg address, it only listens to the lan ip.
To make the rules auto apply at boot or peer restart:
Exit wgm and amtm.
Edit/create the file wgm executes when wg11-starts:
Paste in:Code:nano /jffs/addons/wireguard/Scripts/wg11-up.sh
Save and exit nano editor (cntrl+x y enter).Code:#!/bin/sh iptables -I INPUT -i wg11 -j ACCEPT iptables -I FORWARD -i wg11 -j ACCEPT iptables -t nat -D POSTROUTING -s $(nvram get lan_ipaddr)/24 -o wg11 -j MASQUERADE -m comment --comment "WireGuard 'client'"
Make the file executable:
edit/create the file wgn executes when stopping wg11:Code:chmod +x /jffs/addons/wireguard/Scripts/wg11-up.sh
Paste in the content:Code:nano /jffs/addons/wireguard/Scripts/wg11-down.sh
Code:#!/bin/sh iptables -D INPUT -i wg11 -j ACCEPT iptables -D FORWARD -i wg11 -j ACCEPT
Save and exit nano.
Make it executable:
Code:chmod +x /jffs/addons/wireguard/Scripts/wg11-down.sh
That should be it!