Code Monkey home page Code Monkey logo

Comments (17)

zfl9 avatar zfl9 commented on May 27, 2024

路由器上,53端口被占用了。

from ipt2socks.

zfl9 avatar zfl9 commented on May 27, 2024

这个是无解的,除非占用这个53端口的进程设置 SO_REUSEADDR。ipt2socks 本身是默认设置了 SO_REUSEADDR,但是这个选项必须要双方都设置才有效:

set_reuse_addr(sockfd);

from ipt2socks.

zfl9 avatar zfl9 commented on May 27, 2024

如果你无法为这个占用53端口的程序设置SO_REUSEADDR,那么可尝试另外一种方式避免:比如使用非53端口的dns-server。

from ipt2socks.

XenMe avatar XenMe commented on May 27, 2024

主要是配合chinadns-ng使用,chinadns监听在53

这样的话,得这样用?
chinadns用非标,chinadns到GoogleDNS的请求走ipt2socks?

折腾了一周,有点疑问的是为何ipt2socks会需要使用53端口?

from ipt2socks.

zfl9 avatar zfl9 commented on May 27, 2024

有点疑问的是为何ipt2socks会需要使用53端口?

因为tproxy透明代理就是这样,ipt2socks在收到8888:53回复包后将创建一个socket,然后绑定到8888:53地址,“假装”是8.8.8.8:53对chinadns进行回复。这就是透明代理的核心所在。

from ipt2socks.

zfl9 avatar zfl9 commented on May 27, 2024

但是你现在遇到的问题是,在绑定到8.8.8.8:53/udp地址的时候,这个地址被其它进程占用了。

from ipt2socks.

zfl9 avatar zfl9 commented on May 27, 2024

稍等,我发现问题所在了,你说的是chinadns还是chinadns-ng?

from ipt2socks.

zfl9 avatar zfl9 commented on May 27, 2024

如果是chinadns-ng的话,我可以加个选项,启用SO_REUSEADDR的。

from ipt2socks.

XenMe avatar XenMe commented on May 27, 2024

chinadns-ng

from ipt2socks.

zfl9 avatar zfl9 commented on May 27, 2024

ok,那我修改一下chinadns-ng,默认开启so_reuseaddr。

from ipt2socks.

XenMe avatar XenMe commented on May 27, 2024

如果是chinadns-ng的话,我可以加个选项,启用SO_REUSEADDR的。

感谢,一路从ss-tproxy折腾过来的。

题外话,ss-tproxy里面看到介绍了ipt2socks,但好像里面没有使用到。所以,无从参考,折腾了很久

from ipt2socks.

zfl9 avatar zfl9 commented on May 27, 2024

是的,因为目前ipt2socks有个小问题,会导致进程意外退出。不过我已经开始打算重构了。

好像里面没有使用到。所以,无从参考,折腾了很久

其实用到了,只是不是必用的那种,因为可以直接ss-redir/v2ray之类的提供透明代理。ipt2socks主要是配合socks5代理,以提供tproxy透明代理端口支持的。说白了就是类似 redsocks2

from ipt2socks.

XenMe avatar XenMe commented on May 27, 2024

目前上层协议太多,最近换了Trojan, UDP不支持TPROXY,所有只能用ipt2socks转换一下。

期待重构,再次感谢!

from ipt2socks.

zfl9 avatar zfl9 commented on May 27, 2024

更新chinadns-ng,重新编译一下,应该就不会提示端口被占用了

from ipt2socks.

XenMe avatar XenMe commented on May 27, 2024

马上试,感谢!

from ipt2socks.

XenMe avatar XenMe commented on May 27, 2024

替换chinadns-ng之后,其余不需要任何修改就可以了。
意外退出确实较频繁,只能等您重构了。

from ipt2socks.

zfl9 avatar zfl9 commented on May 27, 2024

嗯,我尽力。

from ipt2socks.

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.