ZeroTierOne icon indicating copy to clipboard operation
ZeroTierOne copied to clipboard

Lower ZT_MIN_PHYSMTU

Open laduke opened this issue 1 year ago • 2 comments

ZeroTierOne.h

#define ZT_DEFAULT_PHYSMTU 1432

-#define ZT_MIN_PHYSMTU 1400
+#define ZT_MIN_PHYSMTU 576

This seems to work, with a local.conf like this:

{ "physical": {"192.168.82.0/24": { "mtu": 789 } } }

576 is allegedly the minumum for ipv4.

If I set MTU to 510, the real packets are 576 in tcpdump, so maybe 510 is the right minimum.

Was looking at this because people on cell connections get stuck sometimes. They lower the virtual mtu and that works by side effect.

This way users can set the MTU based on the physical connection.

They could use a different value for IPv6 traffic also.

The constant is used in only 1 place.

laduke avatar Sep 12 '24 20:09 laduke

This seems like something that must be auto-configured. I just had to compute the MTU was 1194 (manually, using ping -M do -s $(( <MTU> - 28 )) <host>) and then set it using ifconfig <interface> mtu 1194.

It is unlikely that 100% of ZeroTier users are going to be able to A) determine that this is necessary, and B) figure out how to do it, and B) repeat the process each time every ZeroTier interface is dynamically re-created!

What's the right solution?

pjkundert avatar Sep 18 '24 20:09 pjkundert

Yeah I also ran into this issue.

destroyer5656 avatar Sep 20 '24 15:09 destroyer5656

This was done in #2365

laduke avatar Feb 05 '25 18:02 laduke