Skip to main content
Home
The Baheyeldin Dynasty
The journey for wisdom starts with knowledge
  • Home
  • About
  • Site Map
  • Contact

How to adjust the MTU for Wireguard VPN

  1. Home

By Khalid on 2026/05/31 - 13:38, last updated 2026/05/31 - 14:05

Sometimes, when you are running Wireguard VPN, you encounter issues on your laptop/desktop, where loading certain websites that are on another server on the same private VPN network.

The symptoms are very slow loading, because of there are lots of errors and retries.

Sometimes, the site would not load at all.

But when you try from an Android phone, everything loads normally.

That points to an MTU issue.

To diagnose the issue, you need to run the following command, and changing wg0 to whatever your Wireguard interface name is:

sudo ip link set wg0 mtu 1420

Then, you run the following command with a high MTU, reducing it, until you get no errors and zero packet loss.

ping -M do -s 1420 -c 10 host1.example.com

PING ssp.home.priv (10.10.0.4) 1405(1433) bytes of data.
ping: local error: message too long, mtu=1420
ping: local error: message too long, mtu=1420
ping: local error: message too long, mtu=1420
^C
--- ssp.home.priv ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2056ms

Keep trying other values that are lower, then go up in small increments:

ping -M do -s 1390 -c 10 host1.example.com
ping -M do -s 1395 -c 10 host1.example.com

Finally, find the largest number that works, for example:

ping -M do -s 1392 -c 10 host1.example.com

PING host1.example.com (10.10.0.4) 1392(1420) bytes of data.
1400 bytes from host1.example.com (10.10.0.4): icmp_seq=1 ttl=63 time=151 ms
1400 bytes from host1.example.com (10.10.0.4): icmp_seq=2 ttl=63 time=109 ms
1400 bytes from host1.example.com (10.10.0.4): icmp_seq=3 ttl=63 time=228 ms
1400 bytes from host1.example.com (10.10.0.4): icmp_seq=4 ttl=63 time=186 ms
1400 bytes from host1.example.com (10.10.0.4): icmp_seq=5 ttl=63 time=155 ms
1400 bytes from host1.example.com (10.10.0.4): icmp_seq=6 ttl=63 time=104 ms
1400 bytes from host1.example.com (10.10.0.4): icmp_seq=7 ttl=63 time=223 ms
1400 bytes from host1.example.com (10.10.0.4): icmp_seq=8 ttl=63 time=82.0 ms
1400 bytes from host1.example.com (10.10.0.4): icmp_seq=9 ttl=63 time=141 ms
1400 bytes from host1.example.com (10.10.0.4): icmp_seq=10 ttl=63 time=98.6 ms

--- host1.example.com ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9012ms

Then edit the file: /etc/wireguard/wg0.conf

Add the line:

MTU = 1392

Then restart Wireguard:

systemctl restart wg-quick@wg0

Then test that ping still works:

ping -c 10 host1.example.com
Contents: 
Linux
  • Add comment

Current

Talks

  • Presentations and Talks

Search

Site map

Contents

  • Family
    • Khalid
    • Ancestry
    • Extended
  • Friends
  • Nokat نكت
  • Writings
    • Cooking
    • Culture
    • Science
    • History
    • Linguistics
    • Media
    • Literature
    • Politics
    • Humor
    • Terrorism
    • Business
    • Philosophy
    • Religion
    • Children
  • Technology
    • Linux
    • Arabization
    • Drupal
      • Association
    • Software
    • Internet
    • Technology in Society
    • Digital Archeology
    • NCR History
    • MidEast Internet
    • Programming
    • Saudi ISPs
    • Miscellaneous
  • Places
    • Canada
      • Weather
    • Egypt
      • Cuisine
      • Alexandria
      • E.G.C.
    • USA
    • Saudi Arabia
  • Interests
    • Astronomy
    • Fishing
    • Photography
    • Snorkeling
    • Nature
    • Photomicroscopy
  • Miscellany

In Depth

  • al-Hakim bi Amr Allah: Fatimid Caliph of Egypt الحاكم بأمر الله
  • Alexandria, Egypt
  • Arabic on the Internet
  • Articles on the history of Muslims and Arabs in the Iberian Peninsula تاريخ المسلمين و العرب في الأند
  • DIY GOTO Telescope Controller With Autoguiding and Periodic Error Correction
  • E.G.C. English Girls College in Alexandria, Egypt
  • Egyptian Cuisine, Food and Recipes مأكولات مصرية
  • George Saliba: Seeking the Origins of Modern Science?
  • Internet Scams and Fraud
  • Mistaken for an Arab or Muslim: Absurdities of being a victim in the War on Terror
  • Mistaken Identity: How some people confuse my site for others
  • One People's Terrorist Is Another People's Freedom Fighter
  • Overview of Google's Technologies
  • Photomicroscopy
  • Pseudoscience: Lots of it around ...
  • Resources for using Google Adsense with Drupal
  • Rockwood Conservation Area, Southern Ontario
  • Selected Symbolic Novels And Movies
  • Snorkeling the Red Sea near Jeddah
  • Updates and Thoughts on the Egyptian Revolution of 2011

Recent Content

Most recent articles on the site.

  • How to adjust the MTU for Wireguard VPN
  • What To Do When Linux Boots To A Grub Prompt?
  • Presentations and Talks
  • How Needrestart on Ubuntu Helps With Security
  • How To Run A Script When Daylight Savings Change
more

Most Comments

Most commented on articles ...

  • Another scam via Craigslist: offering more than asking price
  • Warning to female tourists thinking of marrying Egyptians
  • Craigslist classified for used car: Cheque fraud scam
  • Winning the lottery scam email: World Cup South African lottery
  • Email Scam: BMW 5 Series car and lottery winning
more

About Khalid

Various little bits of information ...

  • Khalid Baheyeldin: brief biography
  • Presentations and Talks
  • Youtube Videos
  • GitHub Projects
  • Drupal.org Profile
  • Astrophotography @ Flickr

Sponsored Links

Your Link Ad Here

Tags

419 Android App Arabic backup Balkanization Comet Conspiracy Coronavirus COVID-19 CPU DIY Ericsson Firefox GSM Home Assistant Kubuntu Laptop Mobile OnStep OpenWRT Python Rogers Router Scam Sony Spectrum tablet Telescope Ubuntu
More

© Copyright 1999-2026 The Baheyeldin Dynasty. All rights reserved.
You can use our content under the Terms of Use.
Please read our privacy policy before you post any information on this site.
All posted articles and comments are copyright by their owner, and reflect their own views and opinions, which may not necessarily be consistent with the views and opinions of the owners of The Baheyeldin Dynasty.

Web site developed by 2bits.com Inc.