如何通过iptables阻止从bind发送到相同IP地址的拒绝数据包序列?
我想过使用字符串扩展来寻找“拒绝”。这会保护 dns 免受 DoS 攻击吗?
我的尝试:
iptables -A INPUT -p udp -m udp --sport 53 -m string --string "Refused" --algo bm -m recent --set --name block-dns --rsource
iptables -A INPUT -p udp -m udp --sport 53 -m string --string "Refused" --algo bm -m recent --rcheck --seconds 10 --hitcount 1 --name block-dns --rsource -j DROP
Run Code Online (Sandbox Code Playgroud)