8

Recently (I think after updating to 10.6.4) Mac OS X has insisted on changing my MTU to 1500, even though the router which my Mac connects to directly has an MTU of 1472. I've noticed that manually setting the MTU to 1472 drastically increases performance, presumably because it all but eliminates packet fragmentation, but Mac OS X periodically changes the MTU back to 1500.

Does anyone know why or how to stop it?

5 Answers 5

7

You can turn off the automatic discovery of MTU size on Mac OS X with this :

  • Session only :

sudo sysctl -w net.inet.tcp.path_mtu_discovery=0

  • Permanent :

    • Edit the file /etc/sysctl.conf, for example :

      sudo nano /etc/sysctl.conf

    • Then add the following line :

      net.inet.tcp.path_mtu_discovery=0

    • Finally reboot

This will prevent Mac OS X from automatically setting the MTU size, but you'll still need to setup your size manually.

4

A band-aid solution could be to run the following Terminal command (or run it via AppleScript) everytime you log in:

sudo networksetup -setMTU en1 1472

This won't fix the underlying issue of the MTU reseting. I suggest reporting the bug to Apple via BugReporter.

3

Unfortunately, you did not mention how you set the MTU. Did you already try this?

Mac OS X 10.4 or later: How to change the MTU for troubleshooting purposes

It's the official way to set a non-standard MTU persistently.

1
  • That is in fact what I did. I have not had this problem before 10.6.4, though I updated at the same time that I fiddled with my router, so perhaps I stopped broadcasting my MTU... Jul 11, 2010 at 12:00
2

I set the MTU using the ifconfig command.

ifconfig en0 mtu=1492 

You have to use your own adapter id, mine is en0.

This is the only way it would stay at the set rate. I tried using the "official" method and it always immediately reverted.

I also used the command above to stop using automatic:

net.inet.tcp.path_mtu_discovery=0

I tried it both ways and I had to go to manual in order for this to work.

1
  • On macOS Mojave 10.14.2 you can change the mtu with sudo ifconfig ipsec0 mtu 1400
    – abuzze
    Dec 17, 2018 at 9:28
1

I have been doing some network testing here on osx 10.6.7 and discovered that the mtu was always falling to 1500. The Solution here was to turn ON the auto discovery in osx and make sure the router is set to the desired mtu and not auto.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .