5509c00
From 59fccb9cb4eba406dbee93864638cc52f6ee7d4a Mon Sep 17 00:00:00 2001
5509c00
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
5509c00
Date: Thu, 19 Jun 2014 20:43:56 -0400
5509c00
Subject: [PATCH] man: document statically loading modules for sysctl settings
5509c00
5509c00
https://bugzilla.redhat.com/show_bug.cgi?id=1022977
5509c00
https://bugzilla.novell.com/show_bug.cgi?id=725412
5509c00
(cherry picked from commit 7284335adbb8cb2bc9c11f9e102906da1bf71145)
5509c00
---
5509c00
 man/sysctl.d.xml | 79 +++++++++++++++++++++++++++++++++++++++-----------------
5509c00
 1 file changed, 56 insertions(+), 23 deletions(-)
5509c00
5509c00
diff --git a/man/sysctl.d.xml b/man/sysctl.d.xml
5509c00
index db53b495..78c4e80b 100644
5509c00
--- a/man/sysctl.d.xml
5509c00
+++ b/man/sysctl.d.xml
5509c00
@@ -71,24 +71,6 @@
5509c00
                 is <literal>#</literal> or <literal>;</literal> are
5509c00
                 ignored.</para>
5509c00
 
5509c00
-                <para>Note that either <literal>/</literal> or
5509c00
-                <literal>.</literal> may be used as separators within
5509c00
-                sysctl variable names. If the first separator is a
5509c00
-                slash, remaining slashes and dots are left intact. If
5509c00
-                the first separator is a dot, dots and slashes are
5509c00
-                interchanged. <literal>kernel.domainname=foo</literal>
5509c00
-                and <literal>kernel/domainname=foo</literal> are
5509c00
-                equivalent and will cause <literal>foo</literal> to
5509c00
-                be written to
5509c00
-                <filename>/proc/sys/kernel/domainname</filename>.
5509c00
-                Either
5509c00
-                <literal>net.ipv4.conf.enp3s0/200.forwarding</literal>
5509c00
-                or
5509c00
-                <literal>net/ipv4/conf/enp3s0.200/forwarding</literal>
5509c00
-                may be used to refer to
5509c00
-                <filename>/proc/sys/net/ipv4/conf/enp3s0.200/forwarding</filename>.
5509c00
-                </para>
5509c00
-
5509c00
                 <para>Each configuration file shall be named in the
5509c00
                 style of <filename><replaceable>program</replaceable>.conf</filename>.
5509c00
                 Files in <filename>/etc/</filename> override files
5509c00
@@ -110,6 +92,24 @@
5509c00
                 number and a dash, to simplify the ordering of the
5509c00
                 files.</para>
5509c00
 
5509c00
+                <para>Note that either <literal>/</literal> or
5509c00
+                <literal>.</literal> may be used as separators within
5509c00
+                sysctl variable names. If the first separator is a
5509c00
+                slash, remaining slashes and dots are left intact. If
5509c00
+                the first separator is a dot, dots and slashes are
5509c00
+                interchanged. <literal>kernel.domainname=foo</literal>
5509c00
+                and <literal>kernel/domainname=foo</literal> are
5509c00
+                equivalent and will cause <literal>foo</literal> to
5509c00
+                be written to
5509c00
+                <filename>/proc/sys/kernel/domainname</filename>.
5509c00
+                Either
5509c00
+                <literal>net.ipv4.conf.enp3s0/200.forwarding</literal>
5509c00
+                or
5509c00
+                <literal>net/ipv4/conf/enp3s0.200/forwarding</literal>
5509c00
+                may be used to refer to
5509c00
+                <filename>/proc/sys/net/ipv4/conf/enp3s0.200/forwarding</filename>.
5509c00
+                </para>
5509c00
+
5509c00
                 <para>If the administrator wants to disable a
5509c00
                 configuration file supplied by the vendor, the
5509c00
                 recommended way is to place a symlink to
5509c00
@@ -125,16 +125,48 @@
5509c00
                 specifically,
5509c00
                 <filename>net.ipv4.conf.*</filename>,
5509c00
                 <filename>net.ipv6.conf.*</filename>,
5509c00
-                <filename>net.ipv4.neigh.*</filename> and <filename>net.ipv6.neigh.*</filename>)</para>
5509c00
+                <filename>net.ipv4.neigh.*</filename> and <filename>net.ipv6.neigh.*</filename>).</para>
5509c00
+
5509c00
+                <para>Many sysctl parameters only become available
5509c00
+                when certain kernel modules are loaded. Modules are
5509c00
+                usually loaded on demand, e.g. when certain hardware
5509c00
+                is plugged in or network brought up. This means that
5509c00
+                <citerefentry><refentrytitle>systemd-sysctl.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> which runs
5509c00
+                during early boot will not configure such parameters
5509c00
+                if they become available after it has run. To
5509c00
+                set such parameters, it is recommended to add
5509c00
+                an <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry> rule to set those parameters when they become
5509c00
+                available. Alternatively, a slightly simpler and
5509c00
+                less efficient option is to add the module to
5509c00
+                <citerefentry><refentrytitle>modules-load.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>, causing it to be loaded statically
5509c00
+                before sysctl settings are applied (see
5509c00
+                example below).</para>
5509c00
         </refsect1>
5509c00
 
5509c00
         <refsect1>
5509c00
-                <title>Example</title>
5509c00
+                <title>Examples</title>
5509c00
+                <example>
5509c00
+                        <title>Set kernel YP domain name</title>
5509c00
+                        <para><filename>/etc/sysctl.d/domain-name.conf</filename>:
5509c00
+                        </para>
5509c00
+
5509c00
+                        <programlisting>kernel.domainname=example.com</programlisting>
5509c00
+                </example>
5509c00
+
5509c00
                 <example>
5509c00
-                        <title>/etc/sysctl.d/domain-name.conf example:</title>
5509c00
+                        <title>Disable packet filter on the bridge</title>
5509c00
+                        <para><filename>/etc/modules-load.d/bridge.conf</filename>:
5509c00
+                        </para>
5509c00
+
5509c00
+                        <programlisting>bridge</programlisting>
5509c00
+
5509c00
+                        <para><filename>/etc/sysctl.d/bridge.conf</filename>:
5509c00
+                        </para>
5509c00
 
5509c00
-                        <programlisting># Set kernel YP domain name
5509c00
-kernel.domainname=example.com</programlisting>
5509c00
+                        <programlisting>net.bridge.bridge-nf-call-ip6tables = 0
5509c00
+net.bridge.bridge-nf-call-iptables = 0
5509c00
+net.bridge.bridge-nf-call-arptables = 0
5509c00
+</programlisting>
5509c00
                 </example>
5509c00
         </refsect1>
5509c00
 
5509c00
@@ -146,6 +178,7 @@ kernel.domainname=example.com</programlisting>
5509c00
                         <citerefentry><refentrytitle>systemd-delta</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
5509c00
                         <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
5509c00
                         <citerefentry><refentrytitle>sysctl.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
5509c00
+                        <citerefentry><refentrytitle>modprobe</refentrytitle><manvolnum>8</manvolnum></citerefentry>
5509c00
                 </para>
5509c00
         </refsect1>
5509c00