{"id":13647793,"url":"https://github.com/r3nor/mullvad-tailscale","last_synced_at":"2025-04-09T17:14:26.769Z","repository":{"id":62043564,"uuid":"523285875","full_name":"r3nor/mullvad-tailscale","owner":"r3nor","description":"Use Mullvad VPN along with Tailscale and/or Zerotier","archived":false,"fork":false,"pushed_at":"2023-11-29T21:09:04.000Z","size":91,"stargazers_count":173,"open_issues_count":6,"forks_count":10,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-09T17:14:19.090Z","etag":null,"topics":["connect","mullvad","tailscale","vpn","zerotier"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r3nor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-08-10T09:45:32.000Z","updated_at":"2025-04-06T10:21:03.000Z","dependencies_parsed_at":"2023-11-29T22:25:57.995Z","dependency_job_id":"e4f2cba0-3038-4905-9065-5e2ec06a3f8b","html_url":"https://github.com/r3nor/mullvad-tailscale","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r3nor%2Fmullvad-tailscale","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r3nor%2Fmullvad-tailscale/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r3nor%2Fmullvad-tailscale/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r3nor%2Fmullvad-tailscale/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r3nor","download_url":"https://codeload.github.com/r3nor/mullvad-tailscale/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248074925,"owners_count":21043490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["connect","mullvad","tailscale","vpn","zerotier"],"created_at":"2024-08-02T01:03:46.723Z","updated_at":"2025-04-09T17:14:26.740Z","avatar_url":"https://github.com/r3nor.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# Mullvad with Tailscale / Zerotier\n\u003cp align=\"center\"\u003e\u003cb\u003eMullvad Nftables script\u003c/b\u003e\u003c/p\u003e\n\n\u003e Note: The script was formerly called `mtc`. It is now `mnf` and has been improved.\n\nThis is a simple bash script that will allow you to run Mullvad VPN along with Tailscale or Zerotier on Linux. \n\n`mnf` (for `Mullvad nftables`) was inspired by [this gist](https://gist.github.com/1player/e9cadfef833d5eb5a23c30223f560147), although it has been completely rewritten and improved.\n\nThis script works with Zerotier and Tailscale.\n\n## Features\n- [x] Bring up Tailscale/Zerotier and Mullvad with a random server\n- [x] Connect to a specific country\n- [x] Blacklist countries to avoid connecting to them\n- [x] Use only [RAM-only (diskless) servers](https://mullvad.net/en/blog/2022/8/1/expanding-diskless-infrastructure-to-more-locations-system-transparency-stboot/)\n- [x] Set custom DNS server(s) for Mullvad\n- [x] Bring down all (tailscale/zerotier+mullvad+nftables) or each one selectively\n- [x] Automatically update the Mullvad relay list at startup\n- [x] and more.\n\n## Requirements\n\n- [Mullvad](https://mullvad.net/download/) must be installed on your system, so that the [mullvad cli](https://mullvad.net/en/help/how-use-mullvad-cli/) command is available.\n- Install the `nftables` package.\n- `tailscale` or `zerotier-one` must be installed and configured properly.\n\n## Setup\n1. Clone this repo:\n```bash\ngit clone https://github.com/r3nor/mullvad-tailscale\n```\n\u003e Or download and extract the latest release source from [releases page](https://github.com/r3nor/mullvad-tailscale/releases).\n\n2. Go to the cloned dir: `cd mullvad-tailscale`\n3. Make the script executable:\n```bash\nchmod +x mnf\n```\n4. Inspect and **edit** the script file (`mnf`):\n- Change the `RULES_DIR` variable to point to the directory in which the `mullvad.rules` file from this repository is located. If you cloned the repo, it should be inside the `mullvad-tailscale` folder.\n- Modify the `EXCLUDE_COUNTRY_CODES` variable if you want to exclude any countries from the VPN connection (don't connect to these countries). If you do not want to exclude any country, set this variable to `''`. If you want to add more, just add most two-letter country codes, separated by spaces.\n- Uncomment the `INCLUDE_COUNTRY_CODES` variable if you want to force the connection to specific countries (only connect to these countries). This will override `EXCLUDE_COUNTRY_CODES`. If you want to add more, just add most two-letter country codes, separated by spaces.\n5. Edit the `mullvad.rules` file:\n- Set your Tailscale/Zerotier network IPs in the `EXCLUDED_IPS` variable (you can use CDIR notation). \n- Set your Tailscale/Zerotier network IPv6 IPs in the `EXCLUDED_IPV6` variable (you can use CDIR notation). If you do not want IPv6 support, comment this line as well as the one starting with `ip6 daddr $EXCLUDED_IPV6` .\n- Set your Tailscale/Zerotier DNS resolver in `RESOLVER_ADDRS`.\n    - It should be `100.100.100.100` for Tailscale.\n    - If you are using Zerotier, the DNS resolver IP can be found in the `/etc/resolv.conf` file after running `zerotier-one` service. You will find it in a new line. It should look like `10.X.X.X`.\n\u003e You can find the Tailscale/Zerotier IPs in your dashboard. Just use copy and paste for each of your devices.\n6. Setup your Mullvad account if you haven't done it yet:\n```bash\nmullvad account login 1234123412341234\n```\n\n## Usage\n\u003e You might want to add `mnf` to your PATH.\n[Jump to an example usage](#example)\n\n### up\nApply nftables configuration and connect to Mullvad and Tailscale/Zerotier.\n``` bash\nmnf up [-OPTIONS]:\n    -h | --help         Show this help message\n    -r | --ram          No-disk/RAM only Mullvad relays (default: all servers)\n    -z | --zerotier     Use Zerotier instead of Tailscale\n    -d | --dns          Set custom Mullvad DNS server (i.e. -d 1.1.1.1 or -d 8.8.8.8,1.1.1.1)\n    -c | --country      Specify country code(s) to connect to (i.e. -c gb or -c fr,pt,es)\n    -f | --file         Specify a particular NFT rules file (default: mullvad.rules)\n```\n\n### down\nBring down Mullvad and remove nftables configuration.\n``` bash\nmnf down [-OPTIONS]:\n    -h | --help         Show this help message\n    -a | --all          Stop Mullvad and Tailscale/Zerotier (default: only stop Mullvad)\n    -z | --zerotier     Use Zerotier instead of Tailscale\n    -t | --table        Indicate the nft tablename to bring down (default: mullvad-ts)\n```\n\n### conf\nApply nftables configuration so Mullvad and Tailscale/Zerotier can work together and do nothing more.\n``` bash\nmnf conf [-OPTIONS]:\n    -u                  Remove the nftables configuration\n    -h                  Show this help message\n```\n\n### Example\n`mnf up -rz -d 1.1.1.1 -c ee`\n\nor the same command with long flag names:\n\n`mnf up --ram --zerotier --dns 1.1.1.1 --country ee`\n\nThis connects to Mullvad's RAM-only servers (`-r`) in Estonia (`-c ee`) and uses Zerotier (`-z`). It also sets the MullvadVPN DNS to `1.1.1.1` .\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr3nor%2Fmullvad-tailscale","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr3nor%2Fmullvad-tailscale","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr3nor%2Fmullvad-tailscale/lists"}