rufengsuixing / luci-app-adguardhome

maybe the best AdGuardHome luci for openwrt
1.41k stars 501 forks source link

fw4 重定向53 不工作 #145

Open liyiranlab opened 10 months ago

liyiranlab commented 10 months ago

提交之前

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

问题详细信息

希望的执行结果

实际的执行结果

日志(重要)

截图

截图:

更多的信息

xmapst commented 7 months ago
添加 转发到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 commented 7 months ago

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

ghost commented 6 months ago

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

xmapst commented 6 months ago

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

将iptables规则用nft重写即可

S0MEW0LF commented 4 months ago
添加 转发到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 commented 2 months ago
添加 转发到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 commented 2 months ago

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

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

link-fgfgui commented 2 months ago
添加 转发到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启动项>本地启动脚本里加入这三句话

MIAOBUSI commented 5 days ago

https://github.com/MIAOBUSI/luci-app-adguardhome,我自己弄了个修复版本,可以试试,我自己用着没问题了