更改 Tailscale 介面卡的 MTU

前言

Tailscale 是一個相當方便的點對點 VPN 工具,而我打算在上面建構 Site-to-site VPN,但是他的介面卡預設 MTU 是 1280,這確實是有些太低了。因此我在網路上尋找到了一些方式,可以將 MTU 提高。

此作法僅能在 Linux 上實現。

操作方式

前往 /etc/default 這個路徑,底下會有一個檔案 tailscaled,我們要編輯他。

vim /etc/default/tailscaled

我們需要在文件的末端加上一個參數 TS_DEBUG_MTU 並寫上你希望的 MTU,我這邊會以 1420 為例。

# Set the port to listen on for incoming VPN packets.
# Remote nodes will automatically be informed about the new port number,
# but you might want to configure this in order to set external firewall
# settings.
PORT="41641"

# Extra flags you might want to pass to tailscaled.
FLAGS=""

# SET Tailscale MTU
TS_DEBUG_MTU="1420"

接著重新啟動 tailscaled

sudo systemctl restart tailscaled

這樣就可以囉。

注意

Tailscale 是在多種考量下才將 1280 設為預設 MTU,若你在不清楚環境的情況下這麼設定,可能導致連線品質不佳。唯有你清楚知道你目前在做些什麼事情,再這樣更改。