Interfaces & Link Layer
What an interface is, how it connects to a network, and how to inspect it
01What is an interface?
An interface is the point where a device connects to a network. It can be physical (an Ethernet port, a Wi-Fi card) or virtual (loopback, bridge, veth). Every packet enters and leaves through an interface. Without an interface, a device cannot talk to any network.
Understanding interfaces is the foundation of all networking. When you run ip link or ifconfig, you are looking at interfaces. When Docker creates a container, it creates virtual interfaces. When your phone connects to Wi-Fi, it uses a wireless interface.
An interface is like a door to a building. A building can have many doors (interfaces), each leading to a different street (network). Some doors are real (physical NIC), some are internal (loopback), and some are shared (bridge).
What is a network interface?
An interface is where a device meets a network. Select a type to see how it works.
What an interface does: It sends and receives frames. On transmit, it takes bytes from the OS, builds a frame, and puts bits on the wire (or radio). On receive, it reads bits, builds a frame, and passes bytes up to the OS.
Physical vs virtual: A physical interface has hardware (NIC, antenna). A virtual interface exists only in software. Both look the same to the OS.
Every interface has: a name (eth0, wlan0, lo), a MAC address (except loopback), one or more IP addresses, an MTU (max frame size), and a state (UP or DOWN).
Check yours: run ip link show to see all interfaces on your machine.
02Physical interfaces
Ethernet (eth0) and Wi-Fi (wlan0) are physical interfaces. They have a MAC address burned into the hardware. Ethernet uses cables; Wi-Fi uses radio waves. Both do the same job: move frames between the device and the network.
Physical interfaces are where the digital meets the physical. The NIC (Network Interface Card) is the hardware that converts bits to signals.
- ▸Ethernet: RJ45 cable, up to 100 Gbps, full-duplex, no collisions on switched links
- ▸Wi-Fi: radio waves, up to ~9.6 Gbps (Wi-Fi 6), shared medium, needs an access point
- ▸Both have a MAC address (6 bytes, burned in at the factory)
- ▸Both can be up, down, or have multiple IP addresses
What is a network interface?
An interface is where a device meets a network. Select a type to see how it works.
What an interface does: It sends and receives frames. On transmit, it takes bytes from the OS, builds a frame, and puts bits on the wire (or radio). On receive, it reads bits, builds a frame, and passes bytes up to the OS.
Physical vs virtual: A physical interface has hardware (NIC, antenna). A virtual interface exists only in software. Both look the same to the OS.
Every interface has: a name (eth0, wlan0, lo), a MAC address (except loopback), one or more IP addresses, an MTU (max frame size), and a state (UP or DOWN).
Check yours: run ip link show to see all interfaces on your machine.
03Virtual interfaces
The OS creates virtual interfaces in software. Loopback (lo) is always present and never sends traffic outside the machine. Bridges (br0, docker0) act as software switches. veth pairs are virtual cables connecting namespaces. TUN/TAP interfaces connect to VPNs.
Virtual interfaces let one machine act like many. A container gets its own virtual interface and thinks it has its own network. A VM gets a virtual NIC. The OS manages all of them.
Virtual interfaces are like internal doors in a building. They connect rooms (namespaces) without going outside. A veth pair is a hallway between two rooms.
04Interface states and config
An interface can be UP (active) or DOWN (disabled). It has a MAC address, one or more IP addresses, an MTU (max packet size, usually 1500), and a speed. You can change its state, IP, and MTU with ip link and ip addr commands.
05WLAN vs LAN
LAN (Local Area Network) is the network inside your building. WLAN (Wireless LAN) is a LAN that uses Wi-Fi instead of cables. The interface type changes (Ethernet vs Wi-Fi), but the network concepts (IP, subnet, gateway) are the same. Wi-Fi adds radio-specific concerns: channels, signal strength, interference, and shared medium.
Understanding that WLAN is just a LAN with a wireless interface helps you see that the same IP, subnet, and gateway rules apply. The difference is at Layer 1 and 2.
- ▸LAN: wired, dedicated bandwidth per port, no interference
- ▸WLAN: wireless, shared bandwidth, interference from microwaves and walls
- ▸Both use the same IP addressing and routing
- ▸Wi-Fi needs an access point (AP) to connect to the LAN
06Inspecting interfaces
Use ip link show to see all interfaces and their state. Use ip addr to see IP addresses. Use ip route to see which interface is used for which destination. These three commands tell you everything about how your machine connects to networks.
ip link show ip addr show ip route show ip -s link show eth0