If the sysctl
net.ipv4.ip_forward is set to 0 (disabled) on a Linux host, then IPv4 packet forwarding is disabled.
As a result, on a Kubernetes nodes this will prevent Pod networking from functioning.
You can confirm the current value of this sysctl on a Linux host, if you are experiencing a network issue, with the following:
The output should show 1, for enabled.
- A Kubernetes cluster with a CNI (Container Network Interface) plugin configure, e.g. an RKE (Rancher Kubernetes Engine) or Rancher launched cluster.
- The systctl net.ipv4.ip_forward set to 0 (disabled) on the cluster hosts.
Check if the kernel parameter
net.ipv4.ip_forward is set to 1 with:
If the current value of net.ipv4.ip_forward is 0, then set to this to 1 with the following:
To make it permanent across reboot, add the following line in
With this sysctl correctly enabled, Pod ingress and egress will be able to function as expected.