Acris / shadowsocks-asuswrt-merlin

Shadowsock for Asuswrt-Merlin New Gen
MIT License
255 stars 44 forks source link

The shadowsocks configuration with local IP #7

Closed soliujing closed 5 years ago

soliujing commented 5 years ago

The shadowsocks configuration file location is: /opt/share/ss-merlin/etc/shadowsocks/config.json, ensure _localaddress is your router's IP address.

Can the local_address be set as 127.0.0.1? Suppose all traffic will be re-directed to router itself and localhost should work as well. But actually it didn't work.

Acris commented 5 years ago

No, local_address cannot be set to 127.0.0.1, because of local_address with 127.0.0.1 only take effect for the router's internal network. Generally speaking, when your PC or mobile phone connected to the router, they are on the same private network with the gateway IP 192.168.1.1 (your router's LAN IP), this network is isolated from the router's internal network, so the traffic can't through ss-redir if local_address is 127.0.0.1.

soliujing commented 5 years ago

If you set local_address to 0.0.0.0, the ss-redir service will listen all available interfaces. Including 192.168.x & localhost. Tested on my router and it works. So suggest to set more generic rule to make it more user-friendly. Please test it out and let me know if it works.

Acris commented 5 years ago

Yes, 0.0.0.0 is work well, I'll modify the documents later, thanks for your suggestions.

soliujing commented 5 years ago

Thanks for the update. Closing this and it would be great if etc/shadowsocks/config.json can be updated to generic 0.0.0.0 as well.

Acris commented 5 years ago

It is not suitable for change config.json because it will be a conflict with the user's modified configuration file when upgrading, I'll make a small fix to solve this when I am free.