ObjectiveConfigure Linux to use jumbo frames.
DistributionsThis will work with any Linux distribution.
RequirementsA working Linux install with network connectivity and root privileges.
- # - requires given command to be executed with root privileges either directly as a root user or by use of
- $ - given command to be executed as a regular non-privileged user
IntroductionAre file transfers slow on your network? Are you constantly passing data between your computers? Well, maybe jumbo frames are for you.
Jumbo frames are larger than standard network packet payloads. Normally the payload size or MTU(Maximum Transfer Unit) is set to 1500 bytes. Jumbo frames can support to 9000 bytes per packet.
Jumbo frames decrease the overhead associated with transferring files by limiting the number of packets that your networking equipment needs to process.
Set Up Your NetworkFor jumbo frames to work properly, every device on your network should be configured to use them. That said, if they don't it's not the end of the world. A device that doesn't support them will just break up the packets when they arrive. You should, at very least, configure your router and any switches on your network to use them.
A lot of routers have settings that allow you to change the MTU size. It's in a different place on every router, but it usually appears in a general settings tab that controls the entire device or network.
When you find it, set it to a value that you think all of your devices can support. Remember, the upper limit for jumbo frames is 9000 bytes.
Check Your MTU sizeNow that your network supports jumbo frames, check what your computer is set to. It's probably 1500 bytes, since that's the default, but it's good to make sure.
Everything here is going to be handled with the
ipcommand. So, use it to check the MTU size allowed by your network interfaces.
$ ip link show | grep mtuThe numbers directly after the
mtuis the value you're looking for.
Set A New SizeSetting the MTU size is really easy with
ip. You just need to tell it which interface you want to modify and the size you want to set it to.
# ip link set eth0 mtu 9000You can set every interface on your computer, if your hardware supports it.
# ip link set wlan0 mtu 9000
Make It PermanentThere are a couple of different ways you can make the new MTU size permanent. There is no specific utility for it, but the easiest thing you can do is create a script that runs at startup to set the MTU. If you're very comfortable working with systemd, you can change the network files it supplies to change the default MTU as well.
Your script should look something like this:
If you're on systemd, create a simple unit, and set it to run at startup.
#! /bin/bash ip link set eth0 mtu 9000; ip link set wlan0 mtu 9000;
OpenRC users can place their script in
/etc/init.d/, and run it as a service at default.