Code Monkey home page Code Monkey logo

asuswrt-merlin-transparent-proxy's Introduction

If you have a more modern router.(e.g AC5300U), pleasse consider switch to use this script instead.

Use Asuswrt Merlin as a transparent proxy

Intro

This project is for config you asus router (merlin based) to serve as a transparent forward proxy.

Prerequisites

  • A VPS which can server as a shadowsocks server. (Or third party service)
  • A router which support opkg package manager. (we use Merlin, I think OpenWRT can satisfied too after some hack)
  • A local ssh client which can login to router.

Feature

ss+dnsmasq+dnscrypt

ss+dnsmasq+dnscrypt2

v2ray+dnsmasq+dnscrypt2

For details, please see Wiki link.

TODO

Integrate AD filtering into install script (see https://diversion.ch)

Contributing

  • Bug reports
  • Patches:
    • Fork on Github.
    • Create your feature branch: git checkout -b my-new-feature.
    • Commit your changes: git commit -am 'Add some feature'.
    • Push to the branch: git push origin my-new-feature.
    • Send a pull request :D.

asuswrt-merlin-transparent-proxy's People

Contributors

kfstorm avatar ohmyarch avatar zw963 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asuswrt-merlin-transparent-proxy's Issues

AC68U SS+dnsmasq 部署出错

路由器部署过程中出错信息如下:
Package bash (4.3.42-1a) installed in root is up to date.


Remote deploy scripts is started !!


Package shadowsocks-libev (2.6.1-1) installed in root is up to date.
/opt/bin/bash: line 395: add_service: command not found
/opt/bin/bash: line 402: add_service: command not found
/opt/bin/bash: line 120: sudo: unbound variable

技术小白求指导。谢谢!

ss+dnsmasq+chinadns部署出错

/opt/etc/init.d/目录下没有S56chinadns文件


Remote deploy scripts is started !!


Package shadowsocks-libev (3.0.6-1) installed in root is up to date.
sed: /opt/etc/init.d/S56chinadns: No such file or directory

# 用来转发 DNS 请求到 ss-server.
replace_string 5353 '5356 -s 114.114.114.114,127.0.0.1:1082,8.8.4.4' /opt/etc/init.d/S56chinadns

dnscrypt-proxy.sh文件缺失

copy route/opt/etc/dnscrypt-proxy.sh /opt/etc

  1. 其中dnscrypt-proxy.sh文件缺失。
  2. 在使用第三种方法“ss+dnsmasq+dnscrypt”。服务器端同样应该安装dnscrypt。应当如何配置呢?

ss+chinadns 部署失败

./ss+chinadns [email protected]
rsync is not installed in remote host, fallback to use scp command.
foreign_domains.conf 100% 34 0.0KB/s 00:00
iptables.sh 100% 5264 5.1KB/s 00:00
toggle_proxy.sh 100% 1211 1.2KB/s 00:00
patch_router 100% 1812 1.8KB/s 00:00
restart_dnsmasq 100% 84 0.1KB/s 00:00
shadowsocks.json 100% 164 0.2KB/s 00:00
S22ss-tunnel 100% 261 0.3KB/s 00:00
localips 100% 265 0.3KB/s 00:00
update_ip_whitelist 100% 528 0.5KB/s 00:00
remote host missing bash/perl, try to install it...
Installing bash (4.4.12-1) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/bash_4.4.12-1_armv7-2.6.ipk
Installing libncurses (6.1-1) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/libncurses_6.1-1_armv7-2.6.ipk
Installing libncursesw (6.1-1) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/libncursesw_6.1-1_armv7-2.6.ipk
Installing perl (5.26.1-3) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/perl_5.26.1-3_armv7-2.6.ipk
Configuring libncursesw.
Configuring libncurses.
Configuring bash.
Configuring perl.


Remote deploy scripts is started !!


Disable proxy ...
ipset v6.32: The set with the given name does not exist
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.
dnsmasq: syntax check OK.
Done.

咨询:增加bogus-nxdomain.china.conf

如果增加bogus-nxdomain.china.conf是不是直接把这个文件scp复制到路由器/opt/etc/dnsmasq.d/,然后输入:
admin@RT-AC66U-20F0: ./patch_dnsmasq

ss+udprelay失败

$ ./ss+udprelay [email protected] 
***********************************************************
Remote deploy scripts is started !!
***********************************************************
bash: line 589: /opt/etc/toggle_proxy.sh: No such file or directory

提供一个切换直连和代理的脚本

有些使用外网的场景需要直连,比如我想测一家vps商各节点的速度和延迟,部署透明代理之后都是走代理了,没法测。加白名单的话也是只用一次没什么必要,如果有个全局的开关就好了

line 512: export: `=': not a valid identifier

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 17426 100 17426 0 0 14308 0 0:00:01 0:00:01 --:--:-- 14318
cut: illegal option -- z
usage: cut -b list [-n] [file ...]
cut -c list [file ...]
cut -f list [-s] [-d delim] [file ...]
cut: illegal option -- z
usage: cut -b list [-n] [file ...]
cut -c list [file ...]
cut -f list [-s] [-d delim] [file ...]
./ss+dnsmasq: line 512: export: =': not a valid identifier % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1357k 100 1357k 0 0 9569 0 0:02:25 0:02:25 --:--:-- 9854 $target' variable must be provided in your's scripts before detect_target.
e.g. target=localhost or [email protected]

执行部署出错

路由器: AC66U
可以ssh上,opkg也可以运行
执行部署之后出现如下问题
./ss+dnsmasq+chinadns: line 26: /jffs/configs/dnsmasq.conf.add: No such file or directory chmod: cannot access ‘/opt/etc/iptables.sh’: No such file or directory ./ss+dnsmasq+chinadns: line 30: add_service: command not found ./ss+dnsmasq+chinadns: line 34: opkg: command not found

MacOS: sed: illegal option - r

The sed shipped with MacOS is a little bit different with the standard gnu-sed, which couldn't recognize -r option.

So running ./generate_dns would result in an empty accelerated-domains-ipset.china.conf, and all of the request would be carried out by shadowsocks.

Added some explanations to the README.md in PR #6

AC5300 Merlin 380.65_4 dnsmasq.conf 无法执行 ipset

首先感谢作者提供了如此通俗易懂的指导文章,以及自动化脚本。

不过我的路由器是 AC5300,自动化脚本貌似并不适用。在显示以下内容后就结束了(宿主机 Mac)

echo '***********************************************************'
echo Remote deploy scripts is started !!
echo '***********************************************************'

Merlin 原版固件 380.65_4
Dnsmasq 和 ipset 版本信息如下:

Dnsmasq version 2.76  Copyright (c) 2000-2016 Simon Kelley
Compile time options: IPv6 GNU-getopt no-RTC no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset no-auth DNSSEC loop-detect no-inotify

ipset v6.29: No command specified: unknown argument verion

问题一

我是手动配置 ss+dnsmasq 方案
SS 的搭建已经完成。单独在路由器上测试过,没有问题。
主要是路由表的问题。
就是在 /etc/dnsmasq.conf 下面添加 ipset=/domain.com/FREEWEB 之后,重启 dnsmasq service 之后,ipset list FREEWEB 显示没有添加任何信息,members 为空。
目前唯一能够正确添加 ipset 的指令就是 ipset add FREEWEB [domain.com]
指令 dnsmasq --ipset=/[domain.com]/FREEWEB 也没有办法使用。(insmod 都已经加载了)
不知道是不是 dnsmasqipset 不互相兼容。

问题二

我在 EntWare 中安装的 shadowsocks-libev 正确配置了 /opt/etc/init.d/ 下面的相关配置文件,但是 server 并没有自动启动。你没有在其它地方添加 SS 的启动脚本么?

方法都看懂了,所有 FREEWEB 中的域名走原始通道,非 FREEWEB 中的走 SS 通道。问题是,我这个 FREEWEB,依靠 dnsmasq 完全无法自动添加。。。
求救!!

手动编译部署ss+chinadns+dnscrypt只能访问部分网站

首先,感谢作者的无私奉献,由于家里使用的windows系统,无法一键使用部署脚本,并且本着学习的精神,所以按照脚本里的步骤进行了手动部署,但是遇到点问题,特来请教。


现象

我采用ss+chinadns+dnscrypt 的方式搭建环境,但是墙外网站部分可以访问,墙内网站正常。

排查

  1. dig可以正确找到ip地址
    dig

  2. 通过ipip.net和whatismyipaddress.com也能正确区分墙内墙外
    ip

  3. twitter可以访问但是Google、Youtube等不能访问
    twitter and google

  4. 路由器日志
    router log

  5. VPS日志
    vps log

  6. 本机运行SS客户端可以正常访问所有网站,排除运营商问题

问题

这种情况一般可能是哪方面的原因?我应该提供其他什么信息帮助排查?

BT下载跑ss通道

路由器FQ后,BT下载也会走SS通道。会带来SS流量增大。如果是钓鱼的种子,还会被服务商关账号。

如何对指定局域网电脑禁止SS?

需要增加个wget判断

1.下载accelerated-domains.china.conf时如果电脑上没有wget 是不会有任何提示的。
然后push到路由器上时就会出错,路由器能ping通,电脑无法上网。
2. mac下执行sed -r会报错
sed: illegal option -- r

Mac OS 部署路由器脚本开始后退出

Mac OS部署路由器脚本开始后退出。终端显示如下:

accelerated-domains-ipset.china.conf 100% 981KB 980.6KB/s 00:00
foreign_domains.conf 100% 34 0.0KB/s 00:00
S22ss-tunnel 100% 261 0.3KB/s 00:00
iptables.sh 100% 1916 1.9KB/s 00:00
patch_dnsmasq 100% 451 0.4KB/s 00:00
restart_dnsmasq 100% 83 0.1KB/s 00:00
shadowsocks.json 100% 510 0.5KB/s 00:00
[email protected]'s password:
Package bash (4.3.42-1a) installed in root is up to date.
[email protected]'s password:


Remote deploy scripts is started !!


$

执行部署出错

路由器:AC66U
电脑:Mac mini
终端:iTerm zsh

在路由器内部 opkg可以使用,用脚本部署出错

[~/work/asus-merlin]$ ./ss+dnsmasq [email protected]
sed: -i may not be used with stdin
./ss+dnsmasq: line 32: opkg: command not found
./ss+dnsmasq: line 35: ipset: command not found
./ss+dnsmasq: line 43: opkg: command not found

ss+dnsmasq 脚本前面加上 set -x,日志如下:
[~/work/asus-merlin]$ ./ss+dnsmasq [email protected] *[master]

  • source ./functions/deploy_start.sh
    ++ export -f deploy_start
    ++ alias export=__export
  • export [email protected]
  • [email protected]
  • '[' '!' -e ./route/opt/etc/shadowsocks.json ']'
  • ./generate_dns
    sed: -i may not be used with stdin
  • which ipset
  • opkg install ipset4
    ./ss+dnsmasq: line 32: opkg: command not found
    ++ ipset -v
    ++ grep -o 'version.*[0-9]'
    ./ss+dnsmasq: line 35: ipset: command not found
    ++ head -n1
    ++ cut '-d ' -f2
  • ipset_protocal_version=
  • set -e
  • '[' '' == 6 ']'
  • opkg install shadowsocks-libev iptables
    ./ss+dnsmasq: line 43: opkg: command not found

use ss+dnsmasq to deploy, caused access all domain failed if remote ss-server is closed.

Current exist a bug:

We only add ipset rule to dnsmasq, but not add domain rule to dnsmasq.
That means:

we use ss-tunnel to resolve all domain name, but, what we exepct is:
use 114.114.114.114 to resolve china domain name and use 8.8.4.4 to
resolve foreign domain.

Another bad effect is: if remote VPS is not accessible, ss-tunnel not work,
we could not access any sites with domain name.

one solution is use ChinaDNS, but, i don't want use two database to do one things.
so, the correct way is: we need add two config:

  • accelerated-domains.china.conf, It is for domain name resolve
  • accelerated-domains-ipset.china.conf, it is for add ip to FREEWEB.

使用centos7 可以ssh 路由器ASUS AC88U(ARM7)。已经配置正确配置opkg,执行命令出现如下提示。

[root@Centos7 asuswrt-merlin-transparent-proxy-master]# ./ss+dnsmasq+chinadns [email protected]
sh: rsync: not found
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: remote command not found (code 127) at io.c(605) [sender=3.0.9]
rsync is not installed in remote host, fallback to use scp command.
foreign_domains.conf 100% 33 0.0KB/s 00:00
iptables.sh 100% 2688 2.6KB/s 00:00
iptables_disable.sh 100% 1290 1.3KB/s 00:00
patch_dnsmasq 100% 451 0.4KB/s 00:00
restart_dnsmasq 100% 84 0.1KB/s 00:00
update_dns_whitelist 100% 449 0.4KB/s 00:00
update_ip_whitelist 100% 359 0.4KB/s 00:00
shadowsocks.json 100% 187 0.2KB/s 00:00
S22ss-tunnel 100% 261 0.3KB/s 00:00
localips 100% 101 0.1KB/s 00:00
./ss+dnsmasq+chinadns:行34: opkg: 未找到命令
必须首先运行 entware-setup.sh 初始化包管理系统.
[root@Centos7 asuswrt-merlin-transparent-proxy-master]# sh: rsync: not found
-bash: sh:: 未找到命令
[root@Centos7 asuswrt-merlin-transparent-proxy-master]# rsync: connection unexpectedly closed (0 bytes received so far) [sender]
-bash: 未预期的符号 (' 附近有语法错误 [root@Centos7 asuswrt-merlin-transparent-proxy-master]# rsync error: remote command not found (code 127) at io.c(605) [sender=3.0.9] -bash: 未预期的符号 (' 附近有语法错误
[root@Centos7 asuswrt-merlin-transparent-proxy-master]# rsync is not installed in remote host, fallback to use scp command.

ss+chinadns中的dns的UDP/TCP查询协议

在安装脚本中ss-tunnel还是使用的UDP协议进行的dns查询
‘# 修改 chinadns 的端口为 5356, 并将 ss-tunnel (端口 1082) 作为 dnsmasq 的上游 DNS 服务器,’
‘# 用来转发 DNS 请求到 ss-server.’

对于UDP方式的查询在网络中不稳定,或者服务器端UDP支持有问题的,可以用dns-forwarder替换ss-tunnel,转成TCP协议后,走shadowsocks代理后交给国外DNS处理

https://github.com/aa65535/hev-dns-forwarder

ac68u merlin380.63_2 无法使用ipset

需要检查是否有xt_set模块,否则无法运行。

bug:Sets generated by ipset 6.x cannot be accesed by iptables
需要执行脚本如下:
# Load ipset modules
ipset -v | grep -i "v4" > /dev/null 2>&1
if [ $? -eq 0 ];
then
# old ipset
ipsetv=4
lsmod | grep "ipt_set" > /dev/null 2>&1 ||
for module in ip_set ip_set_nethash ip_set_iphash ipt_set
do
insmod $module
done
else
# new ipset
ipsetv=6
lsmod | grep "xt_set" > /dev/null 2>&1 ||
for module in ip_set ip_set_hash_net ip_set_hash_ip xt_set
do
insmod $module
done
fi

为什么不使用 dnsmasq.conf.add 呢?感觉更方便一些。

echo "no-resolv" > /jffs/configs/dnsmasq.conf.add
echo "server=127.0.0.1#1082" >> /jffs/configs/dnsmasq.conf.add

这样后每次重启自动加入到/etc/dnsmasq.conf 中就不用再倒腾维护dnsmasq了。
dnsmasq(127.0.0.1#1082) -> ChinaDNS(-p 1082 127.0.0.1:1081) -> ss-tunnel(1081)
维护chinadns的地区判断数据更简单一些吧,命令更精简?

所有DNS请求走ss服务器导致访问内网缓慢

你好,我用了你的配置在路由器上部署后效果非常好,感谢。

就如我的标题所述,我在配置完后使用时发现即使在访问属于FREEWEB的网站时也会有速度缓慢,在微信里看短视频时尤其明显。

在研究了你的配置后我发现你把所有的DNS解析都通过ss-tunnel交给ss服务器(通过foreign_domains.conf这个配置文件),这就导致了每次解析都要去外面绕一圈,结果就是非常的慢。因为所有的TCP的非FREEWEB请求都会走ss服务,我就把这个DNS使用ss解析的配置文件禁用了,结果如我所预期的访问内网速度得到很大的提升同时也不影响最初的目的。我能看到的如此修改的影响就是UDP的DNS解析会失败,需要在ss-redir加上-u的配置(要使用-u需要TPROXY模块,默认TPROXY没有包括需要自定义配置重新编译Merlin,但这都是后话了)

所以在ss-redir能转发UDP请求可行的情况下,把所有DNS请求走ss服务器是否有必要?还有对于解析DNS有更好的解决方案么?

以上都是我突击学习iptables/ipset/dnsmasq等然后研究出得结果,如有错误也请包涵~

部署脚本后opkg无法更新/升级/装包

使用的方案是ss+chinadns+dnscrypt

执行

opkg update

报错如下:

Downloading http://pkg.entware.net/binaries/armv7/Packages.gz
*** Failed to download the package list from http://pkg.entware.net/binaries/armv7/Packages.gz

Collected errors:
 * opkg_download: Failed to download http://pkg.entware.net/binaries/armv7/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

部署脚本之前没有问题

部署成功但没有效果

所有网页(包括国内的)都打不开

$ ./ss+dnsmasq [email protected]

[email protected]'s password:
patch_dnsmasq 100% 451 448.5KB/s 00:00
S22ss-tunnel 100% 261 289.1KB/s 00:00
accelerated-domains.china.conf 100% 0 0.0KB/s 00:00
foreign_domains.conf 100% 34 40.1KB/s 00:00
accelerated-domains-ipset.china.conf 100% 0 0.0KB/s 00:00
shadowsocks.json 100% 187 17.5KB/s 00:00
restart_dnsmasq 100% 83 100.9KB/s 00:00
iptables.sh 100% 1916 1.5MB/s 00:00
[email protected]'s password:
Installing bash (4.3.42-1a) to root...
Downloading http://pkg.entware.net/binaries/armv7/bash_4.3.42-1a_armv7soft.ipk
Configuring bash.
[email protected]'s password:


Remote deploy scripts is started !!


Package shadowsocks-libev (2.6.1-1) installed in root is up to date.
Deploy success! Rebooting, please wait ...
If any error occur, Please unplug U disk and reboot again!

asus@RT-AC68U-EA68:/tmp/home/root# /opt/etc/init.d/S22shadowsocks check

Checking ss-redir... alive.

asus@RT-AC68U-EA68:/tmp/home/root# /opt/etc/init.d/S22ss-tunnel check

Checking ss-tunnel... alive.

ASUS AC68U 出现错误 /opt/bin/bash: line 122: syntax error near unexpected token `fi'

ASUS RT-AC68U
Firmware:380.65_4

./ss+dnsmasq+chinadns [email protected]
[email protected]'s password: 
restart_dnsmasq                               100%   83     0.1KB/s   00:00    
patch_dnsmasq                                 100%  451     0.4KB/s   00:00    
iptables.sh                                   100% 1916     1.9KB/s   00:00    
S22ss-tunnel                                  100%  261     0.3KB/s   00:00    
foreign_domains.conf                          100%   34     0.0KB/s   00:00    
accelerated-domains-ipset.china.conf          100%    0     0.0KB/s   00:00    
shadowsocks.json                              100%  505     0.5KB/s   00:00    
[email protected]'s password: 
Package bash (4.3.42-1a) installed in root is up to date.
[email protected]'s password: 
***********************************************************
Remote deploy scripts is started !!
***********************************************************
Package shadowsocks-libev (2.6.1-1) installed in root is up to date.
sed: /opt/etc/init.d/S56chinadns: No such file or directory
Deploy success! Rebooting, please wait ...
If any error occur, Please unplug U disk and reboot again!
/opt/bin/bash: line 122: syntax error near unexpected token `fi'
/opt/bin/bash: line 122: `fi'

感觉是某个sh文件出现语法错误?

部署以后之前设置的端口转发失效

不知道是不是和这个有关系?
之前在路由器上设置了两个端口转发,现在都无法连接了。
服务名称 通信端口范围 本地 IP 本地通信端口 通信协议
rdp 52057 192.168.0.101 3389 BOTH
0net 15441 192.168.0.101 15441 BOTH

sed: unmatched '/'

sed: unmatched '/'
`"local_address": "192.168.1.1",' is replaced with `' for /opt/etc/shadowsocks.json
sed: unmatched '/'
`SS_SERVER_IP' is replaced with `' for /opt/etc/iptables.sh
sed: unmatched '/'
`SS_LOCAL_PORT' is replaced with `' for /opt/etc/iptables.sh
sed: unmatched '/'
`SS_SERVER_IP' is replaced with `' for /opt/etc/iptables_disable.sh
sed: unmatched '/'
`SS_LOCAL_PORT' is replaced with `' for /opt/etc/iptables_disable.sh
sed: unmatched '/'
`UPSTREAM_PORT' is replaced with `' for /opt/etc/dnsmasq.d/foreign_domains.conf
sed: unmatched '/'
`ss-local' is replaced with `' for /opt/etc/init.d/S22shadowsocks

部署 ss+dnsmasq 时候出现上述错误。去路由器上单独执行 sed -i -e "s/$regexp/$replace/" "$file" 这个命令去替换内容反而没有问题,感觉很奇怪

路由器是 AC68 运行 merlin 380.68 固件

remote host missing bash/perl

重新部署提示错误后退出:

remote host missing bash/perl, try to install it...
collected errors:
*opkg_install_cmd: Cannot install package bash.
*opkg_install_cmd: Cannot install package bash.
Unknown package 'bash'.
Unknown package 'perl'.
sh: bash: not found

解决方案:
opkg update && opkg upgrade
opkg install bash
opkg install perl

然后重新部署

ss+chinadns执行脚本退出

Mac 10.13.1下运行ss+chinadns,报『bash: syntax error: unexpected "("』退出。有没有调试信息可看,不知道是在哪一步退的。

AC87u 配置完后出现部分网站无法访问情况

按照说明方法配置完后,访问google.com,facebook.com等网站时,出现无法建立安全连接的情况
2016-10-17 20 53 36
2016-10-17 20 54 07
证书显示为dns服务提供商的证书。
但是访问google.co.jp,google.com.hk等可以正常。同时google的手机客户端也可以正常搜索。

ARM架构

在第三个选择:ss+udprelay (仅 ARM 架构支持), 只需要 ss-redir 一个命令自己全部搞定, AC68U+ 的路由器不妨用这个.
ss-redir命令是指的哪个?在这种情况下DNS是全局通过SS么?

iptable增加UDP转发

chrome的quic功能会造成youtube连接速度很高,但是缓冲为零。原因是谷歌会验证你的UDP地址和TCP地址是否相同,所以UDP包也必须在iptables转发,并且ss也要开启UDP relay。

参考TCP,是不是可以加上以下两条做UDP转发?

iptables -t nat -A SHADOWSOCKS -p udp -j REDIRECT --to-port SS_LOCAL_PORT
iptables -t nat -I PREROUTING -p udp -m multiport --dports 80,443 -j SHADOWSOCKS

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.