This article is a mirror article of machine translation, please click here to jump to the original article.

View: 171|Reply: 0

[Source] WireGuard optimized MTU settings

[Copy link]
Posted on 2025-11-28 09:30:10 | | | |
MTU

MTU stands for "Maximum Transmission Unit" and refers to the maximum packet size that can be transmitted on a network, measured in bytes. It is often associated with communication interfaces such as network interface cards. If a packet is larger than the MTU of a link, it will be split into smaller fragments to pass through, a process called "sharding". The size of the MTU requires a trade-off between transmission efficiency and latency.

In a network, maximum transmission unit (MTU) refers to the value of the maximum packet that can be received through a networked device. Think of MTU as a height limit for a highway underpass or tunnel: cars and trucks above the height limit cannot pass through it, just as packets exceeding the network MTU cannot pass through that network.

However, unlike cars and trucks, packets exceeding the MTU can be broken down into smaller fragments that can travel through the network. This process is called sharding. The sharded packets are reassembled as soon as they reach their destination.

MTU is measured in bytes, and one "byte" is equal to 8 bits of information, which is 8 ones and zeros. 1,500 bytes is the maximum MTU size.

Use PowerShell to view the MTU value of the current network interface with the following command:
As shown below:



MTU value for WireGuard

In simple terms,The default MTU size for WireGuard is 1420。 Typically, this value applies to 95% of use cases. However, there are a few factors to consider when the environment is more complex and involves multi-hop transmission. So, how do you calculate MTU correctly? This is a difficult problem because everyone needs to decide according to their own situation. Read on.



MTU composition technical information

First, we need to determine what type of internet connection we are using: DSL, VDSL, or wired internet? So, here is the basic information:

DSL and VDSL have a maximum MTU of 1492;
The maximum MTU for wired internet is 1500.

These are the requirements of our German network service provider. ISPs can't accept larger packets anyway.
Now I'll list the packet header sizes required for WireGuard and VPN.

IPv4 VPN – 20 bytes;
IPv6 VPN – 40 bytes;
UDP – 8 bytes;
WireGuard – 32 bytes

With this information, you can calculate the appropriate MTU size. I will give you a typical example and an uncommon one.

Example 1:

The starting point is a cable connection with a maximum MTU of 1500, which is equipped with an IPv4 connection.

1500 – 20 bytes (IPv4) – 8 bytes (UDP) – 32 bytes (WG) = 1440 bytes

This leaves 1440 bytes for the data area, and the default value of 1420 is very suitable.

Example 2:

The starting point is a DSL connection with a maximum MTU of 1492, which is equipped with an IPv6 connection.

1492 – 40 bytes (IPv6) – 8 bytes (UDP) – 32 bytes (WG) = 1412 bytes

As a result, the data area will have 1412 bytes left, and the default value of 1420 is not suitable.

In example 2, the packet will be detached, resulting in sharding. This can consume resources, resulting in a significantly slower connection speed. However, with IPv6, the connection speed becomes very fast.

When using IPv6, some routers require a minimum MTU size of 1280 bytes. Therefore,If you are using IPv6, do not set the MTU below 1280 bytes

If you work in a complex environment involving multiple NAT and/or routers, then more header information may be added to the packet. This will undoubtedly make the calculations more complicated. Wireshark can help a lot here, as it allows you to see if packets are split.

Why not start with an MTU size of 1300 bytes and work your way up to 1420 bytes?Many users have reported that 1380 bytes is ideal for them

Windows test mtu command with ping:
As shown below:



WireGuard configures the values for the MTU as follows:

Reference:

The hyperlink login is visible.
The hyperlink login is visible.
The hyperlink login is visible.
The hyperlink login is visible.
The hyperlink login is visible.




Previous:MikroTik (5) RouterBOARD firmware upgrade
Next:NAT (Network Address Translation) Network Address Translation
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com