没有不值得去解决的问题,也没有不值得去学习的技术!

Stable Configuration Practices for Clash Verge Rev, WireGuard, and Wstunnel (Part 1): Minimalist Principles and Initial Build

作者:

在


⚠️ Experimental Notice (Important)

This article documents my personal configuration refactoring process in a Clash Verge Rev + WireGuard + Wstunnel + MetaCubeX dataset environment.

This content is an experimental technical exploration:

  • It is not guaranteed to work in all network environments
  • It is not recommended to copy directly for production or critical business use
  • It is primarily used to verify the feasibility of the “minimalist rule model”

Network environments, DNS behavior, and VPS line quality vary by region, all of which will affect the final outcome.


1. Background: From “Works” to “Unstable”

The initial goal was simple:

Set up a stable, cross-platform proxy solution (Windows + Ubuntu + Android)

The tech stack included:

  • Clash Verge Rev
  • WireGuard (ZgoCloud)
  • Wstunnel
  • Custom DNS fallback
  • GEOSITE + GEOIP rule system

❌ Initial Symptoms

During long-term use, several typical issues gradually emerged:

  • Domestic websites occasionally became inaccessible, recovering after a delay of tens of seconds
  • Google Play app updates behaved abnormally
  • Thunderbird failed to send emails
  • Inconsistent behavior across different devices (Ubuntu / Android)

2. Problem Analysis: Typical Side Effects of a Complex System

I ultimately identified three main sources of the problems:


1. Overly Complex DNS Architecture

It included:

  • fallback DNS
  • fallback-filter
  • proxy DNS
  • Mixed DoH / DoT

This led to the result:

The same domain resolved to different results at different times


2. Overly Granular Rule System

For example:

  • Separate rules for Google / YouTube
  • Forced CDN traffic splitting
  • SMTP port rules
  • Dual checking for .cn domains + GEOIP

The problem was:

Priority conflicts existed among the rules, making behavior unpredictable


3. Mixed Use of TUN / System Proxy

Existing simultaneously were:

  • System DNS
  • Clash DNS
  • WireGuard DNS

This formed multiple network paths:

The network request path was uncontrollable


3. Refactoring Approach: Returning to the MetaCubeX Model

The core reference for this refactoring:

MetaCubeX geosite.dat + geoip.dat

Core philosophy:

Plaintext
Replace "manual rule maintenance" with "geographical categorization"

4. Status Update (Important)

It should be specifically noted:

👉 All the above issues have been resolved in subsequent configuration adjustments

The current system runs stably:

  • Domestic access is normal
  • Google Play is normal
  • Email sending is normal
  • Network behavior is consistent

The first half of this article serves as a “record of issue evolution” and does not represent the current state.


5. Final Solution: Minimalist Stable Model (Experimental Version)

✔ Architecture

Plaintext
Clash Verge Rev (TUN)
        ↓
WireGuard
        ↓
Wstunnel
        ↓
VPS

✔ Core Principles

  • ❌ No maintaining DNS rules
  • ❌ No using fallback DNS
  • ❌ No granular traffic splitting for Google / YouTube
  • ❌ No mixing with system proxy

✔ Final Configuration (Extension Override)

YAML
# ==============================================
# ZgoCloud + Wstunnel + WireGuard
# MetaCubeX 极简稳定版 v1 (clean)
#
# 特点:
# - 不使用 DNS 覆写(交给 Verge)
# - 不使用 SMTP / Google / YouTube 特殊规则
# - 基于 GEOSITE + GEOIP
# - 结构最小化,便于排错
# ==============================================

profile:
  store-selected: true

# ==============================================
# WireGuard(代理入口)
# ==============================================

proxies:
  - name: ZgoCloud-WG
    type: wireguard
    server: 127.0.0.1
    port: 51820

    ip: xxx

    public-key: xxx
    private-key: xxx
    pre-shared-key: xxx

    udp: true
    mtu: 1280

# ==============================================
# 代理组
# ==============================================

proxy-groups:
  - name: Proxy
    type: select
    proxies:
      - ZgoCloud-WG
      - DIRECT

# ==============================================
# 分流规则(核心简化版)
# ==============================================

rules:
  # ------------------------------
  # Wstunnel 服务器直连(避免回环)
  # ------------------------------
  - IP-CIDR,154.21.196.249/32,DIRECT,no-resolve

  # ------------------------------
  # 本地 / 私有网络
  # ------------------------------
  - GEOSITE,private,DIRECT
  - GEOIP,private,DIRECT,no-resolve

  # ------------------------------
  # 中国大陆直连
  # ------------------------------
  - GEOSITE,cn,DIRECT
  - GEOIP,CN,DIRECT,no-resolve

  # ------------------------------
  # 非中国大陆全部走代理
  # ------------------------------
  - GEOSITE,geolocation-!cn,Proxy

  # ------------------------------
  # 默认兜底
  # ------------------------------
  - MATCH,Proxy

6. Activation Method (Key)

In Clash Verge Rev:

  • ✔ Enable TUN mode (GUI)
  • ❌ No longer use system proxy
  • ✔ Use MetaCubeX databases (built-in by default)

7. Changes in Effects

After the refactoring, the system behavior became:

Plaintext
China traffic → DIRECT
Overseas traffic → Proxy

✔ Improvements

  • Domestic websites no longer stall randomly
  • DNS behavior is stable and consistent
  • Behavior is unified across multiple devices
  • Troubleshooting complexity has dropped significantly

✔ Maintainability Improvements

Issues are now reduced to three categories:

  • WireGuard
  • TUN
  • VPS network quality

8. Future Optimization Directions

The current solution is a “baseline stable version”, which can be gradually expanded later:

  • Granular rules for Google / GitHub
  • AI service optimization
  • Ad filtering
  • CDN acceleration strategies

Recommended principle:

Run stably for 1~2 weeks first, then gradually add rules


9. Summary

The core change of this refactoring is:

From “rule-driven network” → “model-driven network”

The ultimate goal is not “more granular rules”, but rather:

More stable, predictable, and maintainable network behavior

系列导航

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系