Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Set MTU Size from Mac OS X Command Line

· 6 min read · Home Tech

In this article
  1. What MTU Means and Why It Matters
  2. Checking Your Current MTU
  3. Changing the MTU Temporarily
  4. Making the MTU Change Permanent
  5. Choosing the Right MTU Value
  6. Common Problems and Misconceptions
  7. Alternatives to ifconfig
  8. Safety and Reverting Changes
  9. Frequently Asked Questions

You can set the MTU (Maximum Transmission Unit) size from the Mac OS X command line using the ifconfig utility with the mtu parameter, for example: sudo ifconfig en0 mtu 1400. This command changes the MTU immediately, but the setting resets after a reboot or network reconnection unless you make it persistent.

What MTU Means and Why It Matters

MTU stands for Maximum Transmission Unit. It is the largest size, in bytes, of a single packet that can be sent over a network interface without needing to be fragmented. Standard Ethernet uses an MTU of 1500 bytes, while PPPoE connections (common with DSL) often require 1492. Loopback interfaces use 65536.

If the MTU is set too large for a given network path, packets get dropped or fragmented, causing slow speeds, timeouts, or complete connection failures. If it is set too small, throughput drops because every packet carries the same header overhead. Finding the right MTU is a balance between efficiency and compatibility.

Checking Your Current MTU

Before changing anything, see what your interface is currently using. Run:

ifconfig en0 | grep mtu

This shows the MTU for the Wi-Fi or Ethernet interface (en0 is typically the first built-in network adapter). To list all interfaces at once, use ifconfig -a and look for the mtu field on each block.

Changing the MTU Temporarily

The basic command requires root privileges because it modifies a system network setting. Replace en0 with your interface name and 1400 with your desired value:

sudo ifconfig en0 mtu 1400

After running this, verify it took effect:

ifconfig en0 | grep mtu

This change is immediate but not permanent. It will revert to the default when you restart the Mac, toggle the network interface off and on, or reconnect to a different network. For a quick test—such as trying to fix a VPN or gaming issue—this is the fastest approach.

Making the MTU Change Permanent

To make the setting survive reboots, you have two practical options. The first is a launch daemon that runs the command at startup. Create a file named com.local.mtu.plist in /Library/LaunchDaemons/ with a ProgramArguments array that calls /sbin/ifconfig with your interface and MTU. Load it with:

sudo launchctl load /Library/LaunchDaemons/com.local.mtu.plist

The second option is a network location-specific setting. In System Settings (or System Preferences on older macOS), go to Network, select your interface, click Details, then TCP/IP or Hardware, and look for a "Configure" drop-down that lets you set MTU manually. This method is easier to manage but may not expose the option on every interface type or macOS version.

Choosing the Right MTU Value

There is no single correct MTU for all situations; it depends on your network path. Here is a practical process:

  1. Start with the default 1500 for Ethernet or 1492 for PPPoE.
  2. Test with a ping that sets the "do not fragment" flag and a payload size. On macOS, use ping -D -s 1472 8.8.8.8 (1472 payload + 28 bytes of ICMP/IP headers = 1500 total). If it fails, lower the payload size by 10 and retry.
  3. Find the largest size that succeeds consistently. Add 28 back to get your ideal MTU.
  4. Apply that value with the ifconfig command and test real traffic (browsing, streaming, VPN) before making it permanent.

Common values: 1500 (standard Ethernet), 1492 (PPPoE), 1400 (many VPNs), 1280 (IPv6 minimum). For VPN connections, the VPN software often recommends a lower MTU to accommodate its own encapsulation overhead.

Common Problems and Misconceptions

One frequent mistake is confusing MTU with packet payload. When you ping, the -s flag sets the payload size, not the total packet size. The total is payload plus 28 bytes for ICMP and IP headers. So to test an MTU of 1500, you ping with a payload of 1472.

Another issue is that ifconfig changes may not apply to all traffic. macOS uses a routing table and sometimes a separate path for certain services. If a VPN is active, the VPN interface (often utun0) has its own MTU, and changing en0 may not affect the encrypted tunnel. You may need to change the MTU on the tunnel interface instead, or adjust the VPN client's settings.

A third misconception is that a larger MTU always means faster speeds. In practice, the benefit is tiny on modern connections. The real problem is when the MTU is too large for a link, causing packet loss and retransmissions that dramatically hurt performance. If you are not experiencing specific issues, leaving the default is usually the best choice.

Alternatives to ifconfig

While ifconfig is the classic tool, macOS also includes networksetup, which can manage some network settings but does not directly expose MTU on all versions. The System Settings GUI is the safest alternative for permanent changes. For advanced users, pfctl (packet filter) can manipulate packets but cannot change the interface MTU itself.

Third-party tools exist that wrap these commands into a menu-bar app, but they all ultimately call the same underlying ifconfig or system APIs. Using the command line directly gives you full control and works on any Mac without installing extra software.

Safety and Reverting Changes

Changing MTU is low-risk, but a wrong value can temporarily break network connectivity. If you set an MTU that is too small, you will see slower speeds but still have a connection. If you set one that is too large, packets may be silently dropped, causing timeouts. To revert, simply run:

sudo ifconfig en0 mtu 1500

Or reboot the Mac. The change is not persistent by default, so a restart always restores the original setting. For permanent changes via a launch daemon, keep a backup of the plist file and know how to remove it (sudo launchctl unload and delete the file) if you need to undo it.

Frequently Asked Questions

Does changing MTU require a reboot?

No. The ifconfig command applies the change immediately. However, active connections may need to be re-established, and the setting will not survive a reboot unless you make it persistent with a launch daemon or the GUI.

What is the default MTU on macOS?

For Ethernet and Wi-Fi interfaces, the default is 1500 bytes. Loopback is 65536. If you use PPPoE, the default is usually 1492. You can check with ifconfig.

Why would I need to lower my MTU?

The most common reasons are VPN connections that add encapsulation overhead, PPPoE DSL links, or network paths with a lower maximum packet size. Symptoms of an oversized MTU include slow browsing, stalled downloads, or inability to load certain websites while others work fine.

Can I set MTU per Wi-Fi network?

Yes, but not directly with ifconfig. You can create a separate network location in System Settings, assign a different MTU to each location, and switch locations when you join different networks. This is more complex than a single global setting but gives you per-network control.

Does a lower MTU affect gaming or streaming?

It can, but usually not significantly. A lower MTU means more packets for the same data, increasing overhead slightly. For gaming, latency is more affected by routing than MTU. For streaming, a stable connection matters more than a few bytes of overhead. Only change MTU if you have a specific problem that testing suggests is MTU-related.

Is there a way to test MTU without ping?

Yes. You can use traceroute with the -m flag to set the max TTL, but ping with the do-not-fragment flag is the standard method. Alternatively, try transferring a large file and see if it completes without errors, though this is less precise for finding the exact maximum.