Skip to content

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

@frankozland

Description

@frankozland

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

#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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions