What is the issue?
Hello!
I have a 3-machine setup, where 1 machine doesn't have tailscale:
A (no tailscale) -> B ("subnet router", relay to tailscale network) -> C (exit node) -> (internet)
Browsing the internet on A, everything works fine... except some websites like https://duckduckgo.com . (google, youtube... etc work fine)
Inspecting the issue for problematic websites, I noticed the TLS Server Hello from the internet getting dropped by the exit node - and the exit node replying with ICMP 3,4 "MTU is 1280, please fragment" to the website, but they probably disappear in a PMTU black hole and get ignored - classic.
In summary: A's interface has an MTU of 1500, so the client on A announces an MSS of 1460 bytes - and the website consequently replies back with IP packets that don't fit in the tailscale link. And PMTU breaks because it's the internet wild west.
I'm able to make things work by changing the MTU on A to 1280 via DHCP option (I do not control the device, but I can tweak the DHCP server).
I can also fix things by clearing the DF flag in very despicable ways on the exit node (clearing the DF flag on forwarded packets from internet to tailscale will allow IP fragmentation to happen instead of getting dropped)
Steps to reproduce
Replicating the setup might be a little annoying, but it seems logically equivalent to reproduce with 2 machines by doing:
Machine A: use exit node B
Machine B: setup as exit node
Then, on machine A: sudo ifconfig tailscale0 mtu 1281 (1 higher than 1280)
At that point, browsing the web on machine A (with B as exit node) should work pretty seamlessly, but visiting https://duckduckgo.com will not work for example: the announced MSS will prevent the exit node to forward internet traffic back to the client through the tailscale link.
Manually changing the MTU on tailscale0 is obviously not a normal behavior, but I think it is equivalent (in terms of generated traffic) to the 3-node setup I was describing.
Given that:
- tailscale introduces a link with low-ish MTU (1280)
- Clients behind a tailscale "subnet router" and servers on the internet will both usually announce MSS around ~1460, too high to be compatible with tailscale link's default MTU
This means the traffic has high chances of requiring PMTU to work perfectly, which is often not the case (cf duckduckgo) - so in practice chances of traffic being affected by PMTU issues are higher than in normal, non-tailscale conditions.
=> It would be good to mention on the relevant page ( https://tailscale.com/kb/1019/subnets/ ) that that TCP clients behind tailscale "subnet routers" may want to announce an appropriate (low) MSS to avoid PMTU issues at the exit node (and practically, setting their interface MTU to tailscale's MTU will do the trick). This would help with the "principle of least astonishment", especially as the setup I am describing seems very simple.
Thanks!
Are there any recent changes that introduced the issue?
No response
OS
Linux, Android
OS version
Debian 12, OL 7.9
Tailscale version
1.20.2
Bug report
BUG-85d741a3f5ca3f3ba86a0dd9cb0767178750e75f9f2aa7941c08c0f725bd530f-20220128165433Z-2529369bd3d4f577
What is the issue?
Hello!
I have a 3-machine setup, where 1 machine doesn't have tailscale:
A (no tailscale) -> B ("subnet router", relay to tailscale network) -> C (exit node) -> (internet)
Browsing the internet on A, everything works fine... except some websites like https://duckduckgo.com . (google, youtube... etc work fine)
Inspecting the issue for problematic websites, I noticed the TLS Server Hello from the internet getting dropped by the exit node - and the exit node replying with ICMP 3,4 "MTU is 1280, please fragment" to the website, but they probably disappear in a PMTU black hole and get ignored - classic.
In summary: A's interface has an MTU of 1500, so the client on A announces an MSS of 1460 bytes - and the website consequently replies back with IP packets that don't fit in the tailscale link. And PMTU breaks because it's the internet wild west.
I'm able to make things work by changing the MTU on A to 1280 via DHCP option (I do not control the device, but I can tweak the DHCP server).
I can also fix things by clearing the DF flag in very despicable ways on the exit node (clearing the DF flag on forwarded packets from internet to tailscale will allow IP fragmentation to happen instead of getting dropped)
Steps to reproduce
Replicating the setup might be a little annoying, but it seems logically equivalent to reproduce with 2 machines by doing:
Machine A: use exit node B
Machine B: setup as exit node
Then, on machine A:
sudo ifconfig tailscale0 mtu 1281(1 higher than 1280)At that point, browsing the web on machine A (with B as exit node) should work pretty seamlessly, but visiting https://duckduckgo.com will not work for example: the announced MSS will prevent the exit node to forward internet traffic back to the client through the tailscale link.
Manually changing the MTU on
tailscale0is obviously not a normal behavior, but I think it is equivalent (in terms of generated traffic) to the 3-node setup I was describing.Given that:
This means the traffic has high chances of requiring PMTU to work perfectly, which is often not the case (cf duckduckgo) - so in practice chances of traffic being affected by PMTU issues are higher than in normal, non-tailscale conditions.
=> It would be good to mention on the relevant page ( https://tailscale.com/kb/1019/subnets/ ) that that TCP clients behind tailscale "subnet routers" may want to announce an appropriate (low) MSS to avoid PMTU issues at the exit node (and practically, setting their interface MTU to tailscale's MTU will do the trick). This would help with the "principle of least astonishment", especially as the setup I am describing seems very simple.
Thanks!
Are there any recent changes that introduced the issue?
No response
OS
Linux, Android
OS version
Debian 12, OL 7.9
Tailscale version
1.20.2
Bug report
BUG-85d741a3f5ca3f3ba86a0dd9cb0767178750e75f9f2aa7941c08c0f725bd530f-20220128165433Z-2529369bd3d4f577