Annotated edit history of
SysctlNotes version 3, including all changes.
View license author blame.
Rev |
Author |
# |
Line |
1 |
BenStaz |
1 |
!!How to Edit Kernel Parameters During Runtime |
|
|
2 |
|
|
|
3 |
!List all available kernel parameters and their values: |
|
|
4 |
Note : They are all listed under /proc/sys |
|
|
5 |
|
|
|
6 |
*sysctl -a |
|
|
7 |
|
|
|
8 |
!Modify the value of a kernel parameter: |
|
|
9 |
|
|
|
10 |
*sysctl -w variable=value |
|
|
11 |
|
2 |
IanMcDonald |
12 |
For example say I do not want my host to respond to pings (note that this is recommended): |
1 |
BenStaz |
13 |
This can be done by telling the kernel to ignore all ICMP ECHO_REQUEST's |
|
|
14 |
|
|
|
15 |
*sysctl -w net.ipv4.icmp_echo_ignore_all=1 |
|
|
16 |
|
|
|
17 |
OR |
|
|
18 |
|
|
|
19 |
*sysctl -w net/ipv4/icmp_echo_ignore_all=1 |
|
|
20 |
|
|
|
21 |
Notes : |
|
|
22 |
|
|
|
23 |
1. Setting this variable to 1 (or anything other than 0) will make the kernel ignore ICMP echo request's. |
|
|
24 |
|
|
|
25 |
2. The 'net.ipv4.icmp_echo_ignore_all' part above specifies the path inside /proc/sys/ to the file corresponding to the kernel parameter. If you use cat to take a look inside this file you will see that all in contains is '1' (the value of the kernel variable) |
2 |
IanMcDonald |
26 |
|
|
|
27 |
If you want to save these in a file it's usually in /etc/sysctl.conf (see [sysctl.conf(5)]) |
3 |
JamieCurtis |
28 |
|
|
|
29 |
There is also another filesystem full of kernel parameters in called SysFs, normally mounted at /sys. SysFs has more details. |
2 |
IanMcDonald |
30 |
---- |
|
|
31 |
CategoryNotes |
|
|
32 |
---- |
3 |
JamieCurtis |
33 |
See also [sysctl(8)], [sysctl(2)], SysControls, SysFs |