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: