---
title: "MTU and MSS Clamping Over VPN Explained"
url: "https://astraguardvpn.com/blog/mtu-and-mss-clamping-over-vpn-explained"
description: "Learn how to configure MTU and MSS clamping over VPN to prevent fragmentation using ping -s for testing."
updated: "2026-07-20T09:00:13.935Z"
---

# MTU and MSS Clamping Over VPN Explained

Understand how to configure MTU and MSS clamping over VPN with examples and testing steps using ping -s.

Technical Background When transmitting data over a VPN (Virtual Private Network), understanding MTU (Maximum Transmission Unit) and MSS (Maximum Segment Size) is crucial to ensure efficient and error-free communication. The MTU is the largest size a packet can be for transmission, while MSS is the largest segment of TCP (Transmission Control Protocol) data that can be sent in a single packet. Fragmentation occurs when packets are too large for the network path, leading to inefficiencies and potential data loss. MTU issues often manifest as connectivity problems or degraded performance. By correctly setting MTU and MSS values, you can avoid fragmentation, which occurs when packets exceed the MTU and are split into smaller pieces. This splitting process can induce latency and packet loss, particularly in VPNs where additional headers increase packet size. MSS clamping is a technique used to adjust the MSS value to prevent fragmentation. By clamping the MSS, you ensure that the TCP segment size is optimal for the MTU, preventing the need for packet fragmentation. Step By Step Before you start, ensure you have administrative access to your VPN server and sufficient privileges to modify network settings. Additionally, verify that any changes won’t disrupt ongoing network operations. 1. Identify the current MTU size using a ping test: - Windows: Open Command Prompt and type `ping -f -l 1472 `. Adjust the number until you find the largest packet size without fragmentation. - Linux: Use `ping -M do -s 1472 `, adjusting the size as needed. 2. Determine the appropriate MSS value by subtracting 40 from the MTU size (20 bytes for the IP header and 20 bytes for the TCP header). 3. Configure MSS clamping on your VPN server: - For OpenVPN, add `mssfix ` to the server configuration file. - Restart the VPN service to apply changes. Worked Example Example: Identifying MTU and configuring MSS clamping Command: ping -f -l 1472 10.8.0.2 Command: ping -M do -s 1472 10.8.0.2 Suppose your MTU test results in a successful packet size of 1452 bytes. Subtracting 40 gives an MSS of 1412. Add `mssfix 1412` to your OpenVPN configuration file. Configuration Or Command Reference - `mssfix ` — Sets the MSS value to avoid fragmentation. - `ping -f -l ` — Tests MTU size on Windows. - `ping -M do -s ` — Tests MTU size on Linux. - `ifconfig` — Displays current network configuration, including MTU. - `netsh interface ipv4 show subinterfaces` — Displays MTU on Windows. Troubleshooting - Symptom: VPN connection drops frequently. Likely Cause: MTU size too large. Fix: Reduce MTU size using ping test. - Symptom: Slow VPN performance. Likely Cause: Fragmentation due to incorrect MSS. Fix: Adjust MSS using mssfix in VPN configuration. - Symptom: Inability to browse certain websites over VPN. Likely Cause: MTU/fragmentation issues. Fix: Verify and adjust MTU/MSS settings. Related Concepts And Further Reading - TCP/IP Stack - Network Fragmentation - VPN Protocols - OpenVPN Configuration - ICMP (Internet Control Message Protocol) Key Takeaways • MTU and MSS are critical for optimizing VPN performance. • Incorrect settings can lead to fragmentation and reduced efficiency. • Use ping tests to identify optimal MTU size. • Apply MSS clamping to prevent packet fragmentation. • Regularly review and test network settings for changes. FAQ Q: What is the difference between MTU and MSS? A: MTU is the largest packet size a network can handle, while MSS is the largest TCP segment size. Q: How can I test my current MTU size? A: Use the ping command with the `-f` flag on Windows or `-M do` on Linux. Q: Why is MSS clamping necessary? A: MSS clamping helps prevent fragmentation, improving network performance over VPNs.

---

[More articles](https://astraguardvpn.com/blog) · [VPN plans](https://astraguardvpn.com/packages)
