You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

161 lines
5.3 KiB

  1. .ig
  2. . manual page for shadowsocks-libev
  3. .
  4. . Copyright (c) 2012-2015, by: Max Lv
  5. . All rights reserved.
  6. .
  7. . Permission is granted to copy, distribute and/or modify this document
  8. . under the terms of the GNU Free Documentation License, Version 1.1 or
  9. . any later version published by the Free Software Foundation;
  10. . with no Front-Cover Texts, no Back-Cover Texts, and with the following
  11. . Invariant Sections (and any sub-sections therein):
  12. . all .ig sections, including this one
  13. . STUPID TRICKS Sampler
  14. . AUTHOR
  15. .
  16. . A copy of the Free Documentation License is included in the section
  17. . entitled "GNU Free Documentation License".
  18. .
  19. ..
  20. \# - these two are for chuckles, makes great grammar
  21. .ds Lo \fBss-local\fR
  22. .ds Re \fBss-redir\fR
  23. .ds Se \fBss-server\fR
  24. .ds Tu \fBss-tunnel\fR
  25. .ds Ma \fBss-manager\fR
  26. .ds Me \fBShadowsocks-libev\fR
  27. .
  28. .TH "SS-REDIR" "1" "September 10, 2015" "SHADOWSOCKS-LIBEV"
  29. .SH NAME
  30. ss-redir \- shadowsocks client as transparent proxy, libev port
  31. .SH SYNOPSIS
  32. \*(Re
  33. [\fB\-AhuUv\fR]
  34. [\fB\-s\fR \fIserver_host\fR] [\fB\-p\fR \fIserver_port\fR] [\fB\-l\fR \fIlocal_port\fR]
  35. [\fB\-k\fR \fIpassword\fR] [\fB\-m\fR \fIencrypt_method\fR] [\fB\-f\fR \fIpid_file\fR]
  36. [\fB\-t\fR \fItimeout\fR] [\fB\-c\fR \fIconfig_file\fR] [\fB\-b\fR \fIlocal_address\fR]
  37. [\fB\-a\fR \fIuser_name\fR] [\fB\-n\fR \fInofile\fR]
  38. .SH DESCRIPTION
  39. \*(Me is a lightweight and secure socks5 proxy. It is a port of the original
  40. shadowsocks created by clowwindy. \*(Me is written in pure C and takes advantage
  41. of \fBlibev\fP to achieve both high performance and low resource consumption.
  42. .PP
  43. \*(Me consists of five components. \*(Re(1) works as a transparent proxy on local
  44. machines to proxy TCP traffic and requires netfilter's NAT module. For more
  45. information, check out \fBshadowsocks-libev\fR(8) and the following \fBEXAMPLE\fR
  46. section.
  47. .SH OPTIONS
  48. .TP
  49. .B \-s \fIserver_host\fP
  50. Set the server's hostname or IP.
  51. .TP
  52. .B \-p \fIserver_port\fP
  53. Set the server's port number.
  54. .TP
  55. .B \-l \fIlocal_port\fP
  56. Set the local port number.
  57. .TP
  58. .B \-k \fIpassword\fP
  59. Set the password. The server and the client should use the same password.
  60. .TP
  61. .B \-m \fIencrypt_method\fP
  62. Set the cipher.
  63. \*(Me accepts 18 different ciphers: table, rc4, rc4-md5,
  64. aes-128-cfb, aes-192-cfb, aes-256-cfb, bf-cfb, camellia-128-cfb,
  65. camellia-192-cfb, camellia-256-cfb, cast5-cfb, des-cfb, idea-cfb, rc2-cfb,
  66. seed-cfb, salsa20, chacha20 and chacha20-ietf. The default cipher is \fItable\fP.
  67. If built with PolarSSL or custom OpenSSL libraries, some of these ciphers may
  68. not work.
  69. .TP
  70. .B \-f \fIpid_file\fP
  71. Start shadowsocks as a daemon with specific pid file.
  72. .TP
  73. .B \-t \fItimeout\fP
  74. Set the socket timeout in seconds. The default value is 10.
  75. .TP
  76. .B \-c \fIconfig_file\fP
  77. Use a configuration file.
  78. .TP
  79. .B \-n \fInofile\fP
  80. Specify max number of open files.
  81. Only avaliable on Linux.
  82. .TP
  83. .B \-b \fIlocal_address\fP
  84. Specify local address to bind.
  85. .TP
  86. .B \-a \fIuser_name\fP
  87. Run as a specific user.
  88. .TP
  89. .B \-u
  90. Enable UDP relay.
  91. TPROXY is required in redir mode.
  92. .TP
  93. .B \-U
  94. Enable UDP relay and disable TCP relay.
  95. .TP
  96. .B \-A
  97. Enable onetime authentication.
  98. .TP
  99. .B \-v
  100. Enable verbose mode.
  101. .SH EXAMPLE
  102. \*(Re requires netfilter's NAT function. Here is an example:
  103. # Create new chain
  104. root@Wrt:~# iptables -t nat -N SHADOWSOCKS
  105. # Ignore your shadowsocks server's addresses
  106. # It's very IMPORTANT, just be careful.
  107. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 123.123.123.123 -j RETURN
  108. # Ignore LANs and any other addresses you'd like to bypass the proxy
  109. # See Wikipedia and RFC5735 for full list of reserved networks.
  110. # See ashi009/bestroutetb for a highly optimized CHN route list.
  111. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 0.0.0.0/8 -j RETURN
  112. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 10.0.0.0/8 -j RETURN
  113. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 127.0.0.0/8 -j RETURN
  114. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 169.254.0.0/16 -j RETURN
  115. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 172.16.0.0/12 -j RETURN
  116. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 192.168.0.0/16 -j RETURN
  117. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 224.0.0.0/4 -j RETURN
  118. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 240.0.0.0/4 -j RETURN
  119. # Anything else should be redirected to shadowsocks's local port
  120. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -p tcp -j REDIRECT --to-ports 12345
  121. # Add any UDP rules
  122. root@Wrt:~# ip rule add fwmark 0x01/0x01 table 100
  123. root@Wrt:~# ip route add local 0.0.0.0/0 dev lo table 100
  124. root@Wrt:~# iptables -t mangle -A SHADOWSOCKS -p udp --dport 53 -j TPROXY --on-port 12345 --tproxy-mark 0x01/0x01
  125. # Apply the rules
  126. root@Wrt:~# iptables -t nat -A PREROUTING -p tcp -j SHADOWSOCKS
  127. root@Wrt:~# iptables -t mangle -A PREROUTING -j SHADOWSOCKS
  128. # Start the shadowsocks-redir
  129. root@Wrt:~# ss-redir -u -c /etc/config/shadowsocks.json -f /var/run/shadowsocks.pid
  130. .SH SEE ALSO
  131. .BR \*(Lo (1),
  132. .BR \*(Se (1),
  133. .BR \*(Tu (1),
  134. .BR \*(Ma (1),
  135. .BR shadowsocks-libev (8),
  136. .BR iptables (8),
  137. /etc/shadowsocks-libev/config.json
  138. .br
  139. .SH AUTHOR
  140. shadowsocks was created by clowwindy <clowwindy42@gmail.com> and
  141. shadowsocks-libev was maintained by Max Lv <max.c.lv@gmail.com> and Linus Yang
  142. <laokongzi@gmail.com>.
  143. .PP
  144. This manual page was written by Max Lv <max.c.lv@gmail.com>.
  145. .PP
  146. The manual pages were rearranged by hosiet <073plan@gmail.com>.