Sysctl

The sysctl statement allows to configure network-related sysctl settings which are not interface specific.

Schema description

# 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:

sysctl: &my-sysctl
  all:
    ipv6:
      forwarding: 1
# …
namespaces:
  guests:
    sysctl: *my-sysctl
    # …

Examples:


  1. Multiprotocol Label Switching