{
    "mode": "man",
    "parameter": "SYSCTL.D",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/SYSCTL.D/5/json",
    "generated": "2026-07-05T09:35:26Z",
    "synopsis": "/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\nkey.name.under.proc.sys = some value\nkey/name/under/proc/sys = some value\nkey/middle.part.with.dots/foo = 123\nkey.middle/part/with/dots.foo = 123\n-key.that.will.not.fail = value\nkey.pattern.*.with.glob = whatever\n-key.pattern.excluded.with.glob\nkey.pattern.overridden.with.glob = custom",
    "sections": {
        "NAME": {
            "content": "sysctl.d - Configure kernel parameters at boot\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "/etc/sysctl.d/*.conf\n\n/run/sysctl.d/*.conf\n\n/usr/lib/sysctl.d/*.conf\n\nkey.name.under.proc.sys = some value\nkey/name/under/proc/sys = some value\nkey/middle.part.with.dots/foo = 123\nkey.middle/part/with/dots.foo = 123\n-key.that.will.not.fail = value\nkey.pattern.*.with.glob = whatever\n-key.pattern.excluded.with.glob\nkey.pattern.overridden.with.glob = custom\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "At boot, systemd-sysctl.service(8) reads configuration files from the above directories to\nconfigure sysctl(8) kernel parameters.\n",
            "subsections": []
        },
        "CONFIGURATION FORMAT": {
            "content": "The configuration files contain a list of variable assignments, separated by newlines. Empty\nlines and lines whose first non-whitespace character is \"#\" or \";\" are ignored.\n\nNote that either \"/\" or \".\"  may be used as separators within sysctl variable names. If the\nfirst separator is a slash, remaining slashes and dots are left intact. If the first\nseparator is a dot, dots and slashes are interchanged.  \"kernel.domainname=foo\" and\n\"kernel/domainname=foo\" are equivalent and will cause \"foo\" to be written to\n/proc/sys/kernel/domainname. Either \"net.ipv4.conf.enp3s0/200.forwarding\" or\n\"net/ipv4/conf/enp3s0.200/forwarding\" may be used to refer to\n/proc/sys/net/ipv4/conf/enp3s0.200/forwarding. A glob glob(7) pattern may be used to write\nthe same value to all matching keys. Keys for which an explicit pattern exists will be\nexcluded from any glob matching. In addition, a key may be explicitly excluded from being set\nby any matching glob patterns by specifying the key name prefixed with a \"-\" character and\nnot followed by \"=\", see SYNOPSIS.\n\nAny access permission errors and attempts to write variables not present on the local system\nare logged at debug level and do not cause the service to fail. Other types of errors when\nsetting variables are logged with higher priority and cause the service to return failure at\nthe end (after processing other variables). As an exception, if a variable assignment is\nprefixed with a single \"-\" character, failure to set the variable for any reason will be\nlogged at debug level and will not cause the service to fail.\n\nThe settings configured with sysctl.d files will be applied early on boot. The network\ninterface-specific options will also be applied individually for each network interface as it\nshows up in the system. (More specifically, net.ipv4.conf.*, net.ipv6.conf.*,\nnet.ipv4.neigh.*  and net.ipv6.neigh.*).\n\nMany sysctl parameters only become available when certain kernel modules are loaded. Modules\nare usually loaded on demand, e.g. when certain hardware is plugged in or network brought up.\nThis means that systemd-sysctl.service(8) which runs during early boot will not configure\nsuch parameters if they become available after it has run. To set such parameters, it is\nrecommended to add an udev(7) rule to set those parameters when they become available.\nAlternatively, a slightly simpler and less efficient option is to add the module to modules-\nload.d(5), causing it to be loaded statically before sysctl settings are applied (see example\nbelow).\n",
            "subsections": []
        },
        "CONFIGURATION DIRECTORIES AND PRECEDENCE": {
            "content": "Configuration files are read from directories in /etc/, /run/, /usr/local/lib/, and /lib/, in\norder of precedence, as listed in the SYNOPSIS section above. Files must have the \".conf\"\nextension. Files in /etc/ override files with the same name in /run/, /usr/local/lib/, and\n/lib/. Files in /run/ override files with the same name under /usr/.\n\nAll configuration files are sorted by their filename in lexicographic order, regardless of\nwhich of the directories they reside in. If multiple files specify the same option, the entry\nin the file with the lexicographically latest name will take precedence. Thus, the\nconfiguration in a certain file may either be replaced completely (by placing a file with the\nsame name in a directory with higher priority), or individual settings might be changed (by\nspecifying additional settings in a file with a different name that is ordered later).\n\nPackages should install their configuration files in /usr/lib/ (distribution packages) or\n/usr/local/lib/ (local installs). Files in /etc/ are reserved for the local administrator,\nwho may use this logic to override the configuration files installed by vendor packages. It\nis recommended to prefix all filenames with a two-digit number and a dash, to simplify the\nordering of the files.\n\nIf the administrator wants to disable a configuration file supplied by the vendor, the\nrecommended way is to place a symlink to /dev/null in the configuration directory in /etc/,\nwith the same filename as the vendor configuration file. If the vendor configuration file is\nincluded in the initrd image, the image has to be regenerated.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "",
            "subsections": [
                {
                    "name": "Example 1. Set kernel YP domain name",
                    "content": "/etc/sysctl.d/domain-name.conf:\n\nkernel.domainname=example.com\n"
                },
                {
                    "name": "Example 2. Apply settings available only when a certain module is loaded (method one)",
                    "content": "/etc/udev/rules.d/99-bridge.rules:\n\nACTION==\"add\", SUBSYSTEM==\"module\", KERNEL==\"brnetfilter\", \\\nRUN+=\"/lib/systemd/systemd-sysctl --prefix=/net/bridge\"\n\n/etc/sysctl.d/bridge.conf:\n\nnet.bridge.bridge-nf-call-ip6tables = 0\nnet.bridge.bridge-nf-call-iptables = 0\nnet.bridge.bridge-nf-call-arptables = 0\n\nThis method applies settings when the module is loaded. Please note that, unless the\nbrnetfilter module is loaded, bridged packets will not be filtered by Netfilter (starting\nwith kernel 3.18), so simply not loading the module is sufficient to avoid filtering.\n"
                },
                {
                    "name": "Example 3. Apply settings available only when a certain module is loaded (method two)",
                    "content": "/etc/modules-load.d/bridge.conf:\n\nbrnetfilter\n\n/etc/sysctl.d/bridge.conf:\n\nnet.bridge.bridge-nf-call-ip6tables = 0\nnet.bridge.bridge-nf-call-iptables = 0\nnet.bridge.bridge-nf-call-arptables = 0\n\nThis method forces the module to be always loaded. Please note that, unless the brnetfilter\nmodule is loaded, bridged packets will not be filtered with Netfilter (starting with kernel\n3.18), so simply not loading the module is sufficient to avoid filtering.\n"
                },
                {
                    "name": "Example 4. Set network routing properties for all interfaces",
                    "content": "/etc/sysctl.d/20-rpfilter.conf:\n\nnet.ipv4.conf.default.rpfilter = 2\nnet.ipv4.conf.*.rpfilter = 2\n-net.ipv4.conf.all.rpfilter\nnet.ipv4.conf.hub0.rpfilter = 1\n\nThe rpfilter key will be set to \"2\" for all interfaces, except \"hub0\". We set\nnet.ipv4.conf.default.rpfilter first, so any interfaces which are added later will get this\nvalue (this also covers any interfaces detected while we're running). The glob matches any\ninterfaces which were detected earlier. The glob will also match net.ipv4.conf.all.rpfilter,\nwhich we don't want to set at all, so it is explicitly excluded. And \"hub0\" is excluded from\nthe glob because it has an explicit setting.\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "systemd(1), systemd-sysctl.service(8), systemd-delta(1), sysctl(8), sysctl.conf(5),\nmodprobe(8)\n\n\n\nsystemd 249                                                                              SYSCTL.D(5)",
            "subsections": []
        }
    },
    "summary": "sysctl.d - Configure kernel parameters at boot",
    "flags": [],
    "examples": [
        "/etc/sysctl.d/domain-name.conf:",
        "kernel.domainname=example.com",
        "/etc/udev/rules.d/99-bridge.rules:",
        "ACTION==\"add\", SUBSYSTEM==\"module\", KERNEL==\"brnetfilter\", \\",
        "RUN+=\"/lib/systemd/systemd-sysctl --prefix=/net/bridge\"",
        "/etc/sysctl.d/bridge.conf:",
        "net.bridge.bridge-nf-call-ip6tables = 0",
        "net.bridge.bridge-nf-call-iptables = 0",
        "net.bridge.bridge-nf-call-arptables = 0",
        "This method applies settings when the module is loaded. Please note that, unless the",
        "brnetfilter module is loaded, bridged packets will not be filtered by Netfilter (starting",
        "with kernel 3.18), so simply not loading the module is sufficient to avoid filtering.",
        "/etc/modules-load.d/bridge.conf:",
        "brnetfilter",
        "/etc/sysctl.d/bridge.conf:",
        "net.bridge.bridge-nf-call-ip6tables = 0",
        "net.bridge.bridge-nf-call-iptables = 0",
        "net.bridge.bridge-nf-call-arptables = 0",
        "This method forces the module to be always loaded. Please note that, unless the brnetfilter",
        "module is loaded, bridged packets will not be filtered with Netfilter (starting with kernel",
        "3.18), so simply not loading the module is sufficient to avoid filtering.",
        "/etc/sysctl.d/20-rpfilter.conf:",
        "net.ipv4.conf.default.rpfilter = 2",
        "net.ipv4.conf.*.rpfilter = 2",
        "-net.ipv4.conf.all.rpfilter",
        "net.ipv4.conf.hub0.rpfilter = 1",
        "The rpfilter key will be set to \"2\" for all interfaces, except \"hub0\". We set",
        "net.ipv4.conf.default.rpfilter first, so any interfaces which are added later will get this",
        "value (this also covers any interfaces detected while we're running). The glob matches any",
        "interfaces which were detected earlier. The glob will also match net.ipv4.conf.all.rpfilter,",
        "which we don't want to set at all, so it is explicitly excluded. And \"hub0\" is excluded from",
        "the glob because it has an explicit setting."
    ],
    "see_also": [
        {
            "name": "systemd",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/systemd/1/json"
        },
        {
            "name": "systemd-sysctl.service",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/systemd-sysctl.service/8/json"
        },
        {
            "name": "systemd-delta",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/systemd-delta/1/json"
        },
        {
            "name": "sysctl",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/sysctl/8/json"
        },
        {
            "name": "sysctl.conf",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/sysctl.conf/5/json"
        },
        {
            "name": "modprobe",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/modprobe/8/json"
        }
    ]
}