Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

who is supposed to set interface MTU? #67

Open
elenril opened this issue Oct 29, 2021 · 4 comments
Open

who is supposed to set interface MTU? #67

elenril opened this issue Oct 29, 2021 · 4 comments

Comments

@elenril
Copy link

elenril commented Oct 29, 2021

I am trying to set up jumbo frames on (some subnets of) my home LAN (in order to reduce the router load for large
transfers) and I'm struggling to understand how to set the interface MTU without manually hardcoding it on every
machine. Apparently dhcpcd used to have a hook that did this, but it was removed in
ca6cdf5, with the replacement code only setting route MTU, which apparently has no
effect if the interface MTU is smaller.

Any hints on how the interface MTU is supposed to be set up properly? Hardcoding it is annoying and error-prone, ideally
something would just pick it up from RAs. Or are there any major disadvantages to that?

@rsmarples
Copy link
Member

The problem is that a lot of interfaces reset their PHY on MTU change whether through driver error or a hardware limitation.
This in turn triggers carrier down/up which isn't exactly desirable.
The other side effect is when different protocols want different MTU values (strikes me as weird, but it's how some setups work).
As such dhcpcd just changes the MTU at the route level as you now see.

The downside is that this won't allow jumbo frames.
There is also the issue where you change network from jumbo frames to non jumbo frames and there's nothing on the new network to say what the MTU size should be, expecting the interface default to just work.

I suppose we could add an option to increase the interface MTU if the procotol MTU is bigger and then reset it back to what it was when the carrier goes down OR dhcpcd exits. This would likely default to off though due the resetting PHY problem.

@elenril
Copy link
Author

elenril commented Nov 1, 2021 via email

@carsten-AEI
Copy link

As we are currently having issues with isc-dhcp-client, we looked at dhcpcd as a drop-in replacement for our largish cluster (Debian 11/Bullseye). We run several relatively static networks per machine and the "fast" 1/10/40Gbit/s network has been using L2 jumbo frames with MTU 9000 for 15 years now.

The DHCP server returns the MTU size for each client/interface (option 26 IIRC) and thus it would be nice to have a way for the local DHCP client to react to that "properly". Even if this was just an opt-in option, we would be very grateful for the addition :)

Anything from our side, we can help to get this feature?

@rsmarples
Copy link
Member

Sorry for the late reply.

You can create a hook script to set MTU based on the value returned by new_mtu and compare it to interface_mtu and optionally old_mtu.
It setting the MTU resets the PHY and causes a carrier reset you will need to add this to /etc/dhcpcd.conf

interface eth0
    nolink

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants