RaspAP / raspap-webgui

Simple wireless AP setup & management for Debian-based devices
https://raspap.com/
GNU General Public License v3.0
4.43k stars 786 forks source link

Add tunnel name to config and update masquerade to use tunnel name for custom cli #1646

Open frankozland opened 1 month ago

frankozland commented 1 month ago

Is your feature request related to a problem?

in config/vpn-providers.json, would it make sense to add a field for the tunnel name?

And then on up set the masquerade to match that cli field? ie

            "id": 3,
            "name": "NordVPN",
            "bin_path": "/usr/bin/nordvpn",
            "tun_device":"nordlynx",
            "install_page": "https://nordvpn.com/download/linux/",
            "account_page": "https://my.nordaccount.com/dashboard/",
            "cmd_overrides": {
                "log": "status"
            },

so on masquerade step, just pass $tun_device?

iptables -t nat -A POSTROUTING -o $tun_device -j MASQUERADE

This may also be useful for monitoring - if $tun_device disappears from "ip a" the tunnel is dead.

Describe the solution you'd like

masquerade to use the correct tunnel name

Describe alternatives you've considered

manually apply iptables - undesired

Additional context

users are having issues when using cli - masquerade is not forwarding packets thru vpn tunnel

https://github.com/RaspAP/raspap-webgui/discussions/1562

This may be a very easy/simple win, esp as new vpn tech comes along?

it might make sense to also include wireguard (wg0) and openvpn (tun0) for consistency sake and 1 place to maintain without any other code change. A nice to have would be a place to add additional field to run a user cli command on connect thru raspap, and a place to run a different command on disconnect thru raspap.

github-actions[bot] commented 1 week ago

This issue is stale because it has been open for 30 days with no activity.