davidcava / shadowsocks-libev-dsm

Synology DSM packages for Shadowsocks-libev.
GNU General Public License v3.0
91 stars 11 forks source link

Noob user guidance? #4

Closed popofthedead closed 5 years ago

popofthedead commented 5 years ago

Hi, noob here.

I installed the package on my DS218j and created config json according to template file in /etc folder. However, when I click to start shadowsocks in package center, it loads for a while and nothing happens.

Im wondering if there is a cmd line manual for dsm ss libev with log option? Would be great if user can trace issue themselves.

davidcava commented 5 years ago

Hi

Here is an example to manually launch ss-local outside of synology service framework, so that logs directly appear on the command line: PATH=/var/packages/shadowsocks-libev/target/bin LD_LIBRARY_PATH=/var/packages/shadowsocks-libev/target/lib /var/packages/shadowsocks-libev/target/bin/ss-local -c /var/packages/shadowsocks-libev/etc/ss-local.json Note: you need first to stop shadowsocks-libev in DSM interface to avoid errors regarding ports being already used.

Have you created the config file with the graphical interface or with command line, into folder /var/packages/shadowsocks-libev/etc? Which config file did you create precisely (ss-local.json, ss-server.json?) Can you copy it (replace password and IP address with stars)?

popofthedead commented 5 years ago

{ "server": "...", "server_port": 37478, "local_address": "127.0.0.1", "local_port": 12345, "password": "**", "timeout": 60, "method": "aes-256-cab", "fast_open": false, "mode": "tcp_and_udp" }

I’ll try those cmd, and will paste log here if problem persist.

popofthedead commented 5 years ago

Looks like I made a mistake with cipher name. It works now, thank u very much.

davidcava commented 5 years ago

cool! Good ss-ing. Note that your socks proxy is only available to the programs on your NAS with local_address 127.0.0.1. Use 0.0.0.0 instead if you want to make it available to the other devices on your network, (+ adjust the synology firewall rules).

frakman1 commented 3 years ago

@davidcava

Ok, I tried this on my Mac and connected to the Synology server via the "Outline" desktop GUI client. I can add the server but it fails when connecting.

image

/var/packages/shadowsocks-libev/etc# PATH=/var/packages/shadowsocks-libev/target/bin LD_LIBRARY_PATH=/var/packages/shadowsocks-libev/target/lib /var/packages/shadowsocks-libev/target/bin/ss-local -c /var/packages/shadowsocks-libev/etc/ss-local.json
 2021-01-07 14:21:03 INFO: initializing ciphers... chacha20-ietf-poly1305
 2021-01-07 14:21:03 INFO: listening at 0.0.0.0:12345
 2021-01-07 14:21:03 INFO: udprelay enabled
 2021-01-07 14:21:03 INFO: running from root user
 2021-01-07 14:21:32 ERROR: [udp] invalid header with addr type 125
 2021-01-07 14:21:33 ERROR: [udp] drop a message since frag is not 0, but 128
 2021-01-07 14:21:34 ERROR: [udp] invalid header with addr type 182
 2021-01-07 14:21:35 ERROR: [udp] invalid header with addr type 12
 2021-01-07 14:21:36 ERROR: [udp] invalid header with addr type 199
frakman1 commented 3 years ago

Update on my earlier post.

I was able to get it work by changing ss-local to ss-server

ss-server.json:

{
        "server":"192.168.x.x",
    "server_port":1234,
    "password":"xxxx",
    "timeout":300,
    "method":"aes-256-gcm",
    "fast_open":false,
    "nameserver":"8.8.8.8",
    "mode":"tcp_and_udp"
}

Run server using:

PATH=/var/packages/shadowsocks-libev/target/bin LD_LIBRARY_PATH=/var/packages/shadowsocks-libev/target/lib /var/packages/shadowsocks-libev/target/n/ss-server -c /var/packages/shadowsocks-libev/etc/ss-server.json

I added an encoded key using this site: https://shadowsocks.org/en/config/quick-guide.html

The Mac GUI client finally worked:

image

davidcava commented 3 years ago

Hum nice. I am curious what your use case is though, running ss-server on the synology (basically you are proxying the traffic of your Mac through your NAS).

frakman1 commented 3 years ago

It's the first time I use Shadowsocks. I don't know what all the different versions mean (ss-local vs ss-tunnel vs ss-redir vs ss-server vs ss-manager) I want to replace my VPN server with Shadowsocks eventually or at least provide similar functionality.

So I wanted to get it to work in my LAN first. That's why I use a local 192.168.x.x IP address.

Once that works, I wanted to connect to it remotely so it would eventually replace my VPN server that I currently have running on the Synology.

I would imagine that the next step would be to change the server parameter to my WAN IP address and as long as my router port forwards to server_port then I should be able to connect remotely right?

davidcava commented 3 years ago

ok clear, yes that should work. ss-local, ss-redir, ss-tunnel and are 3 clients that connect to a remote ss-server: ss-local provides a SOCKS5 proxy, ss-redir a transparent proxy and ss-tunnel a tunnel. ss-manager is a facility to handle several ss-server instances with different configuration each.

frakman1 commented 3 years ago

Ahhh so the tool provides both client and server functionality. I didn't know that. Thank you for explaining that. I see that it does a lot more too.