
[英]How to make a simple traffic control for specific port using “tc” command
[英]How do I apply a traffic limit to those connecting from a specific port with iptables or tc?
To my CentOS server, TCP connection is provided over port 643 and UDP connection is provided over port 6194. I want to add 1 hour drop rule to each IP address that consumes 50MB traffic from each of these ports.
我可以使用iptables
或tc
做到这一点吗? 如果可以,我该怎么做? 我对这个主题不太了解,请您帮帮我好吗?
可以使用tc
(流量控制)限制传入和传出带宽和延迟。 这意味着您可以控制吞吐量,仅随时间变化的数据量。
根据您对 50MB/hr 的描述,您需要为您的rate
设置类似 125kBps 的值。 由于确保只能使用特定数量的流量是带宽限制,因此没有时间限制。
关于这个主题的进一步问题和答案是
更高级的解决方案可能是
即使可以通过示例cutter
工具切断 TCP/IP 连接或使用iptables
设置阻塞时间,我也不知道有任何生产就绪的解决方案来控制网络 session 的时间。 你也可以看看wondershaper
或trickle
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.