Sysctl
The sysctl statement allows configuring network-related sysctl settings which are not interface specific.
sysctl.all- configures all interface-specific settingssysctl.default- configures the interface-specific default settingssysctl.mpls- configures MPLS1 settingssysctl.mptcp- configures MPTCP2 settings
# https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt
sysctl:
all:
# /proc/sys/net/ipv4/conf/all/
ipv4:
forwarding: 1
default:
# /proc/sys/net/ipv4/conf/default/
ipv4:
forwarding: 1
# /proc/sys/net/mpls/
# https://www.kernel.org/doc/Documentation/networking/mpls-sysctl.txt
mpls:
# set greater 0 to enable mpls forwarding
platform_labels: 1024
The settings can be also configured inside of namespaces.
Tip
YAML has native support for anchors and aliases which can be used to apply the same sysctl settings to multiple namespaces:
Examples:
Free-Form Configuration
The sysctl setting allows configuring settings explicitly supported in IfState, only. The sysctl_conf setting allows specifying any sysctl settings in the sysctl.conf configuration format.
It is possible to use YaML multiline strings or read the settings from a file using the !include tag. All settings need to be children of the net namespace. It is also possible to add empty and comment lines for convenience reasons: