From ef97e765c1c507588d1b8e3a64032874364be194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20K=C3=BCthe?= Date: Tue, 24 Jan 2023 12:11:36 +0100 Subject: [PATCH] seperate wg and udp header --- docs/tunneling/wireguard.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/tunneling/wireguard.md b/docs/tunneling/wireguard.md index 2483e0d..8316b77 100644 --- a/docs/tunneling/wireguard.md +++ b/docs/tunneling/wireguard.md @@ -128,8 +128,10 @@ The MTU for WireGuard is calculated from the following components: - IP header - For IPv4 20 Bytes - For IPv6 40 bytes +- UDP header + - This is a constant 8 bytes - WireGuard header - - This is a constant 40 bytes. + - This is a constant 32 bytes So if the Clearnet connection has an MTU of 1500, the tunnel MTU when tunneling over IPv4 is 1440 and for IPv6 it is 1420. This has been taken into account in WireGuard, so the default MTU of WireGuard is 1420. This means that WireGuard can be tunneled over IPv4 or IPv6 without worry. However, if you are sure that you want to tunnel over IPv4 and you want a higher packet size, you can set the MTU to 1440. On the other hand, if the Clearnet interface has a lower MTU than 1500, you should lower the WireGuard MTU to avoid bugs and IP fragmentation. When using wg-quick, you can adjust the MTU with the following statement under `[Interface]` in the configuration file: