如何在 linux RHEL7 中阻止 udp 端口范围
How to block udp ports range in linux RHEL7
需要测试使用 UDP 端口范围从 5000 到 60,000 英寸的应用程序。我想测试端口的边界值条件。所以我想阻止从 5000 到 59999 的 UDP 端口。
使用 iptables:
iptables -A INPUT -p udp --dport 5000:59999 -j DROP
或者更好,
iptables -A INPUT -p udp --dport 5000:59999 -j REJECT --reject-with icmp-port-unreachable
需要测试使用 UDP 端口范围从 5000 到 60,000 英寸的应用程序。我想测试端口的边界值条件。所以我想阻止从 5000 到 59999 的 UDP 端口。
使用 iptables:
iptables -A INPUT -p udp --dport 5000:59999 -j DROP
或者更好,
iptables -A INPUT -p udp --dport 5000:59999 -j REJECT --reject-with icmp-port-unreachable