- How to Change MTU Value on Mac?
- Set MTU Size from the Command Line of Mac OS X
- How to Get Current MTU Size on Mac via Command Line
- How to Change MTU Size on Mac by Command Line
- Установите размер MTU из командной строки Mac OS X
- Как получить текущий размер MTU на Mac через командную строку
- Как изменить размер MTU на Mac с помощью командной строки
- ▷ Установите размер MTU из командной строки Mac OS X
- Manually Managing MTU Size in Mac OS X
- To determine your network’s MTU:
How to Change MTU Value on Mac?
To set the best MTU value and optimize Internet speed, please perform the following steps:
1 Open “Terminal”
2 Type the command below and hit enter. Here we are reducing the MTU value to fix MTU mismatch between VPN server and client connection.
If the reply you get is “ping: sendto: Message too long”, then you have to try a lower MTU value. Keep decreasing the value by 10, i.e. 1490, 1480, 1470 until you get a successful reply.
3 Start increasing the MTU value with small increments after you get a successful reply. Eventually, you will arrive on a value on which packets will not fragment, add 28 to that value (IP / ICMP headers).
For instance, if you got the last successful reply on 1470, then add 28 to it, 1470+28 = 1498.
4 This number is your MTU value.
5 Click the “Apple” icon located at the top left corner of your screen and select “System Preferences…”.
6 Click “Network”
7 Select active internet connection i.e. Ethernet or Wifi and click “Advanced…”
8 Click “Hardware” and select “Manually” from the “Configure” drop down menu.
9 Select “Custom” from the MTU drop down menu.
10 Input the MTU value here, and click “OK” and “Apply”.
Recommended: For VPN connection please try MTU 1200, although it is not necessary this number yields better results to avoid MTU mismatch as explained in step 2.
Please use the comment box for your suggestions & feedback. For additional help, please submit support ticket with errors and screenshots (if possible) or contact our 24/7 live chat.
Источник
Set MTU Size from the Command Line of Mac OS X
MTU stands for Maximum Transmission Unit, and a larger MTU size generally increases efficiency of a network connection because each packet carries more data, but sometimes the default MTU sizes (often 1500) will cause issues with some networks and needs adjusting. If you need to change the MTU size on a Mac, you can do so through the command line, as well as through the System Preference panel. We’ll focus on setting MTU size from the command line in this particular walkthrough.
Changing the MTU size has been a helpful solution to some dropping wi-fi connections in OS X and Mac OS, particularly when the standard troubleshooting protocol of deleting the wireless pref files hasn’t worked to resolve stubborn wi-fi issues.
If you’re in a situation where you need to change the transmission unit size, you can do so easily through the Mac command line by way of the ever-useful networksetup utility. It’s probably important to note that most users will never need to adjust this setting, making this a more advanced tip. Let’s start with getting the current MTU size from the command line on a Mac, then move on to setting a new MTU size.
How to Get Current MTU Size on Mac via Command Line
To see the current MTU size, use the following networksetup flag, pointing it at the network interface like so:
networksetup -getMTU en1
Unless it has been changed, the default MTU size in Mac OS X is 1500 and will be reported back like so:
Active MTU: 1500 (Current Setting: 1500)
As 1500 is the default, we’re going to change the MTU size.
How to Change MTU Size on Mac by Command Line
To change and set a new MTU size, you can use the -setMTU flag with the networksetup command line, then choose the interface, and provide a new MTU size, like so:
networksetup -setMTU en0 1453
en0 in this case is the wi-fi interface of a MacBook Air without an ethernet port, and 1453 is the MTU setting chosen for the example because it’s the magic number that resolved a persistent wireless dropping problem with some Macs.
You can verify the change took place by using the -getMTU flag again to verify the number.
For the change to actually take effect, you will probably want to cycle the wi-fi connection off and on which can also be done through networksetup at the command line, or through the wi-fi dropdown menu on a Mac, though that isn’t always necessary.
Источник
Установите размер MTU из командной строки Mac OS X
MTU означает Максимальный блок передачи, а больший размер MTU обычно увеличивает эффективность сетевого подключения, поскольку каждый пакет несет больше данных, но иногда размеры MTU по умолчанию (часто 1500) вызывают проблемы с некоторыми сетями и требуют настройки. Если вам нужно изменить размер MTU на Mac, вы можете сделать это через командную строку, а также через панель системных настроек. В этом конкретном пошаговом руководстве мы сосредоточимся на установке размера MTU из командной строки.
Изменение размера MTU было полезным решением некоторых проблем с разрывом Wi-Fi-соединений в OS X и Mac OS, особенно когда стандартный протокол устранения неполадок, заключающийся в удалении файлов pref для беспроводной сети, не помог решить устойчивые проблемы с Wi-Fi.
Если вы находитесь в ситуации, когда вам нужно изменить размер блока передачи, вы можете легко сделать это через командную строку Mac с помощью всегда полезной утилиты настройки сети. Вероятно, важно отметить, что большинству пользователей никогда не потребуется настраивать этот параметр, что делает этот совет более сложным. Начнем с получения текущего размера MTU из командной строки на Mac, а затем перейдем к установке нового размера MTU.
Как получить текущий размер MTU на Mac через командную строку
Чтобы увидеть текущий размер MTU, используйте следующий флаг настройки сети, указав его на сетевой интерфейс следующим образом:
networksetup -getMTU en1
Если он не был изменен, размер MTU по умолчанию в Mac OS X составляет 1500 и будет сообщаться следующим образом:
Active MTU: 1500 (Current Setting: 1500)
Поскольку значение по умолчанию составляет 1500, мы собираемся изменить размер MTU.
Как изменить размер MTU на Mac с помощью командной строки
Чтобы изменить и установить новый размер MTU, вы можете использовать флаг -setMTU в командной строке networksetup, затем выбрать интерфейс и указать новый размер MTU, например:
networksetup -setMTU en0 1453
en0 в данном случае — это интерфейс Wi-Fi MacBook Air без порта Ethernet, а 1453 — это настройка MTU, выбранная для примера, потому что это магическое число, которое решило постоянную проблему отключения беспроводной сети на некоторых компьютерах Mac.
Вы можете проверить, что изменение имело место, снова используя флаг -getMTU, чтобы проверить номер.
Чтобы изменение действительно вступило в силу, вы, вероятно, захотите выключить и включить соединение Wi-Fi, что также можно сделать с помощью настройки сети в командной строке или через раскрывающееся меню Wi-Fi на Mac, хотя это не так. т всегда необходимо.
Источник
▷ Установите размер MTU из командной строки Mac OS X
MTU означает Максимальный блок передачи , а больший размер MTU обычно увеличивает эффективность сетевого подключения, поскольку каждый пакет несет больше данных, но иногда размеры MTU по умолчанию (часто 1500) вызывают проблемы с некоторыми сетями и требуют корректировки. Если вам нужно изменить размер MTU на Mac, вы можете сделать это через командную строку, а также через панель системных настроек. В данной презентации мы сосредоточимся на установке размера MTU из командной строки.
Изменение размера MTU было полезным решением для прерывания некоторых подключений Wi-Fi в OS X и Mac OS, особенно когда стандартный протокол устранения неполадок удаления файлов настроек беспроводной сети не сработал. Решил упорные проблемы с Wi-Fi.
Если вам нужно изменить размер передающего устройства, вы можете легко сделать это через командную строку Mac, используя всегда полезную утилиту настройки сети. Вероятно, важно отметить, что большинству пользователей никогда не потребуется настраивать этот параметр, что делает этот совет более сложным. Начнем с получения текущего размера MTU из командной строки на Mac, а затем перейдем к установке нового размера MTU.
Как получить текущий размер MTU на Mac через командную строку
Чтобы узнать текущий размер MTU, используйте следующий индикатор конфигурации сети, направив его на сетевой интерфейс следующим образом:
networksetup -getMTU en1
Если не изменить, размер MTU по умолчанию в Mac OS X составляет 1500 и будет сообщаться как таковой:
Активный MTU: 1500 (текущая настройка: 1500)
Поскольку значение по умолчанию составляет 1500, мы собираемся изменить размер MTU.
Как изменить размер MTU на Mac с помощью командной строки
Чтобы изменить и установить новый размер MTU, вы можете использовать флаг -setMTU в командной строке networksetup, затем выбрать интерфейс и указать новый размер MTU, например:
networksetup -setMTU en0 1453
en0 в данном случае — это интерфейс Wi-Fi MacBook Air без порта Ethernet, а 1453 — это параметр MTU, выбранный для примера, потому что это было магическое число, которое исправляло постоянную проблему отбрасывания беспроводного потока на некоторых компьютерах Mac.
Вы можете убедиться, что изменение имело место, снова используя флаг -getMTU, чтобы проверить номер.
Чтобы изменение вступило в силу, вы, вероятно, захотите выключить и включить соединение Wi-Fi, что также можно сделать через конфигурацию сети в командной строке или через раскрывающееся меню Wi-Fi на Mac, хотя это не всегда может быть необходимо.
Источник
Manually Managing MTU Size in Mac OS X
MTU stands for “Maximum Transmission Unit.” Whenever you transmit and receive data in Mac OS X, the data is broken up into smaller pieces (called packets) and then reassembled on the other end of the connection. Think of it like a jigsaw puzzle: You go to the store to find a puzzle, and they come in different sizes, ranging from 20-10,000 pieces. Everyone knows that the more pieces you need to put the picture back together, the longer it takes. The same thing is true with computer data.
Suppose, you want to download a song from the iTunes Music Store. Or you’ve come across a freshly released movie that you planned to watch this Friday night. Or you want to save on your computer an audio or video guide containing advice to help with personal statement writing. Naturally, you want to get all of these things as quickly as possible. And as you increase the amount of data in a packet, you decrease the number of packets iTunes needs to transmit, which reduces the time it takes to receive the file. That’s great until you tell the computer to transmit packets larger than your ISP can handle. If your ISP can handle 1500 bytes, but you specify 1800 bytes, you might get the 1500 bytes, but then your computer has to tell iTunes, “Hey, I didn’t get those other 300 bytes. Please resend them.” iTunes sends the data, but it has to do so in a new packet, which means it takes longer to get all the data to your computer.
Determining the MTU for your current network is not difficult, but it is a matter of trial and error. There are some caveats. First, each network has its own MTU, so your home network may be different from work and from the local coffee shop. Thus, if you set a custom MTU and then change networks, you probably need to change the MTU to match the new network. Second, the standard MTU size for Ethernet/AirPort connections is 1500. For Ethernet DSL (PPPoE), it is 1492. Third, it is unlikely your MTU size is greater than 1500 or lower than 1400, but feel free to experiment with different values.
When you want to be able to manually set your MTU size, you must first open System Preferences, then the Network system preference. When that preference opens, select the network interface you use to connect to the Internet (likely Ethernet or Wi-Fi), and then press the “Advanced” button in the lower right corner of the window. When the Advanced window appears, you can then click on the “Hardware” tab (or the “Ethernet” tab if you’re running Snow Leopard or earlier). This is the section where you can edit the MTU value. Mac OS X can already determine your network’s proper MTU, so only adjust this setting if you are experiencing persistent slowdowns, especially when attempting to download files. Read on to determine your ideal MTU value.
Mac OS X can already determine your network’s proper MTU, so only adjust this setting if you are experiencing persistent slowdowns, especially when attempting to download files.
To determine your network’s MTU:
- Open Terminal (in your Utilities folder). You are going to “ping” another server. This means you are going to send another server a little bit of data and ask it to respond to you. It is the equivalent of tapping someone on the shoulder, except in this metaphor, you get no response when you tap someone too hard (or send a packet that is too large).
- Type this command and press Return:
ping -c 2 -D -s 1472 example.com
- The -c switch tells ping how many packets to send. I chose to specify two packets. You could choose 1 or 100 or even eliminate this switch to ping endlessly (not recommended, but if you do this and need to stop the ping, hold down the Control key and press the letter “C”).
- The -D switch tells ping not to fragment the packet (meaning that if the size of the packet is too large, don’t send it at all).
- The -s switch allows you to specify the size of the packet in bytes. That is what the 1472 next to the -s switch. This is important: Any ping that you do via the above method adds 28 bytes of overhead to the ping. This means you must add 28 bytes to the size of your packet to get the packet’s true size. In the above example, we pinged example.com with 1472 bytes. Add 28 to that number, and you get 1500. If 1472 is the largest packet you can successfully send, then your MTU value is 1500. If the largest packet you could send were 1464, then your packet size would be 1492.
- When you run the above command, ping can give you two different replies:
ping: sendto: Message too long
If you get a response that the message is too long, that means the packet size is too large and must be reduced.
1480 bytes from 208.77.188.166: icmp_seq=0 ttl=46 time=185.42 ms
- The above line is the other reply you may receive from ping, and it indicates a successful ping. Your response may look slightly different: the IP address may change, the time it takes to ping may change, etc. The point is that this line looks very different from the “message too long” line. If you ran the exact command from above, you should see either two successful pings or two failed pings, since the -c switch was set to
- In fact, at the end of the ping process, you may see a statistics line that shows either 0% packet loss or 100% packet loss (0% means every packet went through, 100% means none of the packets did).
- Your goal is to continually increase the packet size in the ping request until you receive a “message too long” reply (or, if you are only receiving those messages, lower it until you can successfully ping a server). Add 28 to the largest packet size you can successfully ping, and this is your MTU. To manually set your MTU in the “Hardware” tab of the Advanced window in the Network system preference, change the “Configure” pop-up menu form “Automatically” to “Manually.” Then, switch the “MTU” pop-up menu from “Standard” to “Custom.” Finally, enter your MTU in the box that appears and click OK to save your settings.
Did this guide work for you? How important do you feel it is to edit the MTU value? How has it affected your network performance? Let others know in the comments.
Источник