Turn
Personal General sysctl-p or sysctl-a more use
Sysctl The kernel parameters that are configured and displayed in the/proc/sys directory. You can use Sysctl to set up or reset networking features such as IP forwarding, IP fragment removal, and source routing checks. Users only need to edit the/etc/sysctl.conf file to manually or automatically perform the functions controlled by sysctl.
Command format:
Sysctl [-n] [-e]-W variable=value
Sysctl [-n] [-e]-P <filename> (default/etc/sysctl.conf)
Sysctl [-n] [-e]-A
The meaning of common parameters:
-W temporarily changes the value of a specified parameter, such as
Sysctl-w net.ipv4.ip_forward=1
-a displays all system parameters
-P loads the system parameters from the specified file, which is loaded from the/etc/sysctl.conf if not specified
If you just want to temporarily change the value of a system parameter, you can do it in two ways, for example, to enable the IP routing forwarding feature:
1) #echo 1 >/proc/sys/net/ipv4/ip_forward
2) #sysctl-W net.ipv4.ip_forward=1
Both of these methods may immediately turn on routing, but if the system restarts, or the
# Service Network Restart
command, the value you set is lost and you can modify the/etc/sysctl.conf file if you want to permanently retain the configuration
Change Net.ipv4.ip_forward=0 to Net.ipv4.ip_forward=1
Sysctl Command Explanation