GithubHelp home page GithubHelp logo

Comments (5)

zfl9 avatar zfl9 commented on July 19, 2024

tag:none 和 gfwlist 分流模式是如何联系起来的?

我没有理解你对 chinadns-ng 的具体用例,麻烦详细说明下。

from chinadns-ng.

churchmice avatar churchmice commented on July 19, 2024

感谢回复
其实问题是这样的,我现在用黑名单模式翻墙,在黑名单里面的dns解析出来之后的ip会加到一个gfwlist的ipset里面
这个很好
但是黑名单模式是不全的,如果碰到那些实际上被墙但是又没有在黑名单里面的网站,我有两种方法

  1. 手动添加这些网站到一个列表里面,放到tag:gfwlist里面,chinadns就会用国外dns解析,并且自动添加进ipset里面
  2. 或者chinadns当知道解析的结果是一个国外ip的时候, 增加一个选项,将这个ip添加进ipset里面

对比这两种方案,2)会更加方便一点,虽然存在误杀的可能(虽然国外ip,但是没有被墙)。但是鉴于现在的网络环境,基本上国外网站都被墙的7788了,2)这种方式会更好一些

from chinadns-ng.

zfl9 avatar zfl9 commented on July 19, 2024

按照我的理解,你说的方式2,完全等于 chnroute 分流模式,你可以看下 ss-tproxy 中 chinadns-ng 的使用。

要实现该需求,完全不必给 tag:none 添加 add-ip-to-set 功能。为什么?

  • 因为 tag:none 判断一个 ip 是否为国外 ip 的核心依据就是:检测这个 ip 在不在 chnroute/chnroute6 集合中(--ipset-name4/6 选项指定的 ipset/nftset),ip 不在集合里面,那就是国外 ip。
  • 同理,你在 iptables 规则中,同样可以依赖这一点,也即 -m set ! --match-set chnroute dst -j PROXY,假设 PROXY 是执行透明代理的规则链,该规则的意思是,如果目标ip不在chnroute里面,那么就走 PROXY 链。

from chinadns-ng.

zfl9 avatar zfl9 commented on July 19, 2024

本质上,这还是对 gfwlist 模式、chnroute 模式的选择,方式1 就是 gfwlist 模式,方式2 就是 chnroute 模式。


以下是 ss-tproxy 中,对 global/gfwlist/chnroute 模式的定义。

image

from chinadns-ng.

churchmice avatar churchmice commented on July 19, 2024

明白了,感谢解答
饶了一大圈发现最后还是跟白名单模式一样

from chinadns-ng.

Related Issues (20)

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.