Use command lines to limit the number of network connections

Source: Internet
Author: User
Use the command line to limit the number of Network Connections-Linux Enterprise Application-Linux server application information. The following is a detailed description. Of course, in some cases, the use of P2P software may not be publicly restricted, but the current network situation makes the restriction necessary. In this case, you can use the limit on the number of connections to limit the use of P2P software, to allow you to use, but actually cannot occupy a large amount of bandwidth. In this case, we need to use Linux commands in the graphic interface. Go to the "management" page, and there is a "diagnosis" option in its subpages. In the "diagnosis" command shell, it is a bit similar to the doscommand window in Windows. You can enter the linux Command here. If we want to limit the number of connections for each user in the LAN to 20, enter:

Iptables-I FORWARD-p tcp-m connlimit -- connlimit-abve 20-j REJECT

If you want to limit the number of connections of the specified LAN user to 20, for example, 192.168.0.123, enter:

Iptables-I FORWARD-p tcp-s 192.168.0.123-m connlimit -- connlimit-abve 20-j REJECT

The last step is to limit the number of IP connections other than the specified user to 20. For example, if it is still 192.168.0.123, enter:

Iptables-I FORWARD-p tcp-s! 192.168.0.123-m connlimit -- connlimit-above 20-j REJECT

Enter these commands in the Command window and click Run Command to run them.
Related Article

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.