Skip to content

Instantly share code, notes, and snippets.

@zoonderkins
Last active October 5, 2021 02:35
Show Gist options
  • Save zoonderkins/e909d51b5bbcca237632426fa394085f to your computer and use it in GitHub Desktop.
Save zoonderkins/e909d51b5bbcca237632426fa394085f to your computer and use it in GitHub Desktop.
Wireguard VPN cannot surf Github MTU fix

There are some provider have MTU issue

PhotonVPS, YardVPS

wg0.conf

[Interface]
Address = 10.8.3.1/24, fd42:42:44::1/64
ListenPort = 1723
PrivateKey = 0MpOsKxxxxomHE2g=
MTU=1430

[Peer]
# Coolbitx mbpr
PublicKey = GBDMhUbPxxxx3xqoQEg=
PresharedKey = SZWeB8xxxxhZJU=
AllowedIPs = 10.8.3.2/32, fd42:42:44::2/128

Setup eth0 MTU

ifconfig eth0 mtu 1440 up

Setup correct MTU iptables

iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
ip6tables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

References

  1. https://keremerkan.net/posts/wireguard-mtu-fixes/
  2. https://forum.openwrt.org/t/wireguard-performance/42501/6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment