From e8bd70341a3760f4a7b168f0a524e62a170eeb56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Fri, 4 Jul 2025 10:29:55 +0800 Subject: [PATCH] Increase default mtu under network extension to 4064 --- protocol/tun/inbound.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/protocol/tun/inbound.go b/protocol/tun/inbound.go index 96520eb4..e028a9de 100644 --- a/protocol/tun/inbound.go +++ b/protocol/tun/inbound.go @@ -134,7 +134,8 @@ func NewInbound(ctx context.Context, router adapter.Router, logger log.ContextLo tunMTU := options.MTU if tunMTU == 0 { if platformInterface != nil && platformInterface.UnderNetworkExtension() { - tunMTU = 4000 + // In Network Extension, when MTU exceeds 4064 (4096-UTUN_IF_HEADROOM_SIZE), the performance of tun will drop significantly, which may be a system bug. + tunMTU = 4064 } else { tunMTU = 9000 }