The Sysctl command sets the core parameters of the system:
Usage:
-Parameter a lists all core settings in the system.
Of course, these core settings are all files stored in/Proc/sys/netDirectory.
Here is a representative example:
Net. ipv4.icmp _ echo_ignore_all = 0Change all vertices/You can.
[Root @ redhat net] # net. ipv4.icmp _ echo_ignore_all = 0
[Root @ redhat net] # cd ipv4/
[Root @ redhat ipv4] # cat icmp_echo_ignore_all
0
We can edit or import the file to avoid file errors, but there are also related commands to modify it:
-WThe parameter is valid only for English words and invalid for numbers. You can also see that the absolute path is used, and the relative path is not allowed.
To use the relative path:
The import method is only valid for relative paths.
Tip:
This file is equal1Is forbiddenPing.
[Root @ redhat ipv4] # cat icmp_echo_ignore_all // The changes are temporary. After the restart, the system will be reassigned. Write the changes to/etc/sysctl. conf if they are permanently effective.
1
Echo "icmp_echo_ignore_all = 1">/etc/sysctl. conf
Next let's take a lookSysctlThe valid file of this command.
# Vim/etc/sysctl. conf
Enable kernel routing: default parameter= 0
Et. ipv4.ip _ forward = 1
Make the configuration take effect directly:# Sysctl-p
# Sysctl-pYou can also specifySysctlCommand configuration file, which is stored in/Etc/sysctl. confIn fact, you can also specify it yourself.