2023-02-08 12:58:55 +05:30
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2011-2023 Craig Small <csmall@dropbear.xyz>
|
|
|
|
.\" Copyright (c) 2013-2023 Jim Warner <james.warner@comcast.net>
|
|
|
|
.\" Copyright (c) 2011-2012 Sami Kerola <kerolasa@iki.fi>
|
|
|
|
.\" Copyright (c) 2004-2006 Albert Cahalan
|
|
|
|
.\" Copyright (c) 1999 George Staikos <staikos@0wned.org>
|
|
|
|
.\"
|
|
|
|
.\" This program is free software; you can redistribute it and/or modify
|
|
|
|
.\" it under the terms of the GNU General Public License as published by
|
|
|
|
.\" the Free Software Foundation; either version 2 of the License, or
|
|
|
|
.\" (at your option) any later version.
|
|
|
|
.\"
|
|
|
|
.\"
|
2023-01-16 12:59:50 +05:30
|
|
|
.TH SYSCTL "8" "2023-01-16" "procps-ng" "System Administration"
|
2002-02-02 04:17:29 +05:30
|
|
|
.SH NAME
|
|
|
|
sysctl \- configure kernel parameters at runtime
|
|
|
|
.SH SYNOPSIS
|
2011-02-23 13:47:54 +05:30
|
|
|
.B sysctl
|
2013-01-01 07:46:33 +05:30
|
|
|
[\fIoptions\fR] [\fIvariable\fR[\fB=\fIvalue\fR]] [...]
|
|
|
|
.br
|
|
|
|
.B sysctl \-p
|
|
|
|
[\fIfile\fR or \fIregexp\fR] [...]
|
2002-02-02 04:17:29 +05:30
|
|
|
.SH DESCRIPTION
|
|
|
|
.B sysctl
|
|
|
|
is used to modify kernel parameters at runtime. The parameters available
|
2023-01-16 12:59:50 +05:30
|
|
|
are those listed under \fI/proc/sys/\fR. Procfs is required for
|
2011-02-23 13:47:54 +05:30
|
|
|
.B sysctl
|
2002-02-02 04:17:29 +05:30
|
|
|
support in Linux. You can use
|
2011-02-23 13:47:54 +05:30
|
|
|
.B sysctl
|
2002-02-02 04:17:29 +05:30
|
|
|
to both read and write sysctl data.
|
|
|
|
.SH PARAMETERS
|
|
|
|
.TP
|
2011-02-23 13:47:54 +05:30
|
|
|
.I variable
|
2002-02-02 04:17:29 +05:30
|
|
|
The name of a key to read from. An example is kernel.ostype. The '/'
|
|
|
|
separator is also accepted in place of a '.'.
|
|
|
|
.TP
|
2011-02-23 13:47:54 +05:30
|
|
|
.IR variable = value
|
|
|
|
To set a key, use the form
|
|
|
|
.IR variable = value
|
|
|
|
where
|
|
|
|
.I variable
|
|
|
|
is the key and
|
|
|
|
.I value
|
|
|
|
is the value to set it to. If the value contains quotes or characters
|
2002-02-02 04:17:29 +05:30
|
|
|
which are parsed by the shell, you may need to enclose the value in double
|
2018-02-19 15:35:42 +05:30
|
|
|
quotes.
|
2002-02-02 04:17:29 +05:30
|
|
|
.TP
|
2011-06-07 02:47:20 +05:30
|
|
|
\fB\-n\fR, \fB\-\-values\fR
|
2002-02-02 04:17:29 +05:30
|
|
|
Use this option to disable printing of the key name when printing values.
|
|
|
|
.TP
|
2011-06-07 02:47:20 +05:30
|
|
|
\fB\-e\fR, \fB\-\-ignore\fR
|
2002-12-12 04:25:42 +05:30
|
|
|
Use this option to ignore errors about unknown keys.
|
|
|
|
.TP
|
2011-06-07 02:47:20 +05:30
|
|
|
\fB\-N\fR, \fB\-\-names\fR
|
|
|
|
Use this option to only print the names. It may be useful with shells that
|
2004-07-15 20:52:23 +05:30
|
|
|
have programmable completion.
|
|
|
|
.TP
|
2011-06-07 02:47:20 +05:30
|
|
|
\fB\-q\fR, \fB\-\-quiet\fR
|
2004-07-15 10:14:42 +05:30
|
|
|
Use this option to not display the values set to stdout.
|
|
|
|
.TP
|
2011-06-07 02:47:20 +05:30
|
|
|
\fB\-w\fR, \fB\-\-write\fR
|
2018-02-19 15:35:42 +05:30
|
|
|
Use this option when all arguments prescribe a key to be set.
|
2002-02-02 04:17:29 +05:30
|
|
|
.TP
|
2012-01-13 18:29:26 +05:30
|
|
|
\fB\-p\fR[\fIFILE\fR], \fB\-\-load\fR[=\fIFILE\fR]
|
2023-01-16 12:59:50 +05:30
|
|
|
Load in \fBsysctl\fR settings from the file specified or \fI/etc/sysctl.conf\fR
|
|
|
|
if none given. Specifying \- as filename means reading data from standard
|
|
|
|
input. Using this option will mean arguments to
|
2012-05-03 10:54:20 +05:30
|
|
|
.B sysctl
|
2014-04-23 10:30:04 +05:30
|
|
|
are files, which are read in the order they are specified.
|
2014-09-13 23:32:45 +05:30
|
|
|
The file argument may be specified as regular expression.
|
2002-02-02 04:17:29 +05:30
|
|
|
.TP
|
2011-06-07 02:47:20 +05:30
|
|
|
\fB\-a\fR, \fB\-\-all\fR
|
2002-02-02 04:17:29 +05:30
|
|
|
Display all values currently available.
|
|
|
|
.TP
|
2012-02-14 01:51:43 +05:30
|
|
|
\fB\-\-deprecated\fR
|
|
|
|
Include deprecated parameters to
|
|
|
|
.B \-\-all
|
|
|
|
values listing.
|
|
|
|
.TP
|
2011-06-07 02:47:20 +05:30
|
|
|
\fB\-b\fR, \fB\-\-binary\fR
|
|
|
|
Print value without new line.
|
|
|
|
.TP
|
2011-10-07 12:40:49 +05:30
|
|
|
\fB\-\-system\fR
|
2021-03-29 16:37:08 +05:30
|
|
|
Load settings from all system configuration files. See the
|
|
|
|
.B SYSTEM FILE PRECEDENCE
|
|
|
|
section below.
|
2011-10-07 12:40:49 +05:30
|
|
|
.TP
|
2013-07-19 18:20:02 +05:30
|
|
|
\fB\-r\fR, \fB\-\-pattern\fR \fIpattern\fR
|
2011-10-07 12:40:50 +05:30
|
|
|
Only apply settings that match
|
|
|
|
.IR pattern .
|
|
|
|
The
|
|
|
|
.I pattern
|
|
|
|
uses extended regular expression syntax.
|
|
|
|
.TP
|
2011-06-07 02:47:20 +05:30
|
|
|
\fB\-A\fR
|
|
|
|
Alias of \fB\-a\fR
|
|
|
|
.TP
|
|
|
|
\fB\-d\fR
|
|
|
|
Alias of \fB\-h\fR
|
|
|
|
.TP
|
|
|
|
\fB\-f\fR
|
|
|
|
Alias of \fB\-p\fR
|
|
|
|
.TP
|
|
|
|
\fB\-X\fR
|
|
|
|
Alias of \fB\-a\fR
|
|
|
|
.TP
|
|
|
|
\fB\-o\fR
|
2014-04-23 10:30:04 +05:30
|
|
|
Does nothing, exists for BSD compatibility.
|
2011-06-07 02:47:20 +05:30
|
|
|
.TP
|
|
|
|
\fB\-x\fR
|
2014-04-23 10:30:04 +05:30
|
|
|
Does nothing, exists for BSD compatibility.
|
2011-06-07 02:47:20 +05:30
|
|
|
.TP
|
|
|
|
\fB\-h\fR, \fB\-\-help\fR
|
|
|
|
Display help text and exit.
|
|
|
|
.TP
|
|
|
|
\fB\-V\fR, \fB\-\-version\fR
|
|
|
|
Display version information and exit.
|
2021-03-29 16:37:08 +05:30
|
|
|
.SH SYSTEM FILE PRECEDENCE
|
|
|
|
When using the \fB\-\-system\fR option,
|
|
|
|
.B sysctl
|
|
|
|
will read files from directories in the following list in given
|
|
|
|
order from top to bottom. Once a file of a given filename is loaded, any
|
|
|
|
file of the same name in subsequent directories is ignored.
|
|
|
|
|
|
|
|
/etc/sysctl.d/*.conf
|
|
|
|
.br
|
|
|
|
/run/sysctl.d/*.conf
|
|
|
|
.br
|
|
|
|
/usr/local/lib/sysctl.d/*.conf
|
|
|
|
.br
|
|
|
|
/usr/lib/sysctl.d/*.conf
|
|
|
|
.br
|
|
|
|
/lib/sysctl.d/*.conf
|
|
|
|
.br
|
|
|
|
/etc/sysctl.conf
|
|
|
|
|
|
|
|
All configuration files are sorted in lexicographic order, regardless of the
|
|
|
|
directory they reside in. Configuration files can either be completely
|
|
|
|
replaced (by having a new configuration file with the same name in a
|
|
|
|
directory of higher priority) or partially replaced (by having a configuration
|
|
|
|
file that is ordered later).
|
2002-02-02 04:17:29 +05:30
|
|
|
.SH EXAMPLES
|
2011-02-23 13:47:54 +05:30
|
|
|
/sbin/sysctl \-a
|
|
|
|
.br
|
|
|
|
/sbin/sysctl \-n kernel.hostname
|
|
|
|
.br
|
|
|
|
/sbin/sysctl \-w kernel.domainname="example.com"
|
|
|
|
.br
|
2012-01-13 18:29:26 +05:30
|
|
|
/sbin/sysctl \-p/etc/sysctl.conf
|
2011-10-07 12:40:50 +05:30
|
|
|
.br
|
|
|
|
/sbin/sysctl \-a \-\-pattern forward
|
|
|
|
.br
|
|
|
|
/sbin/sysctl \-a \-\-pattern forward$
|
|
|
|
.br
|
|
|
|
/sbin/sysctl \-a \-\-pattern 'net.ipv4.conf.(eth|wlan)0.arp'
|
|
|
|
.br
|
2021-02-25 14:05:33 +05:30
|
|
|
/sbin/sysctl \-\-pattern '\[char94]net.ipv6' \-\-system
|
2012-02-14 01:51:43 +05:30
|
|
|
.SH DEPRECATED PARAMETERS
|
|
|
|
The
|
|
|
|
.B base_reachable_time
|
|
|
|
and
|
|
|
|
.B retrans_time
|
2020-06-04 17:55:26 +05:30
|
|
|
are deprecated. The
|
|
|
|
.B sysctl
|
|
|
|
command does not allow changing values of these
|
2014-09-16 11:21:13 +05:30
|
|
|
parameters. Users who insist to use deprecated kernel interfaces should push values
|
2023-01-16 12:59:50 +05:30
|
|
|
to \fB/proc\fR file system by other means. For example:
|
2012-02-14 01:51:43 +05:30
|
|
|
.PP
|
|
|
|
echo 256 > /proc/sys/net/ipv6/neigh/eth0/base_reachable_time
|
2002-02-02 04:17:29 +05:30
|
|
|
.SH FILES
|
|
|
|
.I /proc/sys
|
2011-02-23 13:47:54 +05:30
|
|
|
.br
|
2020-02-27 16:26:13 +05:30
|
|
|
.I /etc/sysctl.d/*.conf
|
|
|
|
.br
|
|
|
|
.I /run/sysctl.d/*.conf
|
|
|
|
.br
|
|
|
|
.I /usr/local/lib/sysctl.d/*.conf
|
|
|
|
.br
|
|
|
|
.I /usr/lib/sysctl.d/*.conf
|
|
|
|
.br
|
|
|
|
.I /lib/sysctl.d/*.conf
|
|
|
|
.br
|
2002-02-02 04:17:29 +05:30
|
|
|
.I /etc/sysctl.conf
|
|
|
|
.SH SEE ALSO
|
|
|
|
.BR sysctl.conf (5)
|
2011-10-07 12:40:50 +05:30
|
|
|
.BR regex (7)
|
2002-02-02 04:17:29 +05:30
|
|
|
.SH AUTHOR
|
2012-04-16 16:25:53 +05:30
|
|
|
.UR staikos@0wned.org
|
2011-06-07 02:47:20 +05:30
|
|
|
George Staikos
|
|
|
|
.UE
|
|
|
|
.SH "REPORTING BUGS"
|
|
|
|
Please send bug reports to
|
2012-04-16 16:25:53 +05:30
|
|
|
.UR procps@freelists.org
|
2011-06-07 02:47:20 +05:30
|
|
|
.UE
|