Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问如何只监听指定接口? #1718

Open
liudongmiao opened this issue Apr 8, 2024 · 7 comments
Open

请问如何只监听指定接口? #1718

liudongmiao opened this issue Apr 8, 2024 · 7 comments

Comments

@liudongmiao
Copy link

需求应用场景
对于特定接口的 53 端口,dnsmasq 不监听(这个 openwrt 提供),改由 smartdns 监听。

建议的方案
加入功能 “监听接口” 或者完善 “绑定到设备” / “绑定的设备名称” 功能。

设备信息

  1. 设备信息(CPU,厂家)
    ath79/generic

  2. 固件信息
    OpenWrt 23.05

目前个人临时绕过方案是让 smartdns 监听非 53 端口,然后手动写配置 bind ...

@PikuZheng
Copy link
Contributor

重复#1229
openwrt的话可以直接在luci里填
image

@liudongmiao
Copy link
Author

liudongmiao commented Apr 9, 2024

@PikuZheng 在问题描述中提到了

完善 “绑定到设备” / “绑定的设备名称” 功能

这个功能看起来不生效,即使使用了这个绑定到设备,最终生成的配置是

bind [::]@xxx

使用 netstat -tulnp 查看结果,还是监听的全部,也就是 [::]。

而 OpenWrt 的 dnsmasq,选定该功能后,则完全不监听其它 端口(接口)(这个选项上面还有一个小的配置。)

因为实际上,我的目标就是

dnsmasq 继续发挥作用,监听特定几个接口~smartdns 监听一个其它指定的接口。

BTW,如果这个功能完善了以后,建议界面上完善成像 OpenWrt 那样的选择接口,而不是现在的输入接口。

@PikuZheng
Copy link
Contributor

image
有何不妥?

@PikuZheng
Copy link
Contributor

明白了
你需要的功能相当于dnsmasq的”非全部地址“

@liudongmiao
Copy link
Author

明白了 你需要的功能相当于dnsmasq的”非全部地址“

是的,就是这个“非全部地址”,这样感觉也一目了解一些,到底监听哪个没监听哪个。

@liudongmiao
Copy link
Author

看了下 dnsmasq 源码以及 ChatGPT 回复,感觉实现还有点难度...

@liudongmiao
Copy link
Author

@PikuZheng 先看看我这个是不是个伪需求~如果只有我一个人想用,我使用其它方式绕过就好。
如果你觉得还有其他人使用,我就再看看要不要提个 PR...

最近发现在几个项目中之前提的需求,作者实现或者PR实现后,到最后发现只有少数人使用,自己都不好意思....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants