Comprehensive use of GNU Linux system variables (sysctl configuration command)

Source: Internet
Author: User

Comprehensive use of GNU Linux system variables (sysctl configuration command)

Comprehensive use of GNU Linux system variables (sysctl configuration command)

View the values of all kernel variables
Sysctl-

How to view the value of a system variable
1) cat/proc/sys/net/ipv4/ip_local_port_range
32768 61000

2) sysctl-a | grep ip_local_port_range
Net. ipv4.ip _ local_port_range = 32768 61000

Modification method:
1) echo "1024 65535">/proc/sys/net/ipv4/ip_local_port_range
2) perform the following settings in/etc/sysctl. conf:
Net. ipv4.ip _ local_port_range = 1024 65535
Run sysctl-p to apply these settings;

3) directly use commands to Optimize System Variables
Sysctl-w net. ipv4.ip _ local_port_range = 1024 65535

In the above 2nd methods, many people may. ipv4.ip _ local_port_range and so on. the separated variables do not know how to do this. In fact, this is written as a hierarchical representation of the system variables under the/proc/sys/directory; for example, when cat/proc/sys/net/ipv4/ip_local_port_range is used to view system variables, the full path is used to view the values;

REF:
Meanings and values of IPV4 and IPV6 kernel parameters:

Https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt

Introduction to the main items in the/proc directory:

Http://man7.org/linux/man-pages/man5/proc.5.html

This article permanently updates the link address:

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.