kubernetes kubernetes/networking
Core Idea
A network interface is how a computer reaches the outside world: physical or virtual, each carries IP addresses, and
ip linkis how you inspect them.
- What network interfaces are and how IP addresses attach to them.
- Types: physical interfaces versus virtual interfaces provided by the host or hypervisor.
- Understanding
ip linkfor reading interface state.
Computers use a network interface to communicate with the outside world.
Network interfaces can be physical (e.g., an Ethernet network controller) or virtual. Virtual network interfaces do not correspond to physical hardware; they are abstract interfaces provided by the host or hypervisor.
IP addresses are assigned to network interface.
Linux itself has a concept of a network interface, which can be physical (such as an Ethernet card and port) or virtual.
Types of Networks Interfaces
Physical Network Interfaces
Ethernet Interfaces (eth0, eth1, etc.)
- Wired network connections using an Ethernet cable.
- Typically have names like
eth0,eth1, orenpXsY(predictable network interface names).
Wi-Fi Interfaces (wlan0, wlpXsY)
- Wireless network connections.
- Named
wlan0,wlpXsY, etc.
Virtual Network Interfaces
loopback interface (lo)
The loopback interface is a special interface for same-host communication. 127.0.0.1 is the standard IP address for the loopback interface.
Packets sent to the loopback interface will not leave the host, and processes listening on 127.0.0.1 will be accessible only to other processes on the same host.
Container runtimes create a virtual network interface for each pod on a host, so the list would be much longer on a typical Kubernetes node.
Bridge Interface (br0, virbr0)
The bridge interface allows system administrators to create multiple layer 2 networks on a single host.
Docker Bridge (docker0)
Used for container networking in Docker.
👉 02.Areas/DevOps/0500 - Kubernetes/Linux-Docker-K8s- Networking/../../Kubernetes/Linux-Docker-K8s-Networking/Docker networking (Advanced)
Tunnel Interfaces (tun0, tap0)
Used for VPN connections.
Understanding ip link
-
Interface Name (
eth0,eth1,lo,docker0)
The identifier for the interface. -
Flags (
BROADCAST,MULTICAST,UP, etc.)BROADCAST→ Can send packets to all devices on the local network.MULTICAST→ Supports multicast traffic.UP→ The interface is active.LOWER_UP→ The physical link is detected (cable plugged in, Wi-Fi connected).
-
MTU (Maximum Transmission Unit)
The largest packet size the interface can handle (1500 is standard for Ethernet). -
State (
UP,DOWN,NO-CARRIER)UP→ The interface is active.DOWN→ The interface is disabled.NO-CARRIER→ No physical link detected (e.g., cable unplugged).
-
MAC Address (
link/ether XX:XX:XX:XX:XX:XX)
The hardware address of the network card.
Would you like to see more details about IP addresses on these interfaces? You can run:
ip addr show