全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
楼主: skywing
打印 上一主题 下一主题

[Windows VPS] 怎么把对netflix的流量都转到另一个没被屏蔽的VPS处理

  [复制链接]
31#
发表于 2019-5-28 15:05:11 | 只看该作者
firewallcmd直接端口转发
  1. # 打开本机端口
  2. firewall-cmd --permanent --zone=public --add-port=61080/tcp

  3. # 添加转发规则
  4. firewall-cmd --permanent --add-forward-port=port=本机端口:proto=协议名称(可选tcp/udp/icmp):toaddr=目标IP:toport=目标端口

  5. # 举例说明:将本机61080端口的TCP数据包转发到223.5.5.5:53
  6. firewall-cmd --permanent --add-forward-port=port=61080:proto=tcp:toaddr=223.5.5.5:toport=53

  7. # 打开网络伪装(非常重要!很多教程都没写,导致转发不成功)
  8. firewall-cmd --zone=external --permanent --add-masquerade
  9. firewall-cmd --zone=public --permanent --add-masquerade

  10. # 载入设置
  11. firewall-cmd --reload
复制代码
32#
 楼主| 发表于 2019-5-28 15:58:09 | 只看该作者
ymcoming 发表于 2019-5-28 13:51
要不你试试不要"outboundDetour"

我当初用"outboundDetour"是因为默认的config里什么“direct"、 "blocked ...
  1.   "outbounds": [
  2.             {   "protocol": "vmess",
  3.             "settings": {
  4.                     "vnext": [
  5.                       {
  6.                     "address": "22.22.22.22",
  7.                     "port": 2222,
  8.                     "users": [
  9.                         {
  10.                           "alterId": 16,
  11.                           "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx"
  12.                         }
  13.                         ]
  14.                       }
  15.                     ]
  16.             },
  17.             "tag": "netflix"
  18.         },
  19.     {
  20.       "settings": {},
  21.       "tag": "direct",
  22.       "protocol": "freedom"
  23.     },
  24.     {
  25.       "settings": {},
  26.       "tag": "blocked",
  27.       "protocol": "blackhole"
  28.     }
  29.   ],
复制代码

改了之后还是全部走落地鸡
33#
发表于 2019-5-28 16:49:42 | 只看该作者
本帖最后由 ymcoming 于 2019-5-28 16:52 编辑
skywing 发表于 2019-5-28 15:58
改了之后还是全部走落地鸡


但是你这个写法错了,netflix不应该排在最前面!  direct这项应该排最前面
    {
      "tag": "direct",
    },
    {
      "tag": "netflix",
    },
    {
      "tag": "blocked",
    },

---------------------------------------------
outbounds: [OutboundObject]

一个数组,每个元素是一个出站连接配置。列表中的第一个元素作为主出站协议。当路由匹配不存在或没有匹配成功时,流量由主出站协议发出。
-----------------------------------------------


34#
发表于 2019-5-28 17:06:30 来自手机 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
35#
 楼主| 发表于 2019-5-28 17:15:49 | 只看该作者
ymcoming 发表于 2019-5-28 16:49
但是你这个写法错了,netflix不应该排在最前面!  direct这项应该排最前面
    {
      "tag": "direct",


万分感谢,搞定了,没想到是顺序的问题
36#
 楼主| 发表于 2019-5-28 19:52:45 | 只看该作者
抓狂,在路由器上测试还是被检测出使用代理,我怀疑是梅林的问题,我切换到软路由再试试
37#
发表于 2019-5-28 21:47:42 | 只看该作者
我大概懂是什么原因了,V 2 ray的新版本已经淘汰了outboundDetour参数。所以当你有这个outbounds和那个outboundDetour时,可能V 2 ray. 会误会outboundDetour才是主通道。所以不匹配域名/lP的流量全部走outboundDetour了。

(可能不同版本的差异吧,目前我的config里outboundDetour参数还是正常发挥作用的。)

所以以后都写在outbounds里比较妥当。
38#
发表于 2019-5-28 22:33:55 | 只看该作者
博客加了一个iptables的中转方法,没什么技术含量,有需要的就去看一下吧。
39#
发表于 2019-5-28 22:45:44 | 只看该作者
本帖最后由 zhqiang 于 2019-5-28 22:47 编辑
ymcoming 发表于 2019-5-28 13:10
首先应该判断是路由部分的问题,我自己的用了几个月了,一直正常。虽然你写的那个看上去也没问题,但用我这 ...


你好,我刚刚接触v2——ray,试着使用它来中转nf流量,两台机子单独运行都没有问题,但是如果我在中转机器使用了下列配置,总是连接不上任何网站?能帮我看看是哪里除了问题吗?
对了,我两台机子都使用的是ws+tls,谢谢!

  1. {
  2.     "inbound": {
  3.         "port": 23377,
  4.         "listen": "127.0.0.1",
  5.         "protocol": "vmess",
  6.         "settings": {
  7.             "clients": [
  8.                 {
  9.                     "id": "5a3fedc1-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  10.                     "alterId": 64
  11.                 }
  12.             ]
  13.         },
  14.         "streamSettings": {
  15.             "network": "ws",
  16.             "wsSettings": {
  17.                 "path": "/",
  18.                 "headers": {
  19.                     "Host": "www.12345678.com"
  20.                 }
  21.             }
  22.         }
  23.     },
  24.     "outbound": [
  25.         {
  26.             "tag": "direct",
  27.             "protocol": "freedom",
  28.             "settings": {
  29.                 "response": null
  30.             }
  31.         },
  32.         {
  33.             "tag": "netflix",
  34.             "protocol": "vmess",
  35.             "settings": {
  36.                 "vnext": [
  37.                     {
  38.                         "port": 443,
  39.                         "address": "www.xxx.com",
  40.                         "users": [
  41.                             {
  42.                                 "alterId": 64,
  43.                                 "security": "auto",
  44.                                 "id": "234864e5-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  45.                             }
  46.                         ]
  47.                     }
  48.                 ]
  49.             },
  50.             "streamSettings": {
  51.                 "network": "ws",
  52.                 "security": "tls",
  53.                 "wsSettings": {
  54.                     "path": "/",
  55.                     "headers": {
  56.                         "host": "www.abcdefgh.com"
  57.                     }
  58.                 }
  59.             }
  60.         },
  61.         {
  62.             "tag": "block",
  63.             "protocol": "blackhole",
  64.             "settings": {}
  65.         }
  66.     ],
  67.     "routing": {
  68.         "domainStrategy": "AsIs",
  69.         "rules": [
  70.             {
  71.                 "ip": [
  72.                     "geoip:private"
  73.                 ],
  74.                 "domain": null,
  75.                 "type": "field",
  76.                 "port": null,
  77.                 "outboundTag": "blocked"
  78.             },
  79.             {
  80.                 "type": "field",
  81.                 "port": null,
  82.                 "outboundTag": "netflix",
  83.                 "ip": null,
  84.                 "domain": [
  85.                     "geosite:netflix"
  86.                 ]
  87.             }
  88.         ]
  89.     }
  90. }
复制代码
40#
发表于 2019-5-28 23:55:53 | 只看该作者
本帖最后由 ymcoming 于 2019-5-29 07:43 编辑

"listen": "127.0.0.1",
服务端不应该这么写,服务端直接不要监听lP这一行,默认全部监听。如果要写 "listen",那就"0.0.0.0",一般直接删掉这行就好。
感觉你把本地客户端抄过来了。你想你中转鸡在监听127.0.0.1,你本地客户端连中转鸡公网IP(1.2.3.4),怎能连上?

另外"outbound"是老参数,里面只能容纳一组,所以才有"outboundDetour"与其配合,才能实现多组。
"outbounds"才是新参数,里面直接可写多组。

怀疑你中转鸡v2ray都不能正常启动吧?看看运行状态status?


最终的v2ray中转写法就是这样了:

"outbounds": [
    {
      "tag": "direct",
    },
    {
      "tag": "netflix",  //把你本地客户端连落地鸡正常情况下的"outbound"里的内容copy过来,只去掉原来的"tag",用前面的代替
    },
    {
      "tag": "blocked",
    }
],


    "routing": {
        "domainStrategy": "AsIs",
        "rules": [
            {
                "ip": [
                    "geoip:private"
                ],
                "domain": null,
                "type": "field",
                "port": null,
                "outboundTag": "blocked"
            },
            {
                "type": "field",
                "port": null,
                "outboundTag": "netflix",
                "ip": null,
                "domain": [
                    "geosite:netflix"
                ]
            }
        ]
    }
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-28 15:18 , Processed in 0.062675 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表