linux - 如何在 linux RHEL7 中阻止 udp 端口​​范围

标签 linux udp port

需要测试使用 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

关于linux - 如何在 linux RHEL7 中阻止 udp 端口​​范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39200461/

相关文章:

go - 为什么这个 go 例程在关闭阻塞读取连接时随机无法退出?

php - 无法使用端口号发出 php curl 请求

c - 带有两个常规文件的 sendfile() 中的参数无效

linux - Linux 程序中的偏移指令

python - 如何使用python执行erlang命令

android - 应用程序未收到分段的 UDP 数据包

c - 在 simple_udp_connection 中获取响应

java - JDBC 连接 : How to specify the port for data-transfer?

java - 如何覆盖Spring Boot属性?

c - 我的 linux 的 gcc 编译器不支持 boolean 值