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.

167 lines
5.5 KiB

  1. .ig
  2. . manual page for shadowsocks-libev
  3. .
  4. . Copyright (c) 2012-2016, 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" "April 19, 2016" "SHADOWSOCKS-LIBEV"
  29. .SH NAME
  30. ss-redir \- shadowsocks client as transparent proxy, libev port
  31. .SH SYNOPSIS
  32. \*(Re
  33. [\fB\-AuUv\fR] [\fB\-h\fR|\fB\--help\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
  44. local machines to proxy TCP traffic and requires netfilter's NAT module. For
  45. more information, check out \fBshadowsocks-libev\fR(8) and the following
  46. \fBEXAMPLE\fR 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, aes-128-cfb,
  64. aes-192-cfb, aes-256-cfb, bf-cfb, camellia-128-cfb, camellia-192-cfb,
  65. camellia-256-cfb, cast5-cfb, des-cfb, idea-cfb, rc2-cfb, seed-cfb, salsa20,
  66. 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 \-a \fIuser_name\fP
  71. Run as a specific user.
  72. .TP
  73. .B \-f \fIpid_file\fP
  74. Start shadowsocks as a daemon with specific pid file.
  75. .TP
  76. .B \-t \fItimeout\fP
  77. Set the socket timeout in seconds. The default value is 60.
  78. .TP
  79. .B \-c \fIconfig_file\fP
  80. Use a configuration file.
  81. .TP
  82. .B \-n \fInumber\fP
  83. Specify max number of open files.
  84. Only available on Linux.
  85. .TP
  86. .B \-b \fIlocal_address\fP
  87. Specify local address to bind.
  88. .TP
  89. .B \-u
  90. Enable UDP relay.
  91. TPROXY is required in redir mode. You may need root permission.
  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. .TP
  102. .B \-h, --help
  103. Print help message.
  104. .SH EXAMPLE
  105. \*(Re requires netfilter's NAT function. Here is an example:
  106. .nf
  107. # Create new chain
  108. root@Wrt:~# iptables -t nat -N SHADOWSOCKS
  109. # Ignore your shadowsocks server's addresses
  110. # It's very IMPORTANT, just be careful.
  111. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 123.123.123.123 -j RETURN
  112. # Ignore LANs and any other addresses you'd like to bypass the proxy
  113. # See Wikipedia and RFC5735 for full list of reserved networks.
  114. # See ashi009/bestroutetb for a highly optimized CHN route list.
  115. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 0.0.0.0/8 -j RETURN
  116. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 10.0.0.0/8 -j RETURN
  117. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 127.0.0.0/8 -j RETURN
  118. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 169.254.0.0/16 -j RETURN
  119. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 172.16.0.0/12 -j RETURN
  120. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 192.168.0.0/16 -j RETURN
  121. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 224.0.0.0/4 -j RETURN
  122. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 240.0.0.0/4 -j RETURN
  123. # Anything else should be redirected to shadowsocks's local port
  124. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -p tcp -j REDIRECT --to-ports 12345
  125. # Add any UDP rules
  126. root@Wrt:~# ip rule add fwmark 0x01/0x01 table 100
  127. root@Wrt:~# ip route add local 0.0.0.0/0 dev lo table 100
  128. root@Wrt:~# iptables -t mangle -A SHADOWSOCKS -p udp --dport 53 -j TPROXY --on-port 12345 --tproxy-mark 0x01/0x01
  129. # Apply the rules
  130. root@Wrt:~# iptables -t nat -A PREROUTING -p tcp -j SHADOWSOCKS
  131. root@Wrt:~# iptables -t mangle -A PREROUTING -j SHADOWSOCKS
  132. # Start the shadowsocks-redir
  133. root@Wrt:~# ss-redir -u -c /etc/config/shadowsocks.json -f /var/run/shadowsocks.pid
  134. .fi
  135. .SH SEE ALSO
  136. .BR \*(Lo (1),
  137. .BR \*(Se (1),
  138. .BR \*(Tu (1),
  139. .BR \*(Ma (1),
  140. .BR shadowsocks-libev (8),
  141. .BR iptables (8),
  142. /etc/shadowsocks-libev/config.json
  143. .br
  144. .SH AUTHOR
  145. shadowsocks was created by clowwindy <clowwindy42@gmail.com> and
  146. shadowsocks-libev was maintained by Max Lv <max.c.lv@gmail.com> and Linus Yang
  147. <laokongzi@gmail.com>.
  148. .PP
  149. This manual page was written by Max Lv <max.c.lv@gmail.com>.
  150. .PP
  151. The manual pages were rearranged by hosiet <073plan@gmail.com>.