3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
5 This file is part of systemd.
7 Copyright 2011 Lennart Poettering
9 systemd is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation; either version 2.1 of the License, or
12 (at your option) any later version.
14 systemd is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
19 You should have received a copy of the GNU Lesser General Public License
20 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 <refentry id="sysctl.d">
25 <title>sysctl.d</title>
26 <productname>systemd</productname>
30 <contrib>Developer</contrib>
31 <firstname>Lennart</firstname>
32 <surname>Poettering</surname>
33 <email>lennart@poettering.net</email>
39 <refentrytitle>sysctl.d</refentrytitle>
40 <manvolnum>5</manvolnum>
44 <refname>sysctl.d</refname>
45 <refpurpose>Configure kernel parameters at boot</refpurpose>
49 <para><filename>/etc/sysctl.d/*.conf</filename></para>
50 <para><filename>/run/sysctl.d/*.conf</filename></para>
51 <para><filename>/usr/lib/sysctl.d/*.conf</filename></para>
55 <title>Description</title>
58 <citerefentry><refentrytitle>systemd-sysctl.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
59 reads configuration files from the above directories
61 <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>
62 kernel parameters.</para>
66 <title>Configuration Format</title>
68 <para>The configuration files contain a list of
69 variable assignments, separated by newlines. Empty
70 lines and lines whose first non-whitespace character
71 is <literal>#</literal> or <literal>;</literal> are
74 <para>Note that either <literal>/</literal> or
75 <literal>.</literal> may be used as separators within
76 sysctl variable names. If the first separator is a
77 slash, remaining slashes and dots are left intact. If
78 the first separator is a dot, dots and slashes are
79 interchanged. <literal>kernel.domainname=foo</literal>
80 and <literal>kernel/domainname=foo</literal> are
81 equivalent and will cause <literal>foo</literal> to
83 <filename>/proc/sys/kernel/domainname</filename>.
85 <literal>net.ipv4.conf.enp3s0/200.forwarding</literal>
87 <literal>net/ipv4/conf/enp3s0.200/forwarding</literal>
88 may be used to refer to
89 <filename>/proc/sys/net/ipv4/conf/enp3s0.200/forwarding</filename>.
92 <para>Each configuration file shall be named in the
93 style of <filename><replaceable>program</replaceable>.conf</filename>.
94 Files in <filename>/etc/</filename> override files
95 with the same name in <filename>/usr/lib/</filename>
96 and <filename>/run/</filename>. Files in
97 <filename>/run/</filename> override files with the same
98 name in <filename>/usr/lib/</filename>. Packages
99 should install their configuration files in
100 <filename>/usr/lib/</filename>. Files in
101 <filename>/etc/</filename> are reserved for the local
102 administrator, who may use this logic to override the
103 configuration files installed by vendor packages. All
104 configuration files are sorted by their filename in
105 lexicographic order, regardless of which of the
106 directories they reside in. If multiple files specify the
107 same variable name, the entry in the file with the
108 lexicographically latest name will be applied. It is
109 recommended to prefix all filenames with a two-digit
110 number and a dash, to simplify the ordering of the
113 <para>If the administrator wants to disable a
114 configuration file supplied by the vendor, the
115 recommended way is to place a symlink to
116 <filename>/dev/null</filename> in
117 <filename>/etc/sysctl.d/</filename> bearing the
118 same filename.</para>
120 <para>The settings configured with
121 <filename>sysctl.d</filename> files will be applied
122 early on boot. The network interface-specific options
123 will also be applied individually for each network
124 interface as it shows up in the system. (More
126 <filename>net.ipv4.conf.*</filename>,
127 <filename>net.ipv6.conf.*</filename>,
128 <filename>net.ipv4.neigh.*</filename> and <filename>net.ipv6.neigh.*</filename>)</para>
132 <title>Example</title>
134 <title>/etc/sysctl.d/domain-name.conf example:</title>
136 <programlisting># Set kernel YP domain name
137 kernel.domainname=example.com</programlisting>
142 <title>See Also</title>
144 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
145 <citerefentry><refentrytitle>systemd-sysctl.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
146 <citerefentry><refentrytitle>systemd-delta</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
147 <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
148 <citerefentry><refentrytitle>sysctl.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>