Shadowsocks server setup help needed

Hi all,

I'm new to OpenWRT, so be prepared for the fact I have likely made beginner mistakes here...

I have a Redmi AX6000 router on which I managed to install Open WRT and Luci on it. The version ID at the bottom of the screen reads: Powered by LuCI Master (git-23.266.27574-7744ad0) / OpenWrt SNAPSHOT (r24124-518923178c)

I have successfully installed DDNS using noip, and can log in remotely using it, as well as access my raspberry pi for which I opened 2 ports.

So far, so good.

Now I'm trying to set the router up as a shadowsocks server, and have installed shadowsocks-libev, as well as the files for Luci to configure it. What I've done so far can be seen in the attached image:

After rebooting the router it still shows as not running. I'm not very knowledgeable about this part, so would appreciate any help or suggestions for how to proceed with finding out what is wrong.

edit: The packages I installed are shown below:

Did you configure the shadowsocks service to auto start ?

1 Like

The configuration is pretty self explanatory in luci-app-shadowsock, set ip adress to run on, e.g. lan address of the router, choose port and password. Enable port forward from wan to the shadowsocks port and ip address and you can test it. I would recommend to install all shadowsock packages, just in case.

Hi thanks for your replies.

I did try the suggestion to set the server IP to the correct IP for the router, but this was not enough to get it to run. The software was also set to start automatically, but something is stopping it from running correctly.

Currently I have flashed the firmware to version 23.05, the latest available for the router, and am attempting to reload the DDNS and shadowsocks software to it, although this is being hindered by not being at home, and having a very poor internet connection currently. However, once done I will attempt to see if the server will run after changing the firmware.

I have now managed to reload the software for DDNS and shadowsocks to the router. All shadowsocks packages are installed:

However the server still will not run. I have tried to start it manually from the 'startup' page, and by rebooting the router, but no luck.

Does anyone have any more suggestions that might help?

I managed to get it to run. I had the port set to 443, and there is a log message as such:

Sun Feb 18 08:11:26 2024 daemon.info /usr/bin/ss-server[4128]: tcp server listening at 192.168.0.1:443

Sun Feb 18 08:11:26 2024 daemon.err /usr/bin/ss-server[4128]: bind: Address in use

Sun Feb 18 08:11:26 2024 daemon.err /usr/bin/ss-server[4128]: failed to bind address

I changed to a random port, and now the server is running. I then opened that port in the firewall, so I can move on to trying a client now. Thanks all.

1 Like

443 is usually claimed by uhttpd on Openwrt.

I think I just copied 443 after seeing it on another thread about a shadowsocks server. Anyway it was good to get that part sorted out, thanks.

Now I am having further difficulties, hopefully (and likely) something simple. I have installed a shadowsocks client on my android phone and set it up with address, port, and password for my now running server. It can connect, but there is a facility to test the connection. When I try that it reports no internet connection, in fact no data is returned from the shadowsock server at all (according to the byte counter).

My server config file (data obscured) at /etc/config/shadowsocks-libev reads:

config ss_server '(server_name)'
        option mode 'tcp_and_udp'
        option server '192.168.0.1'
        option server_port '522'
        option method 'aes-128-gcm'
        option password '(password)'
        option key '(key)'
        option ipv6_first '1'
        option local_address '(wan_address)'
        option local_ipv4_address '(IP4_wan_address)'
        option local_ipv6_address '(IP6_wan_address)'

I'm not 100% sure what I've entered is correct, but I've been unable to unearth much information about exactly what my config file should look like, or what further steps are needed to get internet access using this server. Any further help would be much appreciated.

edit: I tried the following:

option local_address '192.168.0.1'

But still no internet connection.

Check out Guide: Shadowsocks setup on OpenWrt for beginners ?

Hi, that guide is for using a remote server, and most information I can find seems to be geared toward that scenario. However I'm trying to run a server on my router, not a client, so I can pipe all my traffic through my home connection when away from home.

Looking in the System Log I'm getting:

Mon Feb 19 06:32:59 2024 daemon.err /usr/bin/ss-server[26769]: failed to handshake with xxx.xx.xx.x: authentication error

That's odd, I have double checked the password is correct. I have set up a key for the server to use, but there is nowhere to use one in the android client.

I've never used Shadowsocks, but it would seem you need two instances ?

Yes, there's a server and client instance. In the shadowsocks information from your link, the server is known as ss-remote, but in OpenWRT that instance is called ss-server. The client instance is called ss-local, that is what I'm running on my android phone.

The phone is saying it's connected, but the log file from OpenWRT is saying the connection was rejected. It's hopefully something simple but I haven't found the answer yet. When I do I'll report back in case it helps anyone in future.

Success at last! I had not matched the encryption method between the server and client. There are several methods that start with 'aes-128-' but are not the same, and I did not check carefully. This thread can be used to demonstrate every wrong move you can make :slight_smile: thanks for the help.

1 Like

Hi,
Sorry for late answering, but you only installed ss-server, don't you?