In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to modify the maximum transmission unit MTU under the Linux system". In the daily operation, I believe that many people have doubts about how to modify the maximum transmission unit MTU under the Linux system. The editor consulted all kinds of materials and sorted out a simple and easy-to-use method of operation. I hope it will be helpful to answer the doubt of "how to modify the maximum transmission unit MTU under the Linux system". Next, please follow the editor to study!
Maximum transmission unit (Maximum Transmission Unit,MTU) refers to the maximum big data packet size (in bytes) that can be passed above a layer of a communication protocol. The parameter of maximum transmission unit is usually related to the communication interface (network interface card, serial port, etc.).
The Internet protocol allows IP fragmentation so that the Datagram can be divided into segments small enough to pass through links where the maximum transmission unit is smaller than the original size of the Datagram. This fragmentation process occurs at the IP layer (the third layer of the OSI model, the network layer), which uses the value of the maximum transmission unit that sends the packet to the network interface on the link. The fragments of the original packet are marked so that the IP layer of the destination host can reassemble the packet into the original Datagram.
In Internet protocol, the "path maximum transmission unit" of an Internet transmission path is defined as the minimum value of all IP hops on the "path" from the source address to the destination address. Or from another point of view, it is the maximum value of the maximum transmission unit that can pass through this "path" without further fragmentation.
RFC 1191 describes the path maximum transmission unit discovery method, which is a technique for determining the path maximum transmission unit between two IP hosts in order to avoid IP fragmentation. In this technique, the source address takes the DF (Don't Fragment, do not fragment) bit of the Datagram, and then gradually increases the size of the Datagram sent-- any device on the path that needs to fragment the packet will discard the Datagram and return a "Datagram too large" ICMP response to the source address. The source host "learns" to the largest transmission unit that can pass through this path without slicing.
Unfortunately, more and more networks are blocking the transmission of ICMP (for example, to prevent DOS attacks)-this makes the path maximum transmission unit find that the method does not work properly, which is often shown by a connection that works at low data traffic, but hangs as soon as a large amount of data is sent at the same time (for example, when using IRC The customer will find that there is no response after sending a ping that forbids IP spoofing because the connection is blocked by a large number of welcome messages. Moreover, in a network using Internet protocol, the "path" from the source address to the destination address is often dynamically modified in response to a variety of events (load balancing, congestion, power outage, etc.)-which may cause the maximum transmission unit of the path to change during transmission-sometimes even repeatedly. As a result, more packets are lost while the host is looking for a new maximum transmission unit that can work safely.
For most Lans that use Ethernet nowadays, the value of the maximum transmission unit is 1500 bytes. But systems like PPPoE reduce this number, which makes it possible to use the maximum transport unit discovery method to produce the result that some sites behind poorly configured firewalls become unreachable. In this case, it is still possible to find workarounds, but it depends on which part of the network you control. These methods include changing the MSS (Maximum Segment Size, maximum segment size) of the first packet used to establish a TCP connection at one end of the firewall.
For some IBM systems that support older Ethernet protocols (such as XSeries), they may not be able to operate on today's common Lans until the maximum transmission unit is set to 1492.
The modification method of MTU is as follows:
1. Ifconfig command modification
[/ code]
Ifconfig ${Interface} mtu ${SIZE} up
Ifconfig eth2 mtu 9000 up
[/ code]
This is the most common approach and works for all linux distributions. The disadvantage is that it fails after reboot and needs to be loaded in the boot item.
2. Modify the configuration file
Under CentOS / RHEL / Fedora Linux
The code is as follows:
# vi / etc/sysconfig/network-scripts/ifcfg-eth0
# add the following
MTU= "9000"
# restart the Nic after saving it takes effect
# service network restart
# if IPv6 address is enabled, modify the parameter of IPv6 mtu to
IPV6_MTU= "1280"
Under Debian / Ubuntu Linux
The code is as follows:
# vi / etc/network/interfaces
# increase the following values
Mtu 9000
# after saving, restarting the network takes effect
# / etc/init.d/networking restart
3. Why the maximum MTU is 9000 bytes
Theoretically, a 4-bytes CRC supports a maximum of 12000 bytes bytes, beyond which there is no way to check. There are also restrictions on other protocols such as NFS.
Finally, it should be noted that when passing through the switched network equipment, it is not possible to just modify the MTU value of the host side, and it is also necessary to turn on the jumbo frames function on the switched network equipment.
4. MTU test
Using the ping command,-l specifies the packet size, and the-f option informs the operating system that the packet size cannot be changed privately
The prompt when using the English operating system is: Packet needs to be fragmented but DF set
At this point, the study on "how to modify the maximum transmission unit MTU under the Linux system" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.