What we want:
I don’t think this will work with ASUS orginal firmware, I have not tested.
I use Merlin (https://asuswrt.lostrealm.ca/)
Check what TUN you have in the router via ssh
Command: route
Then you see what TUN you have on the vpn, in my case tun15
You can also use tun1+ but then all TUN will be affected
Command:
iptables -I POSTROUTING -t nat -s $(nvram get vpn_server1_sn)/24 -o tun15 -j MASQUERADE
Test if this works
Then add it to a script that will apply this automatic after renoot.
Script:
https://github.com/RMerl/asuswrt-merlin/wiki/User-scripts
1. Enable script in the gui
2. Create script
vi /jffs/scripts/firewall-start
#!/bin/sh
iptables -I POSTROUTING -t nat -s $(nvram get vpn_server1_sn)/24 -o tun15 -j MASQUERADE
chmod +x /jffs/scripts/firewall-start
reboot
Don’t forget to tick to start vpn client on boot in the gui
And
Redirect Internet traffic Any or selective routing
Leave a Reply