Configuring MTU to Improve WireGuard VPN Connectivity
UniFi Identity Enterprise allows you to customize the Maximum Transmission Unit (MTU) to enhance VPN performance across various network conditions. This article guides you through adjusting MTU settings in the UniFi Identity Enterprise desktop app on macOS and Windows, helping you avoid packet loss, reduce fragmentation, and improve connection reliability. If you're looking to configure One-Click VPN, click here.
What is MTU?
MTU defines the largest size (in bytes) a data packet can be when sent over a network. If a packet is too large for the network to handle, it must be split into smaller pieces (fragmented), which can slow down communication or cause packet loss.
The default MTU for WireGuard VPN is 1280 bytes for Windows or macOS. If the WireGuard VPN connection stops working, a lower value can improve connectivity when your network path can’t transmit larger VPN packets.
Imagine you're sending data like packing items into a delivery truck. Each truck has a size limit, which represents the MTU. If the data is too large, it needs to be split into multiple trucks, or parts of it might not make it to the destination. By using a smaller MTU, you help ensure that each packet fits within the network's limits and arrives without issues.
Why You May Need to Change It
When the MTU value set in the VPN is larger than what your network supports, you may encounter:
- Packet fragmentation
- Dropped packets
- Slow or unstable VPN performance
Lowering the MTU can help prevent these issues by ensuring your data packets are small enough to be transmitted smoothly across the entire network path.
Requirements
How to Customize MTU
Changing the MTU will cause the WireGuard VPN to reconnect if it’s already connected.
- Go to your Identity Enterprise macOS or Windows desktop app > Settings > Maximum Transmission Unit (MTU) > Custom > MTU.
- Enter a value based on your network:
- 1280 bytes is a reliable starting point for most environments.
- Try lower values (e.g., 1200 or 1100) if you're on mobile networks or experiencing dropped connections.
- Try reducing the MTU gradually until the connection stabilizes.
- Avoid going below platform-specific minimums:
- Windows WireGuard: 1280 bytes
- macOS WireGuard: 576 bytes
- Click Save.