Prerequisites
- One OpenWrt router, preferably running the latest firmware
- A valid proxy service subscription URL that supports Clash/Surge/V2Ray formats
- Access to GitHub or the official website to download the installation package
Advanced Setup
Running the proxy on your router means the Clash core runs directly inside OpenWrt, and every device connected to the router follows the same routing rules. Devices that cannot install client apps, such as TV boxes and game consoles, can directly access services that are normally unavailable. You no longer need to install software on every phone and computer, and your family does not need to learn how to turn the proxy on and off. The trade-offs are equally real. You first need a router or x86-based soft router running OpenWrt, and you should expect to spend an hour or two setting up the dependencies, core, and subscription. The router becomes the network gateway for your entire household. If OpenClash fails, a common symptom is that DNS stops working for everyone, and your family will immediately come to you for help. In my view, a router-level proxy is worth the effort if you have at least two devices that cannot install client apps, or if you do not want to teach each family member separately. If only one computer needs proxy access, installing a desktop client is easier. Before you begin, gather a few things: a router that is already running OpenWrt and provides access to the LuCI web interface, a Clash-format subscription URL from your proxy service provider, and a computer connected to the router’s LAN. The screenshots in this article are from OpenClash v0.46. When I checked, the latest version on GitHub was v0.47.156, released in August 2026. Button locations and wording may differ slightly, so follow the interface shown on your device.
Prerequisites
OpenClash does not depend on the router brand; it depends on the firmware and available resources. Official OpenWrt and derivatives such as ImmortalWrt and iStoreOS are supported. Many third-party firmware builds include OpenClash by default, so after flashing the firmware, you may already see it under the Services (服务) menu. If so, skip the installation portion of Step 1. In terms of resources, the core plus the GeoIP and GeoSite databases requires tens of megabytes of storage, so older routers with 16 MB of flash generally do not have enough space. I recommend at least 256 MB of RAM. In the screenshot, the core used just over 23 MB while idle, and its memory usage will increase as the number of connections grows. LuCI is OpenWrt’s web interface. Enter the router’s address in a browser—commonly 192.168.1.1—and sign in with the root password. After installation, OpenClash appears under Services (服务) in the left sidebar. You also need to determine whether the firmware uses the fw4 firewall based on nftables or the fw3 firewall based on iptables. OpenWrt 22.03 and later use fw4 by default, and the two firewall systems require different dependencies. There are also two package managers: traditional firmware uses opkg to install ipk packages, while newer mainline firmware has switched to apk. The OpenClash release page provides both package formats. The plugin itself is architecture-independent, which is what all in the installation package name means. The Mihomo core that does the actual work is compiled for specific CPU architectures. x86 soft routers use amd64, most newer ARM routers use arm64, and older MT7621 models use the mipsle family. If you install the wrong architecture, the core will not start at all. You can find the router’s architecture in the system section under Status (状态) and Overview (概览) in LuCI. When selecting the core build under Plugin Settings (插件设置) and Version Update (版本更新) in OpenClash, it must match this architecture. You will do this at the end of Step 1.
Step 1: Install the OpenClash Plugin
First, check whether your firmware already includes it. Sign in to LuCI and expand Services (服务) in the left sidebar. If OpenClash is already listed, skip directly to the core installation section below. If it is not included, go to the Releases page of the vernesong/OpenClash repository. For an ipk-based system, download luci-app-openclash_<version>_all.ipk. For an apk-based system, download the .apk package for the same version. This repository has more than 27,000 stars and was still receiving commits in September 2026. Do not download the package from cloud-drive links or forum attachments. Install the dependencies first, followed by the plugin. The most important dependency is dnsmasq-full. It replaces the stripped-down version of dnsmasq included with the firmware, and OpenClash relies on it for DNS hijacking and ipset/nftset traffic routing. The plugin cannot run without it. The two dnsmasq packages cannot be installed together. The correct order is to use opkg download to download the dnsmasq-full installation package to /tmp, back up /etc/config/dhcp, remove dnsmasq, and finally install dnsmasq-full locally using –cache /tmp. If you reverse the order, the router may lose the ability to resolve domain names. Install the remaining bash, curl, ruby, and related packages according to the list in the README. The README provides separate lists for fw3 and fw4. If you plan to use TUN mode, you also need kmod-tun. I am not reproducing the entire command block here because dependency requirements occasionally change between versions. Follow the README’s current list on the day you install it. There are two ways to install the packages. In the graphical interface, go to System (系统) and Software (软件包), click Update Lists (更新列表), then search for and install every dependency except dnsmasq-full. Install dnsmasq-full over SSH in the order described above, then use Upload Package (上传软件包) to upload the ipk file. Alternatively, connect to the router over SSH and use opkg or apk to install the same packages. Refresh the page after installation, and OpenClash will appear under Services (服务). The row of tabs at the top includes five sections used in this guide: Runtime Status (运行状态), Plugin Settings (插件设置), Override Settings (覆写设置), Config Subscriptions (配置订阅), and Runtime Logs (运行日志). The version number appears in the middle of the page, with the main process and daemon status underneath. Until the core is installed, the main process will not show as running. The purple line in the screenshot indicates that the daemon is automatically correcting the firewall rule order. You can ignore similar messages. Next, install the core. Click Plugin Settings (插件设置), switch to Version Update (版本更新), and first verify the processor architecture shown on the page. Under Build Version (编译版本), select the core that matches the architecture, then click the button to update or download the core and wait for it to be retrieved from GitHub. The official release notes specifically remind users to confirm the core build under this tab before starting OpenClash. Selecting the wrong architecture is the most common reason new users cannot start the service. After the download succeeds, the installed version number will appear in the core section.
Step 2: Add a Proxy Service Subscription
Obtain the subscription URL from your proxy service provider’s user dashboard. There are two common dashboard layouts. In the first, click One-click Subscription (一键订阅) in the quick-access area on the home page, then select Copy Subscription URL (复制订阅地址) from the pop-up menu.
Troubleshooting Common Issues
stro/03.DLRgj7nx_19BHT3.webp)In the proxy service provider’s dashboard, click One-click Subscription (一键订阅), then click Copy Subscription URL (复制订阅地址). The second type of dashboard lists subscriptions for each client separately. Select a Clash-format button such as Copy CFW / ClashX Subscription (复制 CFW / ClashX 订阅). Do not select a V2Ray or SSR URL, because OpenClash can only use those formats after processing them through an online converter. This URL effectively serves as your account credential. Anyone who obtains it can use your data allowance, so do not post it in a group chat, and remember to redact it in screenshots. Return to OpenClash and click Config Subscriptions (配置订阅) at the top. When you open it for the first time, the list shows that no configurations are available. Click Add (添加) below the list. Only two fields on the editing page actually need to be completed. Leave everything else at its default value.
- For Config Filename (配置文件名), enter an easy-to-recognize name. The page warns you not to use a duplicate name. I usually enter the proxy service provider’s name directly.
- For Subscription URL (订阅地址), paste the complete URL you copied earlier. Do not omit the https prefix or any parameters at the end.
- Leave User-Agent set to the default value, Clash.
- Do not enable Online Subscription Conversion (在线订阅转换). It is intended for SS and V2Ray node URLs and will send your URL to a conversion server for processing.
- The checkboxes following Exclude Invalid Nodes (排除无效节点) can remove informational messages that the provider inserts into the node list. Enabling them keeps the list cleaner.
After completing the fields, click Save Configuration (保存配置) at the bottom. After saving, return to the list. Your configuration will appear in the table with Enabled (启用) checked. The configuration file has not yet been downloaded to the router, so click Update Configuration (更新配置) at the bottom to have OpenClash download the subscription and generate a yaml file. After a successful update, scroll down on the Runtime Status (运行状态) page. You will see a row of configuration information showing the subscription’s data usage and expiration date, and Syntax Check (语法检查) will indicate that the check passed. The Switch (切换) button at the far right of the table will still be active, indicating that this is not yet the current configuration. Click it to switch configurations. When the button turns gray, the correct configuration is active. You should recognize two common update failure messages. Config File Subscribed Failed usually means the URL was not pasted in full or the router cannot connect to the provider’s subscription server. Try updating again after the core is running in Step 3. Updated Config Has No Proxy Field means the downloaded content contains no nodes, usually because the subscription has expired or the data allowance has been exhausted.
Step 3: Start OpenClash, Select a Mode and Node, and Verify the Connection
Return to Runtime Status (运行状态), scroll to the bottom, and click Start OpenClash (启动 OpenClash). After several seconds to around a dozen seconds, the page will refresh. The main process and daemon will turn green and show Running (运行中), while the upload and download rates and active connection count will begin changing. The same page contains two sections that help you determine whether the connection is working. IP Address (IP 地址) checks the router’s outbound IP address using four sources. In the screenshot, all four report the IP address of a node in the United States. Website Access Check (网站访问检查) tests sites including Baidu, GitHub, and YouTube in sequence. If every site shows a successful connection with a latency in milliseconds, the router-side connection is working. First, look at the two mode rows in the status table. The Runtime Mode (运行模式) shown in the screenshot is Redir-Host plus compatibility mode. Do not change it during your initial setup; get everything working first. Fake-IP mode resolves domains quickly and uses fewer resources, making it a more common everyday choice in the community. If individual apps cannot connect, switch to mixed mode. All modes that include TUN depend on kmod-tun. You can change them under Plugin Settings (插件设置) and Mode Settings (模式设置). The Proxy Mode (代理模式) row has three buttons: Rule, Global, and Direct. Click one to switch modes. Keep it set to Rule for everyday use. Domestic traffic connects directly, while international traffic uses a proxy node, preventing domestic video services and games used by your household from slowing down because of an unnecessary detour. Global sends all traffic through the selected node. Use it temporarily only when determining whether a problem with a particular website is caused by the rules or the node. Direct sends everything directly and provides a faster way to disable proxying temporarily than shutting down OpenClash. To select a node, open a control panel. Yacd, Metacubexd, and Dashboard, displayed side by side beneath the status table, are web dashboards bundled with OpenClash. Their features overlap. Newer versions may use names such as zashboard instead. I prefer Yacd because its interface is lightweight and opens quickly on the router. Clicking it opens the dashboard in a new browser tab with the port and secret automatically included. Click Proxies (代理) in the dashboard’s left sidebar. The upper-right section contains the policy groups. The first group determines which node international traffic uses by default. It is named International Traffic (国外流量) in the screenshot, but your subscription may call it Proxy or Node Selection. Click any node name in the group to switch to it. The currently selected node turns blue. The lower section lists all nodes. Click Latency Test (测速) in the upper-right corner to test the latency of every node, then choose the one with the lowest number in your preferred region. More specific groups for services such as YouTube and Netflix follow the main group by default. Finally, verify the setup using a device on the LAN. This step demonstrates the value of a router-level proxy. Take a phone connected to the router’s Wi-Fi, completely disable any proxy client previously running on the phone, and use the browser to open a website that is normally unavailable, such as Google or YouTube. If it opens, the router is successfully proxying the phone’s traffic. Then open a domestic website. If it loads at the usual speed, traffic routing is working correctly. The same applies to TVs and game consoles. In Rule mode, being able to open Baidu does not prove that the proxy is working, because domestic websites already use direct connections. If the phone’s browser has Secure DNS or DoH enabled, disable it first because it can bypass the router’s DNS hijacking.
Everyday Usage Tips
Update the Subscription
After your proxy service provider changes its nodes, go to Config Subscriptions (配置订阅) and click Update Configuration (更新配置). Alternatively, enable Auto Update (自动更新) at the top of the page and select a time each day or on specific days of the week to retrieve updates automatically. The core reloads automatically after an update, so active downloads may be interrupted briefly.
Switch Nodes
If a node becomes slow in the evening, open Yacd and switch to another one. You do not need to restart OpenClash. Enable Interrupt Connections Containing the Policy Group When Switching (切换时打断包含策略组的连接) in the upper-right corner of the policy group so that established connections immediately begin using the new node after a switch.
Control Panels
The three dashboards are different skins for the same core. Changing the selected node in any one of them
Screenshots (from the public tutorial on jichangtuijiancn.co; UI may differ by app version)

Fig. 1: The OpenClash Runtime Status page. The version number appears in the middle, with the main process and daemon status on the row below. OpenClash is already running on the router shown.

Fig. 2: In the proxy service provider’s dashboard, click One-click Subscription (一键订阅), then click Copy Subscription URL (复制订阅地址).

Fig. 3: In the other type of dashboard, click the Clash-format Copy CFW / ClashX Subscription (复制 CFW / ClashX 订阅) button.

Fig. 4: The Config Subscriptions page is empty when opened for the first time. Click Add (添加) to create a new subscription.

Fig. 5: Enter the configuration filename and subscription URL, leave the remaining settings at their defaults, and click Save Configuration (保存配置).

Fig. 6: Click Start OpenClash (启动 OpenClash) at the bottom of the Runtime Status page. The subscription information and access check results will then appear above.

Fig. 7: The Proxy Mode row has three buttons: Rule, Global, and Direct. Keep it set to Rule for everyday use.

Fig. 8: Three control-panel buttons appear side by side on the Runtime Status page. Click Yacd Control Panel to open the node dashboard.

Fig. 9: Click Proxies (代理) in Yacd’s left sidebar, then click any node name in a policy group to switch to it.
Related Resources
- 检测IP纯净度:ippure.com
- 免费节点:downloadnth、freesocks、openrung
- 专线搭建方案:2026中国大陆专线建设方案
- 美国静态住宅IP的VPN推荐:thank.my.id
- 带静态住宅的机场:
https://JTMRHF.快车.com(复制粘贴到浏览器打开)或者 https://jtmrhf.xn--66tw07h.com - 带静态住宅IP的VPS(独立站+线路搭建):lisahost
- 极速VPN:vpn07