Linux network speed limit

Source: Internet
Author: User

In Linux, there are usually two methods to speed up the network: iptables and TC, or combine them.

1. The simplest way
  • From: http://bbs.chinaunix.net/thread-833575-1-1.html

  • The maximum upload speed of 192.168.0.2 is 30kb/s:
    Iptables-a forward-s 192.168.0.2-m limit -- Limit 20/S-J Accep iptables-a forward-s 192.168.0.2 drop
  • When iptables is used, you need to clear the linked list first and then set the limit. Otherwise, the limit cannot be reached.
  • Sudo/usr/sbin/iptables-F clears the chain. After clearing the chain table, the Network may fail, use iptables-A input-J accept/iptables-A output-J accesudo/usr/sbin/iptables-A input-m limit -- limit 10/S-J accept to limit input to 10 packets per second
  • Sudo/usr/sbin/iptables-A output-m limit -- limit 10/S-J accept limit output is 10 packets per second sudo/usr/sbin/iptables-l list chain sudo /usr/sbin/iptables-A output-s 127.0.0.1-m limit -- Limit 20/S-J accept

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.