-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
为什么aAdGuardhome配置中开启了“重定向53端口到adguardhome”,AdGuardhome无法获取客户端的真实IP,而只能显示为localhost?
#iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53
#iptables -t nat -A PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53
#[ -n "$(command -v ip6tables)" ] && ip6tables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53
#[ -n "$(command -v ip6tables)" ] && ip6tables -t nat -A PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53
这几行iptables规则会将所有进入路由器的UDP/TCP 53端口流量重定向到本地(localhost)的53端口。由于重定向是在本地进行的,所以AdGuardhome收到的所有流量的源IP地址都将被重定向为localhost,导致Adguardhome客户端IP均显示为localhost 127.0.0.1。将这些防火墙规则加“#”注释或直接删除,再重启防火墙即可。
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels