Interview Prep/Networking/Kubernetes, Containers, MTU & Performance Basics

What are Linux network namespaces and veth pairs?

IntermediateConceptKubernetes, Containers, MTU & Performance Basics
Answer

A network namespace is an isolated copy of the network stack (interfaces, routes, iptables, sockets). A veth pair is a virtual cable with two ends; one end in the container namespace, the other in the host or a bridge. Docker and Kubernetes use them for every container or pod.

ip netns add demo
ip link add v0 type veth peer name v1
ip link set v1 netns demo
ip netns exec demo ip addr add 10.9.0.2/24 dev v1
All Networking questions Roadmap: Networking for DevOps

More on Kubernetes, Containers, MTU & Performance Basics