问题原文
原帖链接 · alfredogoncalves · CC BY-SA 4.0
could someone help to make iptables to drop all the packets with length 1006?
Example: 18:33:18.964261 IP 74.209.87.132.3054 > 126.220.67.183.13806: UDP, length 1006
社区高分解答
原帖链接 · Anton Danilov · CC BY-SA 4.0
You should use the length match. It supports the range of length.
To drop all udp packets with length 1006 bytes:
iptables -I INPUT -p udp -m length --length 1006 -j DROP
P.S.
- The
iptables -m length --helpshows the brief help of thelengthmatch. - Read the iptables tutorial to understand of the basics.
- Other rules and order of the rules are very important.
- Better use the
iptables-applyto safe change of the rule set (read the man). - To troubleshoot check the rule counters.
- The tcpdump captures incoming packets before the iptables.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
