sysctl to modify kernel parameters

Note: You can configure some system information via sysctl Linux command, which corresponds to the file /etc/sysctl.conf in Linux, and the contents of all of which controls are in a subdirectory / proc / sys this directory.

Setting method
  • echo value > /proc/sys/x/y

  • Use vim editor to edit the /etc/sysctl.conf file, then use sysctl -p command to take effect this file

  • sysctl -w parameters to be configured = value (this value is 0 and 0 represent mostly not open; 1 represents ON)

Command examples:

# Print all kernel parameters 
sysctl -a 
# ICMP protocol may be closed by the request command, the host is to avoid ping sweep 
sysctl -w net.ipv4.icmp_echo_ignore_all = 1

Use sysctl command to modify kernel parameters are initialized at power remount / proc, so we can modify /etc/sysctl.conf for persistence.

Guess you like

Origin www.cnblogs.com/BeauBiu/p/12459426.html