# Guide: Shadowsocks setup on OpenWrt for beginners

**URL:** <https://forum.openwrt.org/t/guide-shadowsocks-setup-on-openwrt-for-beginners/77026>\
**Category:** Installing and Using OpenWrt\
**Created:** [October 18, 2020, 1:10pm UTC](https://forum.openwrt.org/t/guide-shadowsocks-setup-on-openwrt-for-beginners/77026 "2020-10-18T13:10:30Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![leosh64](https://forum.openwrt.org/letter_avatar/leosh64/32/6_449c533f586939b6e5f246632a46421f.png) [@leosh64](https://forum.openwrt.org/u/leosh64)\
**Post date:** [October 18, 2020, 1:10pm UTC](https://forum.openwrt.org/t/guide-shadowsocks-setup-on-openwrt-for-beginners/77026/1 "2020-10-18T13:10:30Z")

</div>

Hello,

as an OpenWrt and proxy beginner, I've spent quite a lot of time figuring out how to set up shadowsocks on OpenWrt due to many outdated guides, how-tos and forum discussions. Thus, here's a summary on how to install and setup shadowsocks on a fresh OpenWrt installation:

1. **Install packages:**  
The names of the packages have changed from what many guides state. These are working at the time of writing. Install the following packages using `opkg`:

```
luci-app-shadowsocks-libev
shadowsocks-libev-ss-local
shadowsocks-libev-ss-redir
shadowsocks-libev-ss-rules
shadowsocks-libev-ss-tunnel

```

1. **Configure server:**  
In the Luci Web UI, head to **Services \> Shadowsocks-libev \> Remote Servers** and edit the existing `sss0` server (or add a new one). Set at least IP, port, method and password, and don't forget to untick the **Disable** checkbox.

2. **Configure services and rules:**  
The simplest _recipe_ is to forward all traffic through the tunnel. Follow the steps outlined in the readme file under **Recipes \> forward all** : [https://github.com/openwrt/packages/blob/master/net/shadowsocks-libev/README.md#recipes](https://github.com/openwrt/packages/blob/master/net/shadowsocks-libev/README.md#recipes)  
You can do this either via command line or in the web interface.

3. **Change DNS config:**  
This must be done via command line according to the instructions in [https://github.com/openwrt/packages/blob/master/net/shadowsocks-libev/README.md#recipes](https://github.com/openwrt/packages/blob/master/net/shadowsocks-libev/README.md#recipes)

I hope this small guide helps you setting up your shadowsocks tunnel! Feel free to comment and update the content, if necessary.

**Additional steps required for shadowsocks on a NanoPi R2S:**  
The NanoPi R2S is a cheap little device with two ethernet ports that can easily be plugged between the modem and wifi router to provide tunneling service to your entire network, even if the wifi router doesn's support OpenWrt (or you don't want to change it due to warranty reasons). Unfortunately, at the time of writing, the operating system shipped with the NanoPi (FriendlyWrt fork of OpenWrt) has some issues and doesn't allow an easy installation of shadowsocks. The packages `kmod-ipt-tproxy` and `iptables-mod-tproxy` are missing from the release repositories and need to be downloaded and installed manually. Follow the instructions in this post: [https://github.com/openwrt/packages/issues/11457#issuecomment-711164213](https://github.com/openwrt/packages/issues/11457#issuecomment-711164213)

---

<div class="post-metadata">

**Author:** ![tmomas](https://forum.openwrt.org/letter_avatar/tmomas/32/6_449c533f586939b6e5f246632a46421f.png) [@tmomas](https://forum.openwrt.org/u/tmomas)\
**Post date:** [October 18, 2020, 1:13pm UTC](https://forum.openwrt.org/t/guide-shadowsocks-setup-on-openwrt-for-beginners/77026/2 "2020-10-18T13:13:37Z")

</div>

@bobafetthotmail Where in the wiki could these instructions be placed?

---

<div class="post-metadata">

**Author:** ![bobafetthotmail](https://forum.openwrt.org/user_avatar/forum.openwrt.org/bobafetthotmail/32/39_2.png) [@bobafetthotmail](https://forum.openwrt.org/u/bobafetthotmail)\
**Post date:** [October 19, 2020, 3:51am UTC](https://forum.openwrt.org/t/guide-shadowsocks-setup-on-openwrt-for-beginners/77026/3 "2020-10-19T03:51:41Z")

</div>

Shadowsocks is an encrypted proxy so it should go here [https://openwrt.org/docs/guide-user/services/proxy/start](https://openwrt.org/docs/guide-user/services/proxy/start)

I've created the article now [https://openwrt.org/docs/guide-user/services/proxy/shadowsocks](https://openwrt.org/docs/guide-user/services/proxy/shadowsocks)

---

<div class="post-metadata">

**Author:** ![leosh64](https://forum.openwrt.org/letter_avatar/leosh64/32/6_449c533f586939b6e5f246632a46421f.png) [@leosh64](https://forum.openwrt.org/u/leosh64)\
**Post date:** [October 19, 2020, 1:32pm UTC](https://forum.openwrt.org/t/guide-shadowsocks-setup-on-openwrt-for-beginners/77026/4 "2020-10-19T13:32:52Z")

</div>

Thanks guys, you're right, the wiki is a better place for this guide! I'll keep updating the content over there from now on.

---

<div class="post-metadata">

**Author:** ![David.S.Mckellen](https://forum.openwrt.org/user_avatar/forum.openwrt.org/david.s.mckellen/32/58935_2.png) [@David.S.Mckellen](https://forum.openwrt.org/u/David.S.Mckellen)\
**Post date:** [April 15, 2021, 12:53pm UTC](https://forum.openwrt.org/t/guide-shadowsocks-setup-on-openwrt-for-beginners/77026/5 "2021-04-15T12:53:59Z")

</div>

Hi there  
I have a question about shadowsocksI use Shadowsocks on my router (Archer C60 V2) and it works Flawlessly!! When I restart my router, I have to go to system/startup and after restart shadowsocks-libev my router back online  
Is there a way that shadowsocks works without restart in the startup section after every restarting router?  
Thank You

 ![Untitled](https://forum.openwrt.org/uploads/default/original/3X/6/e/6e99be7983ec1c718744175146ddc5a1cc88bde3.png)

---

<div class="post-metadata">

**Author:** ![frollic](https://forum.openwrt.org/user_avatar/forum.openwrt.org/frollic/32/30113_2.png) [@frollic](https://forum.openwrt.org/u/frollic)\
**Post date:** [April 15, 2021, 1:01pm UTC](https://forum.openwrt.org/t/guide-shadowsocks-setup-on-openwrt-for-beginners/77026/6 "2021-04-15T13:01:42Z")

</div>

not a solution, but possible workaround, put a /etc/init.d/shadowsocks-whatever-name restart  
in your local startup script ?

![image](https://forum.openwrt.org/uploads/default/original/3X/b/7/b79c7d54a717955b64f3d65e22c8474acff2eac8.png)

---

<div class="post-metadata">

**Author:** ![David.S.Mckellen](https://forum.openwrt.org/user_avatar/forum.openwrt.org/david.s.mckellen/32/58935_2.png) [@David.S.Mckellen](https://forum.openwrt.org/u/David.S.Mckellen)\
**Post date:** [April 15, 2021, 1:15pm UTC](https://forum.openwrt.org/t/guide-shadowsocks-setup-on-openwrt-for-beginners/77026/7 "2021-04-15T13:15:14Z")

</div>

it's done and now it works after restart  
Thank You 🙏 👌 👍

---

<div class="post-metadata">

**Author:** ![jadon221x](https://forum.openwrt.org/letter_avatar/jadon221x/32/6_449c533f586939b6e5f246632a46421f.png) [@jadon221x](https://forum.openwrt.org/u/jadon221x)\
**Post date:** [June 10, 2021, 9:06pm UTC](https://forum.openwrt.org/t/guide-shadowsocks-setup-on-openwrt-for-beginners/77026/8 "2021-06-10T21:06:40Z")

</div>

Hey thanks for your awesome tutorial.

How would I have to change my config (/etc/config/shadowsocks-libev) if I want to have multiple different remote servers.

Would that work:

```
config server 'sss0'
	option disabled 0
	option server '_sss_addr_'
	option server_port '_sss_port_'
	option password ' ********'
	option method 'aes-256-cfb'

config server 'server2'
	option disabled 0
	option server '_sss_addr_'
	option server_port '_sss_port_'
	option password ' ********'
	option method 'aes-256-cfb'

config ss_tunnel
	option disabled 0
	option server 'sss0'
        option server 'server2'
	option local_address '0.0.0.0'
	option local_port '8053'
	option tunnel_address '8.8.8.8:53'
	option mode 'tcp_and_udp'

config ss_redir ssr0
	option disabled 0
	option server 'sss0'
        option server 'server2'
	option local_address '0.0.0.0'
	option local_port '1100'
	option mode 'tcp_and_udp'
	option reuse_port 1

config ss_rules 'ss_rules'
	option disabled 0
	option redir_tcp 'ssr0'
	option redir_udp 'ssr0'
	option src_default 'checkdst'
	option dst_default 'forward'
	option local_default 'forward'

Thanks for your help in advance :)

```

---

<div class="post-metadata">

**Author:** ![AnonymousWebHacker](https://forum.openwrt.org/user_avatar/forum.openwrt.org/anonymouswebhacker/32/44199_2.png) [@AnonymousWebHacker](https://forum.openwrt.org/u/AnonymousWebHacker)\
**Post date:** [November 23, 2021, 7:12am UTC](https://forum.openwrt.org/t/guide-shadowsocks-setup-on-openwrt-for-beginners/77026/9 "2021-11-23T07:12:36Z")

</div>

Hello, this is the most complete tutorial that I have seen on the internet related to Openwrt and shadowsocks.  
I have some doubts, and I don't know if this can do it.

I have this scenario.

- A server with Outline (shadowsocks server) ip: 10.0.0.1
- A VM with OpenWRT with 1 br-lan interface 192.0.0.1
- A VM with mikrotik

My idea is to connect the OpenWRT to the Outline server (using shadowsock client), in such a way that the mikrotik can use the OpenWRT as a gateway and go directly to the Outline.

VM Outline Server \< ---- VM OpenWRT \<------ Mikrotik

how can I do this ?

---

<div class="post-metadata">

**Author:** ![geokvant](https://forum.openwrt.org/letter_avatar/geokvant/32/6_449c533f586939b6e5f246632a46421f.png) [@geokvant](https://forum.openwrt.org/u/geokvant)\
**Post date:** [May 27, 2022, 12:49pm UTC](https://forum.openwrt.org/t/guide-shadowsocks-setup-on-openwrt-for-beginners/77026/10 "2022-05-27T12:49:26Z")

</div>

All most everything is clear to understand except how to setup connection to my Cloud Outline server, b/c I've spent about couple of days and 4 tries to get it work for me

I have this link from my Outline manager

ss://Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpIbEdtWkZSZUZUQGI@123.123.123.123:8080/?outline=1

And here in Remote Server tab we see 4 parameters - two in plain text and two encrypted:  
Server:123.123.123.123  
Port: 8080  
Method: ?????  
Password: ????

`Sorry, new users can only put one embedded media item in a post.`

So, to get correct Method and Password from this cryptic link you need to decode this part of link

ss:// **Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpIbEdtWkZSZUZUQGI** @123.123.123.123:8080/?outline=1

In this code **Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpIbEdtWkZSZUZUQGI** Method and password are stored, but they encrypted by BASE64

to decode this I used form on this site [https://www.base64decode.org/](https://www.base64decode.org/)

put your link to the upper field named **Decode from Base64 format** like this

`Sorry, new users can only put one embedded media item in a post.`

and keep only code and press DECODE button

`Sorry, new users can only put one embedded media item in a post.`

Now you have your Method and password to paste into required fields of Remote Server settings on your OpenWRT Router  
 ![image](https://forum.openwrt.org/uploads/default/original/3X/c/e/ceb1e4e2a831b0c4ebb04bb8015a274433e58de6.png)

Paste them to the settings like this and press Save & Apply  
`Sorry, new users can only put one embedded media item in a post.`

May be this step-by-step tutorial will be useful for someone who wants to setup this feature over GUI like me.

---

<div class="post-metadata">

**Author:** ![David.S.Mckellen](https://forum.openwrt.org/user_avatar/forum.openwrt.org/david.s.mckellen/32/58935_2.png) [@David.S.Mckellen](https://forum.openwrt.org/u/David.S.Mckellen)\
**Post date:** [August 24, 2022, 4:44am UTC](https://forum.openwrt.org/t/guide-shadowsocks-setup-on-openwrt-for-beginners/77026/11 "2022-08-24T04:44:46Z")

</div>

> **[packages/net/shadowsocks-libev at master · openwrt/packages](https://github.com/openwrt/packages/tree/master/net/shadowsocks-libev)**
>
> master/net/shadowsocks-libev

---

<div class="post-metadata">

**Author:** ![Docop3](https://forum.openwrt.org/letter_avatar/docop3/32/6_449c533f586939b6e5f246632a46421f.png) [@Docop3](https://forum.openwrt.org/u/Docop3)\
**Post date:** [September 3, 2022, 3:58pm UTC](https://forum.openwrt.org/t/guide-shadowsocks-setup-on-openwrt-for-beginners/77026/12 "2022-09-03T15:58:19Z")

</div>

> [@jadon221x](#):
>
> `option server '_sss_addr_'`

So in order to config the server ss, we put the ip of the ss server where it's label : _sss\_addr_ and put the psw under it ?

---

<div class="post-metadata">

**Author:** ![JJBungles](https://forum.openwrt.org/letter_avatar/jjbungles/32/6_449c533f586939b6e5f246632a46421f.png) [@JJBungles](https://forum.openwrt.org/u/JJBungles)\
**Post date:** [October 3, 2022, 9:50am UTC](https://forum.openwrt.org/t/guide-shadowsocks-setup-on-openwrt-for-beginners/77026/13 "2022-10-03T09:50:23Z")

</div>

@geokvant : In Shadowsocks LUCi page --\> Remote Servers Tab, click the Import Links button. Paste your encoded ss:// (the longs string ending with outline = 1) in the field provided. Click import and the server information automatically shows on the remote servers tab. Simples!

No need to decode the string from your outline server!

Best you delete the above key and generate a new one for your privacy!

**On another note....**

Is it possible for someone to update the forward all recipes article link above to include the LUCi graphical interface - Redir Rules tab?

The article also provides how to test forward all but uses command strings that are not supported (nft and curl). Plus it needs to say what the output should look like as I cant tell if the output from the test validates if forward all is actually working!

Thanks

JJ

---

<div class="post-metadata">

**Author:** ![JJBungles](https://forum.openwrt.org/letter_avatar/jjbungles/32/6_449c533f586939b6e5f246632a46421f.png) [@JJBungles](https://forum.openwrt.org/u/JJBungles)\
**Post date:** [October 3, 2022, 4:42pm UTC](https://forum.openwrt.org/t/guide-shadowsocks-setup-on-openwrt-for-beginners/77026/14 "2022-10-03T16:42:26Z")

</div>

Is it possible for someone to update the "forward all" recipes article link above to current OpenWRT commands and include the LUCi graphical interface - Redir Rules tab?

The article also provides how to test forward all but uses command strings that are not supported (nft and curl). Plus it needs to say what the output should look like as I cant tell if the output from the test validates if forward all is actually working!

Thanks

JJ

---

<div class="post-metadata">

**Author:** ![edneyhelene](https://forum.openwrt.org/letter_avatar/edneyhelene/32/6_449c533f586939b6e5f246632a46421f.png) [@edneyhelene](https://forum.openwrt.org/u/edneyhelene)\
**Post date:** [April 15, 2025, 4:10pm UTC](https://forum.openwrt.org/t/guide-shadowsocks-setup-on-openwrt-for-beginners/77026/15 "2025-04-15T16:10:39Z")

</div>

Anyone with steps for Openwrt 24????

Also what if i want to route only my wireguard connection through the proxy nothing else?
