Proxy Configuration for OpenWRT Routers: Complete Setup Guide with ShadowsocksR-Plus

Configure SSR/V2Ray proxy on OpenWRT routers using the ShadowsocksR-Plus plugin by adding a subscription URL, selecting an active node, and setting your preferred routing mode.

The bannedbook/fanqiang repository provides comprehensive documentation for setting up proxy services across multiple platforms. For proxy configuration for OpenWRT routers, the recommended approach uses the ShadowsocksR-Plus plugin (luci-app-ssr-plus), which runs as a system daemon and automatically manages traffic routing through iptables rules. This guide covers both the standard LuCI web interface method and command-line alternatives for advanced users.

Prerequisites: Installing the ShadowsocksR-Plus Plugin

Before configuring proxy settings for OpenWRT, ensure your router has the ShadowsocksR-Plus package installed. Most custom OpenWRT firmware distributions include this plugin pre-installed. If you need to install it manually, use the OpenWRT package manager or build it from source according to your firmware's documentation.

The plugin operates in two layers: it maintains a local SOCKS/HTTP proxy daemon and configures kernel-level traffic routing rules. This architecture allows all devices on your network to use the proxy transparently without individual configuration.

Step 1: Obtain an SSR or V2Ray Subscription URL

The proxy configuration for OpenWRT routers requires a valid subscription URL that encodes server addresses, ports, encryption methods, and authentication credentials.

According to router/OpenWRT.md (lines 13-15), the repository directs users to a free V2Ray service where registration yields a subscription link. Your subscription URL typically looks like:


https://example.com/api/v1/client/subscribe?token=your-unique-token

Save this URL—you will paste it into the router's configuration interface in the next step.

Step 2: Configure the Plugin via LuCI Web Interface

The standard OpenWRT proxy setup uses the router's web interface. Follow these steps as documented in router/OpenWRT.md:

2.1 Add the Subscription URL

  1. Open your router's LuCI interface (typically http://192.168.1.1).
  2. Navigate to "服务" → "ShadowsocksR Plus+" → "服务器节点" (Server Nodes).
  3. Paste your subscription URL into the "订阅 URL" field.
  4. Click "保存 & 应用" (Save & Apply).

The plugin fetches the node list in the background. According to router/OpenWRT.md (lines 33-34), the node list appears within a few minutes.

2.2 Select and Activate a Node

  1. Go to the "客户端" (Client) page.
  2. Select any node marked "可用" (Available) from the dropdown.
  3. Click "保存 & 应用" (Save & Apply).

The status indicator should display "ShadowsocksR Plus+ 运行中" (ShadowsocksR Plus+ Running), confirming the proxy tunnel is operational.

2.3 Configure Routing Mode

In the "运行模式" (Operation Mode) section, choose one of:

  • "绕过中国大陆IP模式" (Bypass Mainland China IP Mode) — routes domestic traffic directly, foreign traffic through proxy.
  • "GFW 列表模式" (GFW List Mode) — only proxies traffic to blocked domains.

Select based on your performance and privacy requirements, then apply the settings.

Step 3: Command-Line Configuration (Optional)

For automated proxy configuration for OpenWRT, use SSH to manipulate UCI configuration files directly. These commands replicate the web interface workflow:

Set Subscription URL


# Replace with your actual subscription URL

uci set ssr_subscribe.@subscribe[0].url='https://example.com/your-subscription.txt'
uci commit ssr_subscribe
/etc/init.d/ssr_subscribe restart   # fetches node list

Enable a Specific Node


# Node index starts at 0; 'auto' uses the first available node

uci set ssr_server.@servers[0].type='ssr'     # or 'v2ray'

uci set ssr_server.@servers[0].server='auto'
uci commit ssr_server
/etc/init.d/ssr_server restart   # applies selected node

Set Routing Mode


# 0 = firewall bypass (mainland IP mode), 1 = GFW list mode

uci set ssr_rules.@rules[0].mode='1'
uci commit ssr_rules
/etc/init.d/ssr_rules restart

These commands modify the same UCI configuration files that the LuCI interface edits, ensuring identical behavior whether you use the UI or CLI.

Architecture and Key Files

Understanding the proxy configuration for OpenWRT routers requires familiarity with these repository files:

File Purpose
router/OpenWRT.md Complete UI-based tutorial covering subscription acquisition and plugin configuration
v2ss/server-cfg/nginx.conf Example Nginx reverse-proxy configuration for local proxy front-end deployment
README.md Central hub linking to platform-specific guides
router/readme.md Index of router-specific tutorials

The ShadowsocksR-Plus plugin implements a daemon-based architecture: it maintains a persistent local proxy process and dynamically updates iptables rules to redirect traffic. Because nodes are fetched from remote subscriptions, configuration updates propagate automatically—no manual file editing required when your provider rotates servers.

Troubleshooting Common Issues

  • Node list doesn't appear: Verify your subscription URL is valid and accessible from the router. Check system logs with logread | grep ssr.
  • "运行中" status but no connectivity: Confirm the selected node's type (SSR vs. V2Ray) matches your subscription. Test with curl -x socks5h://127.0.0.1:1080 http://ipinfo.io.
  • Routing mode ineffective: Ensure ipset and iptables-mod-tproxy packages are installed for GFW list functionality.

Summary

  • ShadowsocksR-Plus (luci-app-ssr-plus) is the core component for proxy configuration for OpenWRT routers in the bannedbook/fanqiang repository.
  • Configuration requires a subscription URL containing encoded node parameters, added via "服务器节点" page.
  • Routing modes determine traffic splitting: mainland IP bypass or GFW list targeting.
  • CLI configuration via UCI commands enables automation and remote management.
  • The plugin's daemon + iptables architecture provides transparent network-wide proxying.

Frequently Asked Questions

What is ShadowsocksR-Plus and why is it used for OpenWRT proxy setup?

ShadowsocksR-Plus is an OpenWRT package (luci-app-ssr-plus) that combines SSR and V2Ray client functionality with a LuCI web interface. According to the bannedbook/fanqiang source code, it was chosen because it integrates subscription management, automatic node updates, and flexible routing rules in a single maintained package. The plugin runs as a system service and handles both the proxy tunnel and traffic redirection without requiring per-device configuration.

Can I use V2Ray instead of SSR for the proxy configuration?

Yes. The proxy configuration for OpenWRT routers supports both protocols. In the LuCI interface, select "V2Ray" as the server type when choosing a node. For CLI configuration, set uci set ssr_server.@servers[0].type='v2ray' instead of 'ssr'. Both protocols use the same subscription infrastructure—the plugin auto-detects protocol types from the decoded subscription data.

How do I update my node list when my provider changes servers?

The plugin updates automatically. When your provider modifies their server infrastructure, the subscription URL returns updated node information. The plugin fetches this on its schedule (typically every few hours) or immediately when you click "保存 & 应用" in the subscription settings. Manual intervention is only required if your subscription URL itself changes.

Why choose GFW list mode versus mainland IP bypass mode?

GFW list mode minimizes proxy load by only tunneling traffic to known blocked domains, providing better performance for domestic services. Mainland IP bypass mode is more comprehensive—it routes all non-Chinese IP addresses through the proxy, catching blocked services not in the GFW list but potentially adding latency to foreign CDNs and APIs. Select based on your specific censorship environment and performance priorities.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →