Setting Up Internet Circumvention on Linux Using Fanqiang Guides: A Complete Tutorial
The Fanqiang repository provides a user-space proxy solution for Linux using the mihomo (Clash) binary, requiring no root privileges and storing all configuration files in ~/.config/mihomo/.
Setting up internet circumvention on Linux using fanqiang guides involves deploying a local mihomo (formerly Clash Meta) proxy client that routes traffic through remote nodes. According to the linux/readme.md in the bannedbook/fanqiang repository, this approach isolates the proxy within your home directory and avoids system-wide modifications. This guide walks through the exact commands and file paths referenced in the official documentation.
Architecture and Prerequisites
Fanqiang leverages mihomo as a portable, single-binary proxy engine. The workflow creates a self-contained environment under ~/.config/mihomo/ that houses the executable, configuration files (config.yaml), and GeoIP databases (Country.mmdb, GeoSite.dat). You need a valid Clash/V2ray subscription URL from an airport provider to populate your node list.
Step-by-Step Installation
1. Create the Configuration Directory
Establish the folder structure where mihomo stores its runtime data. As specified in linux/readme.md lines 3-11, this directory follows the XDG Base Directory specification:
mkdir -p ~/.config/mihomo
2. Download the Mihomo Binary
Fetch the latest release for your architecture. The documentation recommends the linux-amd64 build for most distributions. Based on linux/readme.md lines 13-21:
wget -O clash-linux.gz \
https://github.com/MetaCubeX/mihomo/releases/download/v1.17.0/mihomo-linux-amd64-v1.17.0.gz
Extract and set execute permissions (linux/readme.md lines 25-31):
gzip -d clash-linux.gz
chmod +x clash-linux
mv clash-linux ~/.config/mihomo/
3. Initialize the Proxy Environment
Run the binary once to generate the default config.yaml and trigger automatic downloads of the GeoIP and GeoSite databases. According to linux/readme.md lines 33-40:
cd ~/.config/mihomo
./clash-linux
# Press Ctrl+C after initialization completes
If the automatic download fails, manually retrieve the missing data files. For Country.mmdb (linux/readme.md lines 43-49):
wget -O ~/.config/mihomo/Country.mmdb \
https://github.com/Dreamacro/maxmind-geoip/releases/latest/download/Country.mmdb
For GeoSite.dat (linux/readme.md lines 51-54):
wget -O ~/.config/mihomo/GeoSite.dat \
https://github.com/ewigl/mihomo/raw/master/GeoSite.dat
4. Configure Your Node Subscription
Obtain a Clash-compatible subscription URL from your V2ray/SSR provider. Replace the default configuration with your subscription file. As documented in linux/readme.md lines 69-72:
wget -U "Mozilla/6.0" -O ~/.config/mihomo/config.yaml <YOUR_SUBSCRIPTION_URL>
5. Launch and Verify
Start the proxy daemon to load your remote node list:
./clash-linux
The proxy now listens on 127.0.0.1:7890 for HTTP/HTTPS and 127.0.0.1:7891 for Socks5 (default mihomo ports).
System Proxy Configuration
Route system traffic through the local proxy. For command-line tools, export the environment variables as shown in linux/readme.md lines 99-105:
export http_proxy="http://127.0.0.1:7890"
export https_proxy="http://127.0.0.1:7890"
To make this persistent, add these lines to your ~/.bashrc or ~/.zshrc. For GUI applications, configure the system network settings to use Manual proxy with HTTP proxy 127.0.0.1:7890 (linux/readme.md lines 78-85).
Managing Updates and Maintenance
Updating the proxy follows the same non-privileged pattern:
- Binary updates: Repeat the download and extraction steps, replacing the executable in
~/.config/mihomo/. - Node list refresh: Re-run the
wgetcommand fetching your subscription URL to pull the latest server configurations. - Database updates: Periodically re-download
Country.mmdbandGeoSite.datto ensure accurate GeoIP routing rules.
Summary
- Fanqiang deploys mihomo as a user-space binary stored in
~/.config/mihomo/without requiring root access. - The setup requires downloading the
linux-amd64binary, initializing GeoIP data files (Country.mmdb,GeoSite.dat), and importing a Clash subscription toconfig.yaml. - Traffic redirection uses standard environment variables (
http_proxy,https_proxy) pointing to 127.0.0.1:7890. - Maintenance involves simple file replacements and
wgetcommands to refresh binaries and node lists.
Frequently Asked Questions
Do I need root privileges to run the Fanqiang proxy on Linux?
No. The entire installation runs in user space, with all files contained within ~/.config/mihomo/ and the proxy binding to high ports (7890/7891) that do not require elevated permissions. This design prevents conflicts with system package managers and maintains security isolation.
Where does Fanqiang store the proxy configuration files?
All configuration files, including config.yaml, Country.mmdb, and GeoSite.dat, reside in ~/.config/mihomo/ as specified in linux/readme.md lines 3-11. The mihomo binary also executes from this directory, creating a portable, self-contained proxy environment.
What should I do if the GeoIP database fails to download automatically?
Manually download Country.mmdb from the Dreamacro/maxmind-geoip repository and GeoSite.dat from the mihomo repository (lines 43-54 of linux/readme.md). Place both files directly into ~/.config/mihomo/ before starting the proxy to ensure proper routing rules and region-based traffic splitting function correctly.
How do I update my server node list after initial setup?
Re-execute the subscription download command using wget -U "Mozilla/6.0" -O ~/.config/mihomo/config.yaml <YOUR_SUBSCRIPTION_URL>. This overwrites the existing configuration with fresh server endpoints, and restarting the ./clash-linux binary immediately applies the new nodes without reinitializing the GeoIP databases.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →