Pcornel
Browse topics
Options
Recent
Favorites
Containers · Technical reference

Container Network Interface (CNI)

Direct answer

CNI (Container Network Interface) plugins (Calico, Cilium, Flannel, cloud CNIs) give pods their network interfaces and IPs and implement routing and often NetworkPolicy.

When to use this

Use it when pods are stuck in ContainerCreating with network errors or pods on different nodes cannot talk.

First 30 seconds

1. Pod events: "failed to set up sandbox" / CNI errors?

2. CNI pods running on all nodes.

3. Pod-to-pod across nodes: kubectl exec ping/curl.

4. MTU and overlay ports (VXLAN 4789, Geneve) allowed between nodes.

5. CNI logs.

Operational verification

kubelet → CNI plugin → veth + IP + routes → cross-node via overlay/routing

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Docker / containerd / Podman / Kubernetes / OCI-compatible platforms
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformDocker / containerd / Podman / Kubernetes / OCI-compatible platforms
Scope / prerequisiteUse it when pods are stuck in ContainerCreating with network errors or pods on different nodes cannot talk.
What next?2 suggested next steps
Evidence0
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 How to verify Verify boundary

Ping a Pod IP on another node from a Pod. Check the CNI agent logs on both nodes. Confirm MTU inside the Pod matches the overlay requirement (for example 1450 for VXLAN on a 1500 network).

Step 2 Common failures Narrow the fault

A missing CNI config leaves nodes NotReady with "network plugin not ready". MTU mismatches make small requests work and large transfers hang. Host firewalls blocking the overlay port (for example UDP 4789 or 8472) break cross-node traffic only.

Key points

The CNI DaemonSet must run on every node. Pod CIDR must not overlap node or service networks. MTU must account for overlay encapsulation.

Key checks
  • docker ps -a — containers and exit codes
  • docker logs <c> — container output
  • docker inspect <c> — config, mounts, network, state
ReferenceWhat it is1 section · depth on demand

How it works

For each Pod sandbox the runtime creates a network namespace and the CNI plugin adds a veth or similar interface, allocates an IP (IPAM) and programs routes, tunnels or eBPF. Overlay plugins encapsulate traffic between nodes; routed plugins advertise Pod CIDRs, for example with BGP.

ReferenceImportant terms & boundaries3 sections · depth on demand

Common CNI plugins

PluginNotes
CalicoRouting (BGP) or overlay, strong NetworkPolicy support
CiliumeBPF datapath, NetworkPolicy, observability (Hubble), kube-proxy replacement
FlannelSimple overlay, no NetworkPolicy by itself
AWS VPC CNI / Azure CNIPods get VPC/VNet IPs

Config: /etc/cni/net.d/, binaries in /opt/cni/bin/. Pods stuck in ContainerCreating with network errors usually mean the CNI is not installed or crashing.

In depth

The Container Network Interface is a small contract: the runtime executes a plugin binary with a JSON network configuration and environment variables (CNI_COMMAND=ADD|DEL|CHECK, CNI_NETNS, CNI_IFNAME), and the plugin returns the interfaces and IPs it created.

Where the pieces live on a node

PathContent
/etc/cni/net.d/Network configuration; the first file in lexical order is used
/opt/cni/bin/Plugin binaries (bridge, host-local, portmap, vendor plugins)
CNI agent DaemonSetCalico, Cilium, Flannel … programs routes, tunnels or eBPF

Datapath models

ModelHow Pods on different nodes talkWatch out for
Overlay (VXLAN, Geneve)Encapsulated over the node network50-byte overhead → lower Pod MTU
Native routing (BGP, cloud routes)Pod CIDRs routed by the networkRoutes must exist in the underlay or cloud
eBPFPrograms attached to interfaces replace iptablesKernel version requirements

Worked check — cross-node Pod traffic fails

kubectl get pods -o wide                       # note Pod IPs and nodes
kubectl exec a -- ping -c2 <podB-ip>           # small packets
kubectl exec a -- ping -c2 -M do -s 1400 <podB-ip>   # large, no fragmentation
kubectl -n kube-system logs ds/<cni-agent> --tail=50

Small pings working while large ones fail is the classic MTU mismatch. No reply at all usually means the overlay port (UDP 4789 for VXLAN, 8472 for Flannel's VXLAN, TCP 179 for BGP) is blocked between nodes.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Common mistakes

  • Two CNIs configured on one cluster.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
container network interface (cni)kubernetes cni pluginpod network
Confirmation

Confirm action

Continue?