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

fw4 重定向53 不工作 #145

Open
2 tasks
liyiranlab opened this issue Jan 2, 2024 · 8 comments
Open
2 tasks

fw4 重定向53 不工作 #145

liyiranlab opened this issue Jan 2, 2024 · 8 comments

Comments

@liyiranlab
Copy link

提交之前

在你提交问题之前请回答以下问题
你可以删掉提交之前这个部分

  • 我用着最新版的 luci-app-adguardhome
  • 我检查了没有人提交同样的问题

问题详细信息

  • AdGuard Home luci的版本:
  • AdGuard Home server的版本:
  • 操作系统和版本:

希望的执行结果

实际的执行结果

日志(重要)

截图

截图:

更多的信息

@xmapst
Copy link

xmapst commented Apr 12, 2024

添加 转发到adguardhome 1053端口
nft add table inet adguardhome
nft add chain inet adguardhome prerouting "{ type nat hook prerouting priority -110; policy accept; }"
nft add rule inet adguardhome prerouting "meta nfproto { ipv4, ipv6 } udp dport 53 counter redirect to :1053 comment \"ADGUARDHOME HIJACK\""

# 清理
! nft --check list table inet adguardhome > "/dev/null" 2>&1 || nft delete table inet adguardhome

@iseku
Copy link

iseku commented Apr 16, 2024

可能是没有安装iptables-nft和iptables-mod-nat-extra,安装上就兼容fw4了

@ghost
Copy link

ghost commented May 1, 2024

有没有办法关闭默认的ipt防火墙,只使用nft防火墙,每次一启动这个插件,防火墙一直在报使用旧版协议。

@xmapst
Copy link

xmapst commented May 5, 2024

有没有办法关闭默认的ipt防火墙,只使用nft防火墙,每次一启动这个插件,防火墙一直在报使用旧版协议。

将iptables规则用nft重写即可

@S0MEW0LF
Copy link

添加 转发到adguardhome 1053端口
nft add table inet adguardhome
nft add chain inet adguardhome prerouting "{ type nat hook prerouting priority -110; policy accept; }"
nft add rule inet adguardhome prerouting "meta nfproto { ipv4, ipv6 } udp dport 53 counter redirect to :1053 comment \"ADGUARDHOME HIJACK\""

# 清理
! nft --check list table inet adguardhome > "/dev/null" 2>&1 || nft delete table inet adguardhome

ssh上输入那三行命令后有效,但是路由器重启后就失效了。怎么可以让它一直生效呢?

@gdanmac
Copy link

gdanmac commented Aug 31, 2024

添加 转发到adguardhome 1053端口
nft add table inet adguardhome
nft add chain inet adguardhome prerouting "{ type nat hook prerouting priority -110; policy accept; }"
nft add rule inet adguardhome prerouting "meta nfproto { ipv4, ipv6 } udp dport 53 counter redirect to :1053 comment \"ADGUARDHOME HIJACK\""

# 清理
! nft --check list table inet adguardhome > "/dev/null" 2>&1 || nft delete table inet adguardhome

ssh上输入那三行命令后有效,但是路由器重启后就失效了。怎么可以让它一直生效呢?

openwrt firewall4(FW4)自定义防火墙规则的方法

@GoogleBeEvil
Copy link

GoogleBeEvil commented Sep 1, 2024

@lllrrr2 有人改写了 但是我编译出来仍然是失效的
kongfl888/luci-app-adguardhome@master...starllll:luci-app-adguardhome:master

还有人改写了uci' firewall,似乎重定向53到adg生效了 然后作为dnsmasq上级就失效了
https://github.com/stevenjoezhang/luci-app-adguardhome

@link-fgfgui
Copy link

添加 转发到adguardhome 1053端口
nft add table inet adguardhome
nft add chain inet adguardhome prerouting "{ type nat hook prerouting priority -110; policy accept; }"
nft add rule inet adguardhome prerouting "meta nfproto { ipv4, ipv6 } udp dport 53 counter redirect to :1053 comment \"ADGUARDHOME HIJACK\""

# 清理
! nft --check list table inet adguardhome > "/dev/null" 2>&1 || nft delete table inet adguardhome

ssh上输入那三行命令后有效,但是路由器重启后就失效了。怎么可以让它一直生效呢?

可以在openwrt启动项>本地启动脚本里加入这三句话

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

7 participants