ZeroTierOne icon indicating copy to clipboard operation
ZeroTierOne copied to clipboard

Managed MTU doesn't get applied.

Open laduke opened this issue 3 years ago • 10 comments

If you change a network's MTU, your interface still gets 2800, on Linux at least.

Leaving/Joining doesn't change it. If you restart zerotier-one, you get the network's value, but if you leave/join, it goes back to 2800.

Probably a netlink ordering thing.

laduke avatar Feb 02 '22 19:02 laduke

Actually, the fact that it's getting set to 2800 implies it's using the default instead of the network config


Some printf debugging

joining

constructor setting mtu 2800
setMtu setting mtu 2800
setMtu setting mtu 1320
setMtu setting mtu 1320

restarting zerotier (already joined)

constructor setting mtu 1320
setMtu setting mtu 1320
setMtu setting mtu 1320

so...
at case ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_UP: it thinks the mtu is the default/2800 when it calls EthernetTap::newInstance

and

the setMtu function isn't functioning to change the mtu on the fly.

laduke avatar Feb 08 '22 21:02 laduke

Hrmm, so for joining, it looks like zerotier is creating the interface with the default MTU before even receiving the network config?

glimberg avatar Feb 08 '22 21:02 glimberg

Assuming the network config is coming in correct, it should be correct on ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_UP

https://github.com/zerotier/ZeroTierOne/blob/269501eaa0c22bdc402e689b0d061325fb6ddbce/service/OneService.cpp#L2426

So the value is either cached incorrectly, or coming across the wire incorrectly sometimes

glimberg avatar Feb 08 '22 21:02 glimberg

https://github.com/zerotier/ZeroTierOne/blob/269501eaa0c22bdc402e689b0d061325fb6ddbce/node/Network.cpp#L587-L593

https://github.com/zerotier/ZeroTierOne/blob/269501eaa0c22bdc402e689b0d061325fb6ddbce/node/Network.cpp#L1390-L1400

-> on join, mtu is 2800

🐇

laduke avatar Feb 08 '22 23:02 laduke

Hi,

For me Setting mtu with local.config does not seem to work. Not sure if this is a different problem. (or I am not setting the mtu in the correct way)

sudo zerotier-cli info -j

gives

{
 "address": "1234567890",
 "clock": 1647550455798,
 "config": {
  "physical": {
   "72.28.0.0/16": {
    "mtu": 1200
   }
  },
  "settings": {
   "allowTcpFallbackRelay": true,
   "listeningOn": [
    "192.168.122.205/9993",
    "192.168.122.205/29994",
    "192.168.122.205/48689"
   ],
   "portMappingEnabled": true,
   "primaryPort": 9993,
   ...

But the actual mtu is 2800

Changing the mtu with ip link set does work but it is no persistent.

qt1 avatar Mar 17 '22 20:03 qt1

@qt1 MTU is not settable via local.conf. It's a network level option controlled by the network controller.

glimberg avatar Mar 17 '22 21:03 glimberg

@glimberg ,

How should I set it the mtu? I do not see any dhcp option in the UI and the link is controlled by ZT , but I didn't find a way to set it there. Can you please advise? (ubuntu 21.10)

Thanks

qt1 avatar Mar 17 '22 21:03 qt1

We don't recommend altering the default MTU, and as described above, there's currently an issue with it. That said, it is a modifiable field when using the https://my.zerotier.com API directly. We don't expose a way to do it in the UI.

glimberg avatar Mar 17 '22 21:03 glimberg

"We don't recommend altering the default MTU" Unfortunately my scenario is tunneling ssh via the machine, and this beaks with the default MTU. Known limitation of ssh (and also ipsec and co)

qt1 avatar Mar 17 '22 21:03 qt1

OK. Well this is still the wrong place to bring up something off the current topic. This issue is about MTU changes not being persisted on Linux boxes. For talking out specific use cases you can ask on our discussion board

glimberg avatar Mar 17 '22 21:03 glimberg

Closing this since it's fixed by #1860

joseph-henry avatar Jan 25 '23 21:01 joseph-henry