In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
How to decrypt Linux important system directory, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.
Linux network administrator must pay great attention to this Linux important system directory, now let's describe in detail how the Linux network administrator to configure this directory file.
After understanding the meaning and function of some important files in the / proc/sys/net/core/ directory and / proc/sys/net/ipv4/ directory, let's talk about how to set up these important files in these two directories to work for us.
Readers should understand that in the Linux system, to change the working status and function of a service or device is mainly achieved by using command and directly modifying its configuration files. For files in these two directories, we can also modify the values in the contents of these files in these two ways to make them work according to our intention.
Before setting up, it should be noted that when you decide to modify the current value of a file, make sure that the format and value of the command entered are correct, because any wrong setting will cause kernel instability. If you accidentally cause this problem, you will have to reboot the system. In the following explanation, the author will pay attention to the special description.
First, let's take a look at how to use the command to modify the files in these two directories. We can modify the files in these two directories through the echo and sysctl commands, and the author lists the usage of these two commands respectively below.
1. The sysctl command is customized to set the files in these two directories, and it is installed in the / sbin/ directory by default. We can use this command to display and set the contents of the files in the / proc/sys/net/ directory. For example: the / sbin/sysctl-a command is used to display all the file configuration contents in this directory; the / sbin/sysctl-w command is used to modify the variable values in the specified files in this directory, such as: / sbin/sysctl-w net.ipv4.ip_forward= "1" is used to set to allow IP packet forwarding. Other parameters can be obtained by typing the / sbin/sysctl-h command, which is no longer listed here. It is important to note that the use of this command requires administrator privileges, and if the user is not logged in as an administrator, use the SU command to obtain administrative privileges before using this command.
2. The contents of the files in the / proc/sys/net/ directory can also be modified by using the echo command. For example: echo 1 > / proc/sys/net/ipv4/ip_forward is used to set to allow IP packet forwarding; echo 1 > / proc/sys/net/ipv4/icmp_echo_ignore_all is used to set not to respond to ICMP ECHO packets. When using the echo command, you should also pay special attention to the input format of this command, that is, there must be a space between the echo command and the value, between the value and the symbol (>), and between the symbol and the file path to be modified. Also, some files in these two directories have less than one value, so if you want to pass more than one value at a time, make sure that each value is separated by a space. At the same time, it should be noted that using this method to modify the contents of the files in the / proc/sys/net/ directory will change all the settings to the default values after the system restarts, so if you want to set the value * to be valid, you can directly add this command to the / ect/rc.d/rc.local file, where the path to this file refers to the Readers of other distributions decide on a case-by-case basis. If there are too many command items, you can also write them into a script, add executable permissions, and put them in this file, so that when the system starts, it will be automatically executed according to the settings in / etc/rc.d/rc.local. If you don't want to modify the / etc/rc.d/rc.local file, I recommend you use the / sbin/sysctl command.
It is easy to set up the files in the / proc/sys/net/ directory by command, but some readers prefer to modify their configuration files directly because it is more intuitive, but it is more suitable for users who know more about the system.
Unlike other services or devices, the Linux system provides only one configuration file for the / proc/sys/net/ directory, and that is / ect/sysctl.conf. Users can directly edit the / ect/sysctl.conf configuration file to modify and increase the value of the variables in the file contents in the corresponding / proc/sys/net/ directory, so that when the system starts up, it will read the configuration contents in this file to set the corresponding items. It is very easy to edit this file with vi, and the format of the content in this file is very clear and easy to read, such as the following entry: net.ipv4.ip_forward=0, change the value to 1 and open the IP package to forward. In fact, modifying the contents of the / etc/sysctl.conf file with the / sbin/sysctl command has the same effect as editing the contents of the / sbin/sysctl file directly, so for security, it is recommended that users give priority to the / sbin/sysctl command.
At this point, the reader must have a certain understanding of the two directories / proc/sys/net/core/ and / proc/sys/net/ipv4 / under the / proc/sys/net/ directory. However, this is only the author in order to highlight the role of the / proc/ directory and IPV4 network and specifically selected to explain, in fact, in the / proc/ directory, there are many files, although can not be set by users as the two directories can be set, but these files can be used to understand the details of the system and the current operating status, readers can find a detailed description of this directory from the network.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.