I use NordVPN on my laptop (OpenSuSE tumbleweed) while travelling, and Tailscale to reach my home server (e.g. Jellyfin, Navidrome, SSH). On their own separately both worked fine, but with Nord connected I couldn’t reach anything over Tailscale. Hopefully this is useful to other self-hosters, and should work with other VPNs.

Tailscale is an opensource secure mesh VPN; I’m using it with their servers co-ordinating my connections. You can also co-ordinate yourself with Headscale, the opensource self hosted server; same principles would probably apply but you’d likely need a fixed IP address for the server.

To fix Tailscale working with Nordvpn, you just need to add Tailscale’s subnet ranges and port to the allowlist. This allows direct connections to function and also co-ordination. This works on Linux, and likely Mac and Windows. You can’t have them work together on Android or iOS though because both only allow one VPN service at a time.

In a linux terminal:

nordvpn allowlist add subnet 100.64.0.0/10

nordvpn allowlist add port 41641

nordvpn allowlist add subnet 192.200.0.0/24

The 100.64.0.0/10 subnet range is for the IP addresses Tailnet assigns your devices and is essential. The port 41641 is also essential.

The 192.200.0.0/24 subnet range is for the IP addresses Tailnet’s co-ordination servers and may be optional; things worked without this BUT I got a warning on using tailscale status. You could not allow this range, and occasionally turn off nordvpn, but it’s a small range of IP addresses, and the traffic to Tailscale is encrypted. However the metadata would be visible to someone, so they could tell you’re using tailscale (but not access the data).

I also have nordvpn’s meshnet turned off; that apparently can conflict with tailscale as it uses the same 100.64.0.0/10 subnet:

nordvpn set meshnet off

The same principle should apply to other VPN providers. Tailscale’s documentation also provides the fixed IPv6 range for the co-ordination server. May be useful with other VPNs, but NordVPN at least does not use IPv6 in it allowlist: 2606:B740:49::/48

  • sagheery@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    4 hours ago

    [I keep Tailscale on 24/7 on my Galaxy S22 Ultra] and it barely shows up in the battery stats. One trick that made it worth leaving on: in the Tailscale admin console, under DNS, add your Pi-hole’s Tailscale IP as a nameserver and turn on “Override local DNS”. Then you get Pi-hole’s ad blocking on mobile data too, not just at home.

  • TheHive@feddit.org
    link
    fedilink
    English
    arrow-up
    4
    ·
    13 hours ago

    Do you guys have Tailscale running 24/7? At least while out and about on the phone? I have an iPhone and feel like it’s just eating my battery. It could also be that my battery is just shit, nothing based on objective observations here.

    • ILikeTraaaains@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      6 hours ago

      I do, also on iPhone.

      I wouldn’t say it “eats the battery”, but in my total anecdotal personal experience backed only on vibes and 0 data, at the end of the day the remaining battery is a bit lower the days I have it activated vs the days it is off.

    • Unquote0270@programming.dev
      link
      fedilink
      English
      arrow-up
      3
      ·
      12 hours ago

      Surely your iPhone has the ability to see battery usage breakdown? No need to guess. But yes, I run it 27/7 on android without any battery issues.

  • magnue@lemmy.world
    link
    fedilink
    English
    arrow-up
    13
    ·
    20 hours ago

    Personally I just tunnel from my phone to my home server via tailscale, then my phone internet traffic is routed through nordvpn/adguard on the home server

  • yestalgia@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    14 hours ago

    I use the Mullvad integration that is built into Tailscale because it is so easy to use. I can pick an exit node that I own at a family member’s house just as easily as an exit node from another country through Mullvad. I do this on iOS, GrapheneOS, Linux, and Windows as well.

    Still think OP posting this is totally reasonable. I just prefer the integrated solution that Tailscale and Mullvad provide.

    • Infernal_pizza@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      2
      ·
      11 hours ago

      Would you mind sharing how you did that? I tried a while ago and it sort of worked but the ping was horrendous because I think my traffic was being bounced between the exit node and my home a couple of times

      • Unquote0270@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        10 hours ago

        I did have some problems for a while but eventually got it working. I think what you probably needed to set was the WIREGUARD_MTU, this made a drastic difference for me.

        This is the compose:

        services:
            gluetun_exit_node:
                image: qmcgaw/gluetun
                container_name: gluetun_exit_node
                cap_add:
                  - NET_ADMIN
                devices:
                  - /dev/net/tun:/dev/net/tun
                environment:
                  - FIREWALL_OUTBOUND_SUBNETS=100.64.0.0/10,192.168.0.0/24 # tailscale + LAN
                  - VPN_SERVICE_PROVIDER=mullvad
                  - VPN_TYPE=wireguard
                  - WIREGUARD_PRIVATE_KEY=${WIREGUARD_PRIVATE_KEY}
                  - WIREGUARD_ADDRESSES=${WIREGUARD_ADDRESSES}
                  - SERVER_COUNTRIES=${MULLVAD_SERVER_COUNTRIES}
                  - WIREGUARD_MTU=1420
                  - UPDATER_PERIOD=24h
                  - BLOCK_MALICIOUS=true
                  - BLOCK_SURVEILLANCE=true
                  - BLOCK_ADS=true
                restart: unless-stopped
                healthcheck:
                  test: ["CMD", "/gluetun-entrypoint", "healthcheck"]
                  interval: 30s
                  timeout: 10s
                  retries: 3
                  start_period: 10s
            
            tailscale-exit:
                image: tailscale/tailscale:latest
                container_name: tailscale-exit
                network_mode: service:gluetun_exit_node
                environment:
                  - TS_HOSTNAME=mediaserver-exit
                  - TS_AUTHKEY=${TS_AUTHKEY_EXIT}
                  - TS_STATE_DIR=/var/lib/tailscale
                  - TS_EXTRA_ARGS=--advertise-exit-node --accept-routes
                  - TS_ROUTES=192.168.0.0/24
                  - TS_USERSPACE=true
                  - TS_LOG_LEVEL=info
                volumes:
                  - /srv/config/tailscale-exit:/var/lib/tailscale
                user: "1000:1000"
                depends_on:
                  - gluetun_exit_node
                restart: unless-stopped
        
  • altphoto@lemmy.today
    link
    fedilink
    English
    arrow-up
    2
    ·
    14 hours ago

    Rayfish. Xyz has some similarities but they implemented a “magic DNS” where you can contact your server using something like “ubuntu.mynetwork.ray:8080”

  • stratself@lemdro.id
    link
    fedilink
    English
    arrow-up
    1
    ·
    13 hours ago

    It’s good that nordvpn has a command to allowlist ranges like that. I wonder if it’s that simple for other VPN providers.

    For devices where this isn’t possible, I use https://github.com/stratself/tswg. It essentially acts as an exit node that forwards client traffic to the VPN’d Wireguard interface. There’s also Tailguard which allows for more complex setup I think.

  • Reannlegge@lemmy.ca
    link
    fedilink
    English
    arrow-up
    2
    ·
    17 hours ago

    I personally have wireguard to my Home, which uses pihole, unbound, and DoT to CIRA. I do not care to look like I am coming from anywhere other than my home*. I should probably add something for https everywhere but just have not yet.