MikroTik WireGuard VPN MTU & MSS Calculator
Deploy site-to-site WireGuard VPN on RouterOS v7 with automatic TCP MSS Clamping to prevent tunnel web page freezes and PMTUD black holes.
Input Parameters
Calculation Results
- Link Encapsulation Type
- pppoe
- Effective MTU Size
- 1,480 Bytes
- IP Protocol Version
- ipv4
- IP Header Size
- 20 Bytes
- TCP Header Size
- 20 Bytes
- ICMP Header Size
- 8 Bytes
- Optimal TCP MSS Clamping Value
- 1,440 Bytes
- Max DF Ping Test Payload
- 1,452 Bytes
- Tunnel Encapsulation Overhead
- 20 Bytes
- Protocol Overhead Breakdown
- PPPoE Standar ISP Fiber / DSL (8–20 Byte Header)
- Public WAN Interface
- pppoe-out1
- WireGuard UDP Listen Port
- 13231
- WireGuard Tunnel Subnet
- 10.200.200.1/24
- Peer Endpoint Public IP
- 10.200.200.2/32
- Remote Site LAN Subnet
- 192.168.90.0/24
Handles Multi-WAN PCC mangle rules and FQ-CoDel queue trees with low CPU utilization.
ping 1.1.1.1 -f -l 1452
ping -M do -s 1452 1.1.1.1
ping -D -s 1452 1.1.1.1
# ===================================================================== # KalkuNet — MikroTik RouterOS v7 MTU/TCP MSS Clamping & WireGuard VPN # Jenis Link: PPPOE | MTU Optimal: 1480 | TCP MSS: 1440 # ===================================================================== # 1. Perbaikan Website Sering Loading Lama / Gagal Buka di PPPoE & VPN (TCP MSS Clamping) /ip firewall mangle add action=change-mss chain=forward in-interface=pppoe-out1 new-mss=1440 passthrough=yes protocol=tcp tcp-flags=syn tcp-mss=1441-65535 comment="Clamp TCP MSS Inbound (pppoe-out1 -> 1440)" add action=change-mss chain=forward out-interface=pppoe-out1 new-mss=1440 passthrough=yes protocol=tcp tcp-flags=syn tcp-mss=1441-65535 comment="Clamp TCP MSS Outbound (pppoe-out1 -> 1440)" add action=change-mss chain=forward new-mss=clamp-to-pmtu passthrough=yes protocol=tcp tcp-flags=syn comment="Auto Clamp PMTU All Tunnels" # 2. Setup Interface WireGuard VPN (RouterOS v7 Native) /interface wireguard add listen-port=13231 mtu=1420 name=wg-infracalc comment="WireGuard VPN Site-to-Site / Remote" /ip address add address=10.200.200.1/24 interface=wg-infracalc comment="IP Gateway Tunnel WireGuard" /interface wireguard peers # Ganti PUBLIC_KEY_CABANG dengan Public Key dari router cabang / client add allowed-address=10.200.200.2/32,192.168.90.0/24 interface=wg-infracalc public-key="ISI_PUBLIC_KEY_PEER_DISINI=" persistent-keepalive=25s comment="Peer Cabang / Remote Admin" /ip firewall filter add action=accept chain=input dst-port=13231 protocol=udp place-before=0 comment="Allow WireGuard Handshake UDP 13231" /ip route add dst-address=192.168.90.0/24 gateway=wg-infracalc comment="Route ke LAN Cabang via WireGuard" # Cara Test Fragmentasi Paket dari CMD Windows: ping 1.1.1.1 -f -l 1452
Multi-Vendor Config Translator & Interactive Packet Flow Visualizer
# ===================================================================== # KalkuNet — MikroTik RouterOS v7 MTU/TCP MSS Clamping & WireGuard VPN # Jenis Link: PPPOE | MTU Optimal: 1480 | TCP MSS: 1440 # ===================================================================== # 1. Perbaikan Website Sering Loading Lama / Gagal Buka di PPPoE & VPN (TCP MSS Clamping) /ip firewall mangle add action=change-mss chain=forward in-interface=pppoe-out1 new-mss=1440 passthrough=yes protocol=tcp tcp-flags=syn tcp-mss=1441-65535 comment="Clamp TCP MSS Inbound (pppoe-out1 -> 1440)" add action=change-mss chain=forward out-interface=pppoe-out1 new-mss=1440 passthrough=yes protocol=tcp tcp-flags=syn tcp-mss=1441-65535 comment="Clamp TCP MSS Outbound (pppoe-out1 -> 1440)" add action=change-mss chain=forward new-mss=clamp-to-pmtu passthrough=yes protocol=tcp tcp-flags=syn comment="Auto Clamp PMTU All Tunnels" # 2. Setup Interface WireGuard VPN (RouterOS v7 Native) /interface wireguard add listen-port=13231 mtu=1420 name=wg-infracalc comment="WireGuard VPN Site-to-Site / Remote" /ip address add address=10.200.200.1/24 interface=wg-infracalc comment="IP Gateway Tunnel WireGuard" /interface wireguard peers # Ganti PUBLIC_KEY_CABANG dengan Public Key dari router cabang / client add allowed-address=10.200.200.2/32,192.168.90.0/24 interface=wg-infracalc public-key="ISI_PUBLIC_KEY_PEER_DISINI=" persistent-keepalive=25s comment="Peer Cabang / Remote Admin" /ip firewall filter add action=accept chain=input dst-port=13231 protocol=udp place-before=0 comment="Allow WireGuard Handshake UDP 13231" /ip route add dst-address=192.168.90.0/24 gateway=wg-infracalc comment="Route ke LAN Cabang via WireGuard" # Cara Test Fragmentasi Paket dari CMD Windows: ping 1.1.1.1 -f -l 1452
Technical Accuracy Note: Calculation results are engineering estimates based on standard RFC/IEEE/ITU-T models. Actual field performance may vary due to protocol overhead, hardware specifications, and environmental factors.
How to Use This Tool
- Select your underlying WAN connection type (PPPoE 1480, Ethernet 1500, or LTE 1428) and specify your WAN interface name.
- Specify your WireGuard UDP listen port (default 13231), local tunnel gateway IP, remote peer IP, and remote branch LAN subnet CIDR.
- Review the comprehensive RouterOS v7 script featuring TCP MSS Clamping, WireGuard interface setup, UDP handshake firewall rules, and static route generation, then copy it to your terminal.
Worked Example: PPPoE Fiber WAN (MTU 1480 → WireGuard 1420)
Computed example: An underlying PPPOE WAN link (MTU 1480) with TCP MSS 1440. Configures a WireGuard interface on UDP port 13231 with tunnel IP 10.200.200.1/24, peer 10.200.200.2/32, and static route to remote LAN 192.168.90.0/24 alongside automated MSS Clamping.
- Router WAN Connection Type
- PPPoE Fiber ISP (MTU 1480 -> MSS 1440)
- Router WAN Interface Name
- pppoe-out1
- WireGuard UDP Listen Port
- 13231
- WireGuard Tunnel Gateway IP
- 10.200.200.1/24
- Branch Peer Tunnel IP
- 10.200.200.2/32
- Remote Branch LAN Subnet
- 192.168.90.0/24
- Link Encapsulation Type
- pppoe
- Effective MTU Size
- 1,480 Bytes
- IP Protocol Version
- ipv4
- IP Header Size
- 20 Bytes
- TCP Header Size
- 20 Bytes
- ICMP Header Size
- 8 Bytes
- Optimal TCP MSS Clamping Value
- 1,440 Bytes
- Max DF Ping Test Payload
- 1,452 Bytes
- Tunnel Encapsulation Overhead
- 20 Bytes
- Protocol Overhead Breakdown
- PPPoE Standar ISP Fiber / DSL (8–20 Byte Header)
- Public WAN Interface
- pppoe-out1
- WireGuard UDP Listen Port
- 13231
- WireGuard Tunnel Subnet
- 10.200.200.1/24
- Peer Endpoint Public IP
- 10.200.200.2/32
- Remote Site LAN Subnet
- 192.168.90.0/24
- DF Ping Test Command (Windows)
- ping 1.1.1.1 -f -l 1452
- DF Ping Test Command (Linux)
- ping -M do -s 1452 1.1.1.1
- DF Ping Test Command (macOS)
- ping -D -s 1452 1.1.1.1
- Terminal Configuration Script (CLI)
- # ===================================================================== # KalkuNet — MikroTik RouterOS v7 MTU/TCP MSS Clamping & WireGuard VPN # Jenis Link: PPPOE | MTU Optimal: 1480 | TCP MSS: 1440 # ===================================================================== # 1. Perbaikan Website Sering Loading Lama / Gagal Buka di PPPoE & VPN (TCP MSS Clamping) /ip firewall mangle add action=change-mss chain=forward in-interface=pppoe-out1 new-mss=1440 passthrough=yes protocol=tcp tcp-flags=syn tcp-mss=1441-65535 comment="Clamp TCP MSS Inbound (pppoe-out1 -> 1440)" add action=change-mss chain=forward out-interface=pppoe-out1 new-mss=1440 passthrough=yes protocol=tcp tcp-flags=syn tcp-mss=1441-65535 comment="Clamp TCP MSS Outbound (pppoe-out1 -> 1440)" add action=change-mss chain=forward new-mss=clamp-to-pmtu passthrough=yes protocol=tcp tcp-flags=syn comment="Auto Clamp PMTU All Tunnels" # 2. Setup Interface WireGuard VPN (RouterOS v7 Native) /interface wireguard add listen-port=13231 mtu=1420 name=wg-infracalc comment="WireGuard VPN Site-to-Site / Remote" /ip address add address=10.200.200.1/24 interface=wg-infracalc comment="IP Gateway Tunnel WireGuard" /interface wireguard peers # Ganti PUBLIC_KEY_CABANG dengan Public Key dari router cabang / client add allowed-address=10.200.200.2/32,192.168.90.0/24 interface=wg-infracalc public-key="ISI_PUBLIC_KEY_PEER_DISINI=" persistent-keepalive=25s comment="Peer Cabang / Remote Admin" /ip firewall filter add action=accept chain=input dst-port=13231 protocol=udp place-before=0 comment="Allow WireGuard Handshake UDP 13231" /ip route add dst-address=192.168.90.0/24 gateway=wg-infracalc comment="Route ke LAN Cabang via WireGuard" # Cara Test Fragmentasi Paket dari CMD Windows: ping 1.1.1.1 -f -l 1452
Core Concept & Engineering Notes
How It Was Calculated (Formulas & Steps)
Mathematical Formulas
- WireGuard Interface MTU = 1420 bytes (1500 − 80 bytes overhead)
- WAN TCP MSS = MTU_WAN − 40 bytes (e.g. 1480 − 40 = 1440 bytes)
- Mangle Clamp MSS: /ip firewall mangle add action=change-mss chain=forward new-mss=tcpMss protocol=tcp tcp-flags=syn
- WireGuard Peer Handshake: /ip firewall filter add action=accept chain=input dst-port=wgPort protocol=udp
Step-by-Step Calculation
- Selected link preset: PPPOE → Interface MTU = 1480 bytes
- IPV4 protocol overhead: IP Header = 20 bytes, TCP Header = 20 bytes (Total = 40 bytes)
- Optimal TCP MSS = MTU (1480) − (20 + 20) = 1440 bytes
- Don't Fragment (DF) Ping Buffer Size = MTU (1480) − (20 + 8) = 1452 bytes
Frequently Asked Questions (FAQ)
Why is the default WireGuard MTU 1420 bytes in RouterOS v7?
Standard Ethernet supports a 1500-byte MTU. WireGuard encapsulation adds up to 80 bytes of overhead (20/40-byte outer IP, 8-byte UDP, 32-byte WireGuard header & Poly1305 MAC). Subtracting 80 from 1500 yields 1420 bytes, guaranteeing zero fragmentation even over IPv6 backbones.
What is the difference between setting a specific `new-mss=1440` versus `new-mss=clamp-to-pmtu`?
Setting an explicit numeric MSS (e.g. 1440 on PPPoE) hardcodes a safe ceiling for traffic crossing that specific interface. The `clamp-to-pmtu` parameter dynamically derives the MSS from the router's egress interface MTU, acting as an optimal universal fallback.
Why is persistent-keepalive=25s essential for WireGuard peers?
When a branch peer is behind an ISP NAT or carrier CGNAT, upstream stateful firewalls flush inactive UDP mappings after 30 seconds. A 25-second keepalive sends a periodic ping to keep the NAT port binding alive, allowing the central office to initiate contact at any time.
Related Calculators
View All Network & Routing Tools →Calculate optimal MTU sizes, TCP MSS clamping (IPv4/IPv6), and Don't Fragment ping payloads to resolve web page freezes over PPPoE and VPN tunnels.
Expose internal server/NVR ports to the public internet (DST-NAT) and eliminate local loopback timeouts using Hairpin NAT.
Prioritize WhatsApp calls, Zoom/Teams conferences, and gaming latency above bulk downloads using RouterOS v7 FQ-CoDel Queue Trees.
Calculate IPv4 network address, broadcast, usable host range, netmask, wildcard, binary mask, and RFC address type (RFC 1918, /31, CGNAT).
Split an IPv4 network into N equal subnets or allocate boundary-aligned VLSM blocks by required host count with CSV and Markdown export.
Expand and compress IPv6 addresses per RFC 5952, calculate network prefix boundaries, /64 SLAAC subnet counts, and child prefix blocks.
References & Notes
- MikroTik Documentation — WireGuard Configuration (RouterOS v7)
- WireGuard Protocol Specification & Cryptographic Header Structure
Note: Results above are mathematical estimates based on standard formulas. Always verify against official vendor documentation and site conditions before production deployment.
🔗Related Scenarios & Companion Calculators
Browse All 30+ Scenarios →⚡ Ready-to-Use Scenario Presets:
Instant /32 CIDR reference: Subnet Mask is 255.255.255.255, Wildcard 0.0.0.0, Total IPs 1, and 1 Usable Hosts. Ideal for OSPF/BGP Router Loopback & Single Host Route.
Instant /30 CIDR reference: Subnet Mask is 255.255.255.252, Wildcard 0.0.0.3, Total IPs 4, and 2 Usable Hosts. Ideal for Point-to-Point Inter-Router WAN Link (2 Usable IPs).
Instant /29 CIDR reference: Subnet Mask is 255.255.255.248, Wildcard 0.0.0.7, Total IPs 8, and 6 Usable Hosts. Ideal for DMZ Public Server Sub-Block & BGP Peering (6 Hosts).
🛠️ Sibling Calculators in this Category:
Calculate IPv4 network address, broadcast, usable host range, netmask, wildcard, binary mask, and RFC address type (RFC 1918, /31, CGNAT).
Split an IPv4 network into N equal subnets or allocate boundary-aligned VLSM blocks by required host count with CSV and Markdown export.
Expand and compress IPv6 addresses per RFC 5952, calculate network prefix boundaries, /64 SLAAC subnet counts, and child prefix blocks.
Calculate Limit-At (CIR), Max-Limit (MIR), Burst, PCQ, and FQ-CoDel for RouterOS v7 with automated configuration script generation.
Engineering Sensitivity Analysis, Response Curve & Technical Citation
1. 1. 3-Point Engineering Sensitivity & Tolerance Envelope
Comparative evaluation across theoretical laboratory bounds (0% loss), current nominal operating point, and conservative field safety bounds (±15% thermal/aging derating).
| Evaluated Parameter | Ideal Theoretical Bound | Nominal Operating Point | Conservative Safety Bound (±15%) | Engineering Derating Rule |
|---|---|---|---|---|
| Effective MTU Size | 1,332 | 1,480 | 1,702 | Engineering Safety Margin (+15% Overhead) |
| IP Header Size | 18 | 20 | 23 | Engineering Safety Margin (+15% Overhead) |
| TCP Header Size | 18 | 20 | 23 | Engineering Safety Margin (+15% Overhead) |
| ICMP Header Size | 7.2 | 8 | 9.2 | Engineering Safety Margin (+15% Overhead) |
| Optimal TCP MSS Clamping Value | 1,296 | 1,440 | 1,656 | Engineering Safety Margin (+15% Overhead) |
2. 2. Mathematical Function Curve & Operating Coordinate (x₀, y₀)
3. 3. Physical Constants & Normative Standard Clauses
DC Loop Resistance for 23 AWG Solid Copper Cat6
Clause 6.4.1 / Table 145-1 — Nominal 23 AWG solid copper loop resistance at 20°C is 14.0 Ω/100m (TIA maximum ceiling is 18.8 Ω/100m).
Single-Mode Optical Fiber Attenuation Coefficient at 1490 nm
Table 1 / Class B+ & C+ Optical Path — Typical G.652.D attenuation at 1490 nm downstream is 0.22–0.25 dB/km (1310 nm upstream: 0.35 dB/km).
Temperature Coefficient of Resistance for Copper
International Annealed Copper Standard — Used in thermal derating equation: R(T) = R_20 × [1 + 0.00393 × (T - 20)].
4. 4. Independent Technical & Academic Citation (IEEE / APA 7th / BibTeX / LaTeX)
Use the standard citation formats below to reference this computational methodology in engineering specifications, audit reports, or academic papers.
[IEEE] KalkuNet Engineering Team, "MikroTik WireGuard VPN MTU & MSS Calculator — Standard Engineering Computational Instrument," KalkuNet Technical Suite, 2026. [Online]. Available: https://kalkunet.com/en/tools/mikrotik-wireguard-mtu-calculator. [Accessed: 2026-11-08].
[APA 7th] KalkuNet Engineering Team. (2026). MikroTik WireGuard VPN MTU & MSS Calculator (Production release 2026-11-08) [Engineering computational software]. KalkuNet. https://kalkunet.com/en/tools/mikrotik-wireguard-mtu-calculator
@software{kalkunet_mikrotik_wireguard_mtu_calculator_2026,
author = {{KalkuNet Engineering Team}},
title = {{MikroTik WireGuard VPN MTU & MSS Calculator --- KalkuNet Engineering Suite}},
year = {2026},
publisher = {KalkuNet.com},
url = {https://kalkunet.com/en/tools/mikrotik-wireguard-mtu-calculator},
urldate = {2026-11-08}
}
% LaTeX Engineering Derivation — Generated via https://kalkunet.com/en/tools/mikrotik-wireguard-mtu-calculator
\begin{equation}
\text{Model: } WireGuard Interface MTU = 1420 bytes (1500 − 80 bytes overhead)
\end{equation}
% Parameter Input Terukur: linkType = pppoe, \; wanIface = pppoe-out1, \; wgPort = 13231, \; wgNet = 10.200.200.1/24
% Hasil Evaluasi Numerik : linkType = \mathbf{pppoe}, \; mtu = \mathbf{1480}, \; ipVersion = \mathbf{ipv4}