& Lt; explanation of sysctl commands in linux & gt;

Source: Internet
Author: User

 

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.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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.