Iptables -t nat -A OUTPUT -p tcp -m owner ! -uid-owner socks_user -dport 443 -j REDIRECT -to-port 1080 Iptables -t nat -A OUTPUT -p tcp -m owner ! -uid-owner socks_user -dport 80 -j REDIRECT -to-port 1080 This is the spirit of managing a linux, by the way.Īn example of a script for handling shadowsocks and iptables: #!/bin/bash Instead, a script is needed to handles the shadowsocks service and iptables rules. Whether shadowsocks is running is not something iptables can check, since iptables only handles traffic packets. The problem is that iptables should only redirect traffic to shadowsocks if shadowsocks is running. So I assume I'm getting reroute loop (?), but don't understand why. Sudo iptables -t nat -A OUTPUT -p tcp -m owner ! -uid-owner socks_user -dport 443 -j REDIRECT -to-port 1080Īfter that, I can still use the browser if connected directly to the proxy through settings, but after switching to no proxy/system proxy - getting request timeout. sudo iptables -t nat -A OUTPUT -p tcp -m owner ! -uid-owner socks_user -dport 80 -j REDIRECT -to-port 1080 Then I made iptables rules, according to the links above. I made systemd unit to start client on boot from separate user, content of file listed below: ĮxecStart=ss-local -c /etc/shadowsocks-client/config.jsonĪt this point if I'm setting 127.0.0.1:1080 in my browser (firefox) as a socks5 proxy - it works fine. I created admin user for running shadow socks client only. I followed recommendations from this question and this blog, where the answer is pointing to. The goal is to redirect all requests to 127.0.0.1:1080, where proxy client is running. I also have ubuntu 20.04 on my pc, with shadow-socks client running on it.Ĭurrently using shadow-socks-libev version. shadowsocks-libev-debian.I have ubuntu 20.04 vps with shadow-socks server on it. Login as root user and run the following command:ĭebian/Ubuntu. View Status: /etc/init.d/shadowsocks status Uninstall Shadowsocks You can Start/Stop/Restart and view the Status of the service by using the following commands: Start: /etc/init.d/shadowsocks start You will be asked to set server port, password and encryption (I recommend chacha20-ietf-poly1305).Īfter the script is installed, it will auto start on server boot. shadowsocks-libev-debian.sh 2>&1 | tee shadowsocks-libev-debian.log shadowsocks-libev.sh 2>&1 | tee shadowsocks-libev.logĭebian/Ubuntu wget -no-check-certificate -O shadowsocks-libev-debian.sh Just login as root user and run the following commands:ĬentOS wget -no-check-certificate -O shadowsocks-libev.sh You can easily install and configure Shadowsocks (Thanks to Teddysun). HostUs 512MB OpenVZ VPS (Amsterdam) – $18.95/yr Easy Install Shadowsocks-libev on Your Server RamNode 128MB OpenVZ VPS (New York) – $15/yr If you don’t have one, I suggest a cheap OpenVZ VPS from: I recommend the libev version written in C because it has low memory usage (around 600k) and low CPU consumption.įirst, you need to have a Linux server with at least 128MB of RAM. It has different versions written in C, Python and Go. The benefit of Shadowsocks is that it works very well on un-stable Internet connections. Shadowsocks is a secure and lightweight socks5 proxy for embedded devices and low-end boxes, designed to protect your Internet traffic.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |