Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

5 Answers

up vote 3 down vote accepted

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.

share|improve this answer
add comment

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.

share|improve this answer
    
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... –  mechko Jul 11 '10 at 12:00
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.