Fix Kubernetes IP Forwarding Preflight Error on Ubuntu

What the error means

The preflight check will throw an error such as:

[ERROR SystemVerification]: net.ipv4.ip_forward=0

This means the kernel is not forwarding IPv4 packets. Kubernetes networking plugins require it to be enabled.

Quick fix (temporary)

Enable it instantly until next reboot:

sudo sysctl -w net.ipv4.ip_forward=1

Permanent fix

To keep it after reboots, edit sysctl config:

sudo nano /etc/sysctl.conf
net.ipv4.ip_forward=1
sudo sysctl -p

Verify

cat /proc/sys/net/ipv4/ip_forward

It should print 1. If not, re-check your config.

Retry join

Run your kubeadm join command again. With forwarding enabled, networking will succeed.

If flannel keeps crashing

Sometimes CNI pods stay in CrashLoopBackOff. Reset kubeadm and reapply the network manifest:

sudo kubeadm reset -f
sudo kubeadm init --pod-network-cidr=10.244.0.0/16
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

Conclusion

IP forwarding is a single switch, but without it Kubernetes cannot function. Always enable it permanently before deploying workloads.