WireGuard VPN 无法访问github

为什么 GitHub 不喜欢我的 MTU 让我来告诉你我花了一整天与我的 WireGuard VPN 搏斗的挫败经历, 以及为什么 GitHub 成了唯一一个不配合的网站。我希望我的经验, 特别是如果你像我一样在 microk8s 环境中运行 WireGuard,能帮你省去一些麻烦。 环境:microk8s、Ubuntu 和 WireGuard 我的环境有点复杂。 我有一个运行在 Ubuntu 24.04.2 LTS 服务器节点(GNU/Linux 6.8.0-54-generic x86_64)上的 microk8s 集群。 我将我的 WireGuard VPN 服务器作为 pod 在这个 microk8s 集群中运行。这增加了一层我最初没有考虑到的网络复杂性。 问题:GitHub 无法访问(但其他一切都很好) 一切似乎都很好。我可以通过我的 WireGuard VPN 访问大多数网站。 Google、YouTube、Twitter——都没问题。但是 https://github.com 就是无法加载。 curl https://github.com 无限期地挂起。我挠着头,想知道是 DNS 问题、防火墙问题,还是其他什么问题。 调试:深入网络 初始测试: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 curl github.com # 有效!返回 301 重定向到 HTTPS curl -v github.com * Host github.com:80 was resolved. * IPv4: 20.27.177.113 * Trying 20.27.177.113:80... * Connected to github.com (20.27.177.113) port 80 > GET / HTTP/1.1 > Host: github.com > User-Agent: curl/8.5.0 > Accept: */* > < HTTP/1.1 301 Moved Permanently < Content-Length: 0 < Location: [https://github.com/](https://github.com/) < * Connection #0 to host github.com left intact curl [https://github.com](https://github.com) # 挂起... 这令人难以置信地困惑。HTTP 有效,但 HTTPS 无效。 但是 Google 和 Twitter 等其他 HTTPS 网站都很好。这表明问题特定于 HTTPS,并且可能与 GitHub 有关。 ...

March 4, 2025 · datewu

My WireGuard VPN Headache

Why GitHub Hated My MTU (And How I Fixed It) Let me tell you about the frustrating day I spent wrestling with my WireGuard VPN and why GitHub decided to be the only site that wouldn’t play nice. I’m hoping my experience, especially if you’re running WireGuard in a microk8s environment like I was, can save you some headaches. The Setup: microk8s, Ubuntu, and WireGuard My setup was a bit complex. I had a microk8s cluster running on an Ubuntu 24.04.2 LTS server node (GNU/Linux 6.8.0-54-generic x86_64). I was running my WireGuard VPN server as a pod within this microk8s cluster. This added a layer of network complexity that I didn’t initially account for. ...

March 4, 2025 · datewu

安装wireguard server

今天在hacker news上看到 wireguard macos client 发布了,决定试用一下。 和所有的vpn安装一样,wireguard的安装也是分两步,一是安装vpn server,二是安装 vpn的client。 安装不分先后,配置先配置vpn server,然后再配置client。 服务端 安装wireguard server 服务器为 RHEL 7.6 (Maipo), 服务端的安装流程: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #!/bin/bash sudo -i [root@deoops ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.6 (Maipo) [root@deoops ~]# echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf [root@deoops ~]# sysctl -p ### install packages [root@deoops ~]# curl -Lo /etc/yum.repos.d/wireguard.repo https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo [root@deoops ~]# yum install -y epel-release wireguard-dkms wireguard-tools [root@deoops ~]# yum install -y epel-release [root@deoops ~]# rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm [root@deoops ~]# yum update -y [root@deoops ~]# yum install -y epel-release wireguard-dkms wireguard-tools [root@deoops ~]# init 6 配置wireguard server 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ### wireguard server conf [root@deoops ~]# cat wg.conf [Interface] ListenPort = 58855 PrivateKey = private_key [Peer] PublicKey = public_key_one #AllowedIPs = 0.0.0.0/0 AllowedIPs = 10.0.0.7/32 [Peer] PublicKey = public_key_two #AllowedIPs = 0.0.0.0/0 AllowedIPs = 10.0.0.9/32 启动服务端wg0 设备 记得加上iptables设置: ...

January 6, 2020 · datewu