https://github.com/luizbizzio/tailscale-mtu
🌐 Scripts to configure persistent MTU settings for Tailscale on Linux and Windows, enhancing network performance with automated and customizable setups.
https://github.com/luizbizzio/tailscale-mtu
automation bash cross-platform devops iot linux mtu network-optimization network-performance network-tools networking open-source powershell scripts shell-scripts tailscale udev-rules vpn windows wireguard
Last synced: 26 days ago
JSON representation
🌐 Scripts to configure persistent MTU settings for Tailscale on Linux and Windows, enhancing network performance with automated and customizable setups.
- Host: GitHub
- URL: https://github.com/luizbizzio/tailscale-mtu
- Owner: luizbizzio
- License: mit
- Created: 2025-01-04T11:36:15.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-12T16:34:49.000Z (12 months ago)
- Last Synced: 2025-04-15T16:00:07.012Z (11 months ago)
- Topics: automation, bash, cross-platform, devops, iot, linux, mtu, network-optimization, network-performance, network-tools, networking, open-source, powershell, scripts, shell-scripts, tailscale, udev-rules, vpn, windows, wireguard
- Language: PowerShell
- Homepage:
- Size: 134 KB
- Stars: 15
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tailscale MTU 🌐
Persistent MTU management for Tailscale across reboots and interface resets.
This project helps you save the MTU you want and keep it applied after interface changes, reconnects, and reboots.
## What it does
- Keeps your Tailscale MTU persistent
- Supports IPv4 and IPv6 values separately (Windows Only)
- Works on Linux and Windows
- On Windows, runs with a simple UI after install
## Why this exists
Tailscale MTU can go back to another value after reconnects or reboot.
This tool saves your desired value and keeps checking in the background.
If the interface changes, it applies the saved MTU again.
## Install
### Windows 🪟
Run this in **PowerShell** or in **CMD / Windows Terminal**:
```powershell
powershell -NoProfile -ExecutionPolicy Bypass -Command "Set-ExecutionPolicy -Scope Process Bypass -Force; $ProgressPreference='SilentlyContinue'; $u='https://raw.githubusercontent.com/luizbizzio/tailscale-mtu/main/windows/windows-setup.ps1'; $c=(Invoke-WebRequest -UseBasicParsing $u).Content; & ([ScriptBlock]::Create($c)) -Install"
```
After install:
1. Open **Tailscale MTU** from the Start Menu
2. Set your values
3. Click **Save and Apply**
Default Windows files:
```text
%ProgramData%\TailscaleMTU\config.json
%ProgramData%\TailscaleMTU\state.json
```
---
### Linux 🐧
```bash
curl -fsSL https://raw.githubusercontent.com/luizbizzio/tailscale-mtu/main/linux/linux-setup.sh | sudo bash
```
After install, set the MTU like this:
```bash
sudo tailscale-mtu --mtu 1280
```
Optional interface:
```bash
sudo tailscale-mtu --mtu 1280 --iface tailscale0
```
Check status:
```bash
tailscale-mtu --status
```
---
## How it works
### Linux
The installer places the binary at:
```text
/usr/local/bin/tailscale-mtu
```
When you run:
```bash
sudo tailscale-mtu --mtu 1280
```
It:
- Saves the MTU and interface in `/etc/tailscale-mtu.conf`
- Applies the MTU immediately using `ip link set`
- Creates a `udev` rule (if available) to reapply MTU when the interface returns
#### Linux limits
- Linux uses **one MTU value per interface**
- IPv4 and IPv6 are **not separate**
- Allowed range: **576 to 9000**
- Values below **1280** trigger a warning
Why **1280** matters:
- **1280 bytes is the minimum MTU required by IPv6 (RFC 8200)**
- Lower values can cause IPv6 fragmentation failures and dropped traffic
In practice:
```text
Save MTU -> apply immediately -> udev reapplies on reconnect
```
---
### Windows
The installer places all files under:
```text
%ProgramData%\TailscaleMTU
```
What happens internally:
- Uses `netsh` to configure IPv4 and IPv6 MTU independently
- Runs as a Windows Service via **NSSM**
- Periodically verifies the interface state
- Reapplies MTU automatically after reboots or reconnects
- Does not modify the registry directly
---
## License 📄
This project is licensed under the [Mozilla Public License 2.0](./LICENSE).