Self-built WireGuard solution port is frequently blocked, the ultimate minimalist solution (nanny class can be reproduced)

2. VPS 通过 iptables 做端口段转发:20000~60000 全部UDP端口,统一转发到本机 51820; 3. Vultr 防火墙只需放行 20000~60000 端口段 ,不用逐个添加单端口规则;

Self-Hosted VPN

图15:电脑VPN连接成功截图

(1) From LetsVPN to self-built Wireguard VPN full process review (with pit guide)

手机端优化配置(表单字段编辑专用,仅改2个字段)如图1

(2) WireGuard VPN configuration optimization: domestic website direct connection, foreign traffic to go to VPN (actual measurement is effective)

ChatGPT(https://chatgpt.com/)、 YouTube(https://www.youtube.com/)、 V2EX(https://v2ex.com/) 始终打不开,提示无法访问。如图1

(3) Wireguard domestic direct connection + foreign tunnel configuration

客户端无「上次握手时间」,一直处于等待连接状态。客户端显示看似连接,但实际无握手、无流量转发,接收一直为 0。

(4) Self-built VPN series Part 4 Wireguard self-built VPN accidental unavailable full replay: from normal use → suddenly no handshake → port is blocked → port change + intelligent shunt complete solution process

Speedtest 出口带宽测速,打开:https://www.speedtest.net/ 。结果如图2

(5) After deactivating self-built WireGuard from LetsVPN: Chengdu Mobile Broadband + Vultr Singapore node The measured network speed is very slow to review + pit dry goods

2. VPS 通过 iptables 做端口段转发:20000~60000 全部UDP端口,统一转发到本机 51820; 3. Vultr 防火墙只需放行 20000~60000 端口段 ,不用逐个添加单端口规则;

(6) Self-built WireGuard solution port is frequently blocked, the ultimate minimalist solution (nanny class can be reproduced)

洛杉矶节点:Premium、Eyeball、Tier 1 三种网络类型下所有实例均处于缺货状态,包括我能勉强接受的 LAX.AN5.Pro.TINY(Premium 网络,12.98美元/月),该节点 AN5 系列已告罄(如图6);

(7) Wireguard handshake is normal but can’t open the network? Why do we have to CN2 GIA, with DMIT deployment & out of stock alternatives

需要确保首页 - 当前节点 - ZgoCloud-VPN 是 绿色状态(如图25)。

(8) ZgoCloud + Wstunnel + Wireguard speed up 4 times, Clash Verge Rev automatically splits and 443 port anti-sealing actual combat

不可访问:`www.google.com` 提示 `ERR_CONNECTION_CLOSED`;`chatgpt.com`、`v2ex.com` 提示 `ERR_CERT_COMMON_NAME_INVALID`(HSTS 导致的证书错误)

(9) Troubleshooting Transcript: Solve the DNS deadlock problem of “some websites cannot be accessed” under Clash Verge + Wstunnel + Wireguard

图12:开机后网站测试全部通过

(10) ZGoCloud + Wstunnel + Clash Verge Rev under Ubuntu 26.04

分析:第三次测试依然稳健,上传甚至回升到了 81 Mbps。这证明了 CN2 GIA + 9929 线路在下午时段(非深夜)的优异表现。 (图7:VPN 测速 #3 详细数据截图)

(11) Under Ubuntu 26.04 Self-built VPN speed test report: ZgoCloud + Wstunnel + Wireguard solution experience and comparison guide

【截图位置:图17 展示了启动后的仪表盘界面】

(12) zgocloud + wstunnel + flclash VPN configuration under android

📷(图1:Play 商店无法更新)

(13) Complete troubleshooting and schema optimization for Google Play update exceptions on Android

[截图 5:Clash 规则片段,突出显示新增的两行 DST-PORT 规则]

(14) Thunderbird can’t send Gmail mail after self-built VPN: Cause and Solution

[截图 2:Play 商店更新界面,显示两个应用正常下载]

(15) Can’t update the Play Store app after self-built VPN? Don’t toss wstunnel, the problem is in the Clash diversion rules

关键信息是 code=exited, status=203/EXEC。这个退出码意味着 systemd 无法执行指定的程序。

(16) systemd user service 203/exec error troubleshooting: wstunnel self-starting configuration record

Practical Guide to Stable Clash Verge Rev + WireGuard + Wstunnel Configuration (Part 1): Minimalist Principles and Initial Setup

(17) Practical Guide to Stable Clash Verge Rev + WireGuard + Wstunnel Configuration (Part 1): Minimalist Principles and Initial Setup

使用 Clash Verge Rev 内置的连接测试,对常用 13 个目标进行检测:

(18) Clash Verge Rev + Wireguard + WSTunnel Stable Configuration Practice (2): Minimum Correction of DNS Contaminated by Google

你好,我按照你博客文章按流程操作了一下服务器,服务器防火墙也开了,但是手机修改端口还是没有握手提示,也上不了网,这是哪里出问题了吗?

(19) Help customers to remotely troubleshoot vultr Wireguard without handshake and cannot access the Internet problem (full record)

Thunderbird 无法与 imap.gmail.com 连接,请稍后再试。如果问题依然存在,则可能是您超出了此服务器允许的最大连接数量。可在IMAP服务器设置中减少缓存的连接数量。

(20) Full check record from Thunderbird connection failure to switching to Gmail API client

查看服务器上的 client.conf(截图8)

(21) WSTUnnel + Ficlash Remote Troubleshooting full record under client android: from script creation to IP mismatch

在 FlClash 中查看实时请求日志,所有 Play 商店相关的请求全部走代理

(22) FLCLASH + WireGuard + WSTUnnel Stable Configuration Practice (3): Google Play download problem solving

🚀 Wireguard + Clash Verge Rev for domestic direct connection / foreign diversion (Vultr & ZgoCloud actual combat evolution version)

(23) 🚀 Wireguard + Clash Verge Rev for domestic direct connection / foreign diversion (Vultr & ZgoCloud actual combat evolution version)

Clash Verge 内存占用过高

(24) 🚀 Clash Verge from 500MB to 200MB: Ubuntu VPN client lightweight optimization practice

Self-built WireGuard VPN The most troublesome problem:The UDP port fails every 2 days or so, the client has no last handshake time, and the ports such as 57586, 2096, and 443 are repeatedly replaced., tossing back and forth a lot of trouble.

The root cause: operator DPI deep packet detection, WireGuard native data packet features are fixed, no matter which separate UDP port to replace, it will be identified and periodically banned.

This article adopts the server-side iptables multi-port forwarding The simplest solution: do not change the native client of WireGuard, do not install confusion APP, do not toss the TCP tunnel, one configuration will take effect permanently, and only need to change the number of the client port in the future, and the novice will have zero tossing.

principle

  1. Fix the WireGuard server listening port to 51820, never modify ;
  2. VPS is forwarded through iptables for port segments: 20000~60000 all UDP ports, uniformly forwarded to this machine 51820;
  3. The Vultr firewall only needs to release the port segment of 20000~60000, and does not need to add single-port rules one by one;
  4. The computer and mobile client can freely choose any port in the interval. The port failure only needs to modify the client port, and there is no need to move the server or log in the vultr background.

Step 1: Modify WireGuard configuration, fixed listening port
Log in to vultr vps and edit the wg0 configuration file:

vi /etc/wireguard/wg0.conf

Find the configuration item:
listenport = original port (such as 2096, 57586)
Modified to:
listenport = 51820
Press ESC and enter :wq to save and exit. as shown in Figure 1

Log in to vultr vps and edit the wg0 configuration file

Step 2: Restart the WireGuard service to take effect

root@vultr:~# wg-quick down wg0
[#] ip link delete dev wg0
[#] iptables -D INPUT -p udp --dport 57586 -j ACCEPT
[#] iptables -D FORWARD -i enp1s0 -o wg0 -j ACCEPT
[#] iptables -D FORWARD -i wg0 -j ACCEPT
[#] iptables -t nat -D POSTROUTING -o enp1s0 -j MASQUERADE
[#] ip6tables -D FORWARD -i wg0 -j ACCEPT
[#] ip6tables -t nat -D POSTROUTING -o enp1s0 -j MASQUERADE
root@vultr:~# wg-quick up wg0
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 10.66.66.1/24 dev wg0
[#] ip -6 address add fd42:42:42::1/64 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] iptables -I INPUT -p udp --dport 57586 -j ACCEPT
[#] iptables -I FORWARD -i enp1s0 -o wg0 -j ACCEPT
[#] iptables -I FORWARD -i wg0 -j ACCEPT
[#] iptables -t nat -A POSTROUTING -o enp1s0 -j MASQUERADE
[#] ip6tables -I FORWARD -i wg0 -j ACCEPT
[#] ip6tables -t nat -A POSTROUTING -o enp1s0 -j MASQUERADE

Step 3: Verify that the listening port is in effect

root@vultr:~# wg show
interface: wg0
  public key: XZ2LNJxO7RqjGKHyubFw35eR7AkRa1iHqltQJYdsY3g=
  private key: (hidden)
  listening port: 51820

peer: QnBvrNGpbGs+9JxCgZvT16sVr1g735JMgWGFIdqmsz8=
  preshared key: (hidden)
  allowed ips: 10.66.66.2/32, fd42:42:42::2/128

peer: TX/hWjKXFoDyhQncE6M5DuC7d4DffzjJWHL+errBsTU=
  preshared key: (hidden)
  allowed ips: 10.66.66.3/32, fd42:42:42::3/128

Seeing the output Listening port: 51820 is the configuration success.

Step 4: VPS configuration iptables multi-port forwarding
Copy directly one by one:

# 将20000-60000所有UDP端口转发到WireGuard固定端口51820
root@vultr:~# sudo iptables -t nat -A PREROUTING -p udp --dport 20000:60000 -j REDIRECT --to-port 51820

# 安装iptables规则持久化工具
root@vultr:~# sudo apt install -y iptables-persistent
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
iptables-persistent is already the newest version (1.0.16).
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.

# 保存规则,重启服务器不失效
root@vultr:~# sudo netfilter-persistent save
run-parts: executing /usr/share/netfilter-persistent/plugins.d/15-ip4tables save
run-parts: executing /usr/share/netfilter-persistent/plugins.d/25-ip6tables save

Step 5: vultr background firewall configuration (must do)

  1. Log in to the vultr background, find the corresponding vps, and enter the firewall groups on the left;
  2. Delete the original single UDP rules such as 57586, 2096, 443, etc.
  3. Add a new firewall rule:
  • Protocol: UDP
  • Port Type: Port Range
  • Port interval: 20000 – 60000
  • Remarks: WireGuard multi-port split
  1. Save the rules, no additional ports need to be added. as shown in Figure 2
Port interval: 20000 - 60000

Step 6: Client Configuration Usage Rules

  1. The computer and mobile phone native WireGuard client do not need to reinstall, do not need to change other configurations;
  2. Endpoint format: your VPS IP: any port within the interval
    Example:
    endpoint = 1.2.3.4:32567
  3. Different ports can be used for multiple devices: 3xxxx for computers, 5xxxx for mobile phones, and no influence on each other online at the same time; as shown in Figure 3
  4. When there is no handshake for the port failure: only modify the number of the client port, you can change it between 20000~60000, and the server and firewall do not need any changes.
Different ports can be used for multiple devices: 3xxxx for computers, 5xxxx for mobile phones, and no influence on each other online at the same time; as shown in Figure 3

Pit Optimization Suggestions

  1. Do not use ports one by one in order (20001, 20002…), use random skip numbers to reduce the operator’s identification law;
  2. Avoid 7 × 24 hours resident hang-up, and manually disconnect when idle (when I go to bed at night) to reduce the probability of risk control;
  3. Fixed WireGuard listener port 51820, which will never be modified in the future;
  4. It is only suitable for users who do not want to be confused and do not want to change the client.

Program summary
This is the easiest, zero additional software, and the ultimate compromise solution that does not change the client. One configuration is permanent, and the VPS and firewall configuration are frequently modified.

After deactivating self-built WireGuard from LetsVPN: Chengdu Mobile Broadband + Vultr Singapore node The measured network speed is very slow to review + pit dry goods Wireguard handshake is normal but can’t open the network? Why do we have to CN2 GIA, with DMIT deployment & out of stock alternatives

🚀 Recommended VPS (WireGuard / Clash / Self-hosted VPN)

For this series, we recommend using Vultr VPS as the base infrastructure:

✔ Supports WireGuard / Clash / VPS deployment
✔ Multiple global data center locations
✔ Stable and suitable for long-term networking setups

👉 Visit Vultr (Recommended Sign-up Link)



💡 New User Promotion Info

Vultr may offer promotional credits for new users, such as:

– Up to $300 in trial credits
– For VPS deployment and testing purposes
– Availability depends on Vultr’s official campaign and account eligibility

⚠️ Offers may vary by region, time, or account type.


⚠️ Disclaimer

This page contains affiliate links to Vultr. We may earn a commission if you purchase through these links.

All promotions are provided and managed by Vultr. We do not guarantee that all users will receive the same promotional benefits.



Stop the Hassle | Dedicated WireGuard VPN Deployment Service

I continuously test and evaluate various network optimization solutions. My personal setup has been running stably for over a month with zero downtime. If you are tired of troubleshooting, experimenting with different protocols, or managing complex server configurations, feel free to contact me for a dedicated solution.

Ideal For:
✅ Users of AI tools such as ChatGPT, Claude, and Gemini
✅ Remote workers who rely on stable international connectivity
✅ Developers and technical learners who need access to global resources
✅ Users who do not want to spend time managing VPS and proxy configurations
✅ Anyone who prefers a private VPN server instead of shared public services

What I Offer:
Remote Deployment: Deploy a dedicated WireGuard VPN on your own server with full control over your data.
Free Trial: Apply for a one-month free trial of my self-hosted VPN node before making a decision.
Traffic Routing Optimization: Fine-tuned routing rules optimized for AI tools, development environments, and everyday browsing.
Post-Deployment Support: Assistance with setup, client configuration, and troubleshooting after deployment.

If you would like to learn more or apply for a free trial, please contact me directly and mention: VPN Consultation.

Contact Me:
Telegram: @shuijingwan
WeChat: 13980074657
Email: shuijingwanwq@gmail.com

评论

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.