| |

LFCS 97 ๐Ÿง Network Interfaces โ€” ip link

โฑ๏ธ Estimated read: 10 min | |

The previous chapter covered ip addr, which manages Layer 3 protocol addresses. But an address is meaningless if the underlying link is administratively disabled. The ip link command operates one layer below: it manages the network device itselfโ€”bringing it up or down, changing its MTU, altering its MAC address, and creating virtual devices like bridges, bonds, and VLANs. On the LFCS exam, the distinction between ip link and ip addr is fundamental. A common mistake is adding an IP address to an interface and wondering why traffic does not flowโ€”the link is still DOWN.

Key point: ip link manages the network device’s operational state and Layer 2 characteristics. ip addr manages the IP addresses assigned to that device. An interface must be UP at the link layer before any address on it can carry traffic.


Why ip link exists

The administrative state problem. Every network interface has an administrative state controlled by the kernel. When an interface is DOWN, the kernel drops all packets regardless of what IP addresses are assigned. The ip link set dev up command transitions the device to the UP state, enabling the driver to transmit and receive frames. Without this step, ip addr add is a no-op from the perspective of network connectivity .

The virtual device problem. Modern Linux networking relies heavily on virtual interfaces: bridges for Layer 2 switching, bonds for link aggregation, VLANs for network segmentation, and dummy interfaces for testing. The ip link add command creates these devices. A bridge created with ip link add name br0 type bridge is a software switch; physical or virtual ports are attached to it with ip link set dev eth0 master br0 . This is the foundation of container networking, virtualization, and advanced routing setups.

The MTU and MAC problem. The Maximum Transmission Unit (MTU) determines the largest frame an interface can transmit. Jumbo frames (MTU 9000) are common in storage networks and high-performance clusters. The MAC address can be changed for privacy, testing, or to match a hardware requirement. Both are properties of the link, not the address, and both are managed by ip link .

The naming problem. Consistent device naming (e.g., enp0s3 instead of eth0) is a udev feature, but ip link is the tool that displays the resulting names and their mapping to MAC addresses. When a system has multiple interfaces, identifying which one is which is the first step in any network configuration task .

The trade-off. ip link changes are runtime-only, just like ip addr. A bridge created with ip link add disappears after reboot unless persisted through NetworkManager, Netplan, or systemd-networkd. The LFCS exam tests both the immediate command and the knowledge that persistence requires a separate configuration layer.


a. Displaying and interpreting link state

The ip link show command (or ip link with no subcommand) lists every network interface with its flags, MTU, state, and MAC address. The output is dense but structured.

# Show all links
ip link show

# Show a specific interface
ip link show dev enp0s3

# Brief format (one line per interface)
ip -br link show

The flags between angle brackets are critical. <UP> means the interface is administratively enabled. <LOWER_UP> means the physical carrier is present (cable connected, peer responding). <BROADCAST> and <MULTICAST> indicate supported transmission modes. <SLAVE> indicates the interface is a member of a bond or bridge . The state field at the end summarizes: UP means operational, DOWN means administratively disabled, and UNKNOWN is normal for loopback and some virtual devices .

The -br (brief) flag produces a compact table: interface name, state, and MAC address. This is the fastest way to survey the system before making changes.


b. Bringing interfaces up and down

The set subcommand changes the operational state of a link. This is the most basic and most frequently used ip link operation.

# Bring an interface up
sudo ip link set dev enp0s3 up

# Bring an interface down
sudo ip link set dev enp0s3 down

# Verify the state
ip link show dev enp0s3

Bringing an interface down is not the same as deleting it. The device still exists, its configuration is preserved, and it can be brought back up without reconfiguring addresses. This is useful for maintenance or temporarily disabling a network path. However, bringing down the primary interface on a remote system will terminate the SSH sessionโ€”a mistake that is difficult to recover from without console access.


c. Creating virtual links: bridges, bonds, and VLANs

The add subcommand creates virtual network devices. The type argument determines what kind of device is created. This is where ip link becomes essential for advanced networking.

# Create a bridge
sudo ip link add name br0 type bridge

# Create a bond in active-backup mode
sudo modprobe bonding
sudo ip link add name bond0 type bond mode active-backup

# Create a VLAN interface on top of enp0s3
sudo ip link add link enp0s3 name enp0s3.20 type vlan id 20

# Create a dummy interface
sudo ip link add name dummy0 type dummy

After creating a virtual device, it must be brought up with ip link set dev up and assigned an address with ip addr add. For bridges and bonds, member interfaces are attached with the master keyword: ip link set dev enp0s8 master br0. The member interfaces do not need IP addresses; the address belongs on the bridge or bond device itself .

VLAN interfaces are a special case: the VLAN device (enp0s3.20) carries the tag, and the physical interface (enp0s3) carries the traffic. The VLAN device is created as a child of the physical link with link enp0s3 .


Complete Example Session

# ============================================
# PART 1: LIST ALL LINKS
# ============================================

ip link show
# Output shows lo, enp0s3, enp0s8.
# enp0s8 has <BROADCAST,MULTICAST> but no <UP>.
# ============================================
# PART 2: CHECK A SPECIFIC INTERFACE
# ============================================

ip link show dev enp0s8
# Output: state DOWN, no <UP> flag.
# ============================================
# PART 3: BRING THE INTERFACE UP
# ============================================

sudo ip link set dev enp0s8 up
# No output on success.
# ============================================
# PART 4: VERIFY THE CHANGE
# ============================================

ip link show dev enp0s8
# Output: <BROADCAST,MULTICAST,UP,LOWER_UP> state UP
# ============================================
# PART 5: ADD AN ADDRESS (FROM CHAPTER 96)
# ============================================

sudo ip addr add 192.168.1.50/24 dev enp0s8
# Now the interface is UP and has an address.
# ============================================
# PART 6: CREATE A BRIDGE
# ============================================

sudo ip link add name br0 type bridge
sudo ip link set dev br0 up
sudo ip link set dev enp0s8 master br0
# enp0s8 becomes a port on br0.
# The address should move to br0.
# ============================================
# PART 7: CREATE A VLAN
# ============================================

sudo ip link add link enp0s3 name enp0s3.20 type vlan id 20
sudo ip link set dev enp0s3.20 up
sudo ip addr add 10.0.20.1/24 dev enp0s3.20
# ============================================
# PART 8: CHANGE MTU
# ============================================

sudo ip link set dev enp0s8 mtu 9000
ip link show dev enp0s8 | grep mtu
# mtu 9000
# ============================================
# PART 9: BRING THE INTERFACE DOWN
# ============================================

sudo ip link set dev enp0s8 down
ip link show dev enp0s8
# state DOWN, address still assigned but traffic drops.

The nine parts trace the ip link lifecycle: listing, inspecting, bringing up, verifying, adding an address, creating a bridge, creating a VLAN, changing MTU, and bringing down. The critical insight is that link state and address state are independentโ€”an address on a DOWN interface is unreachable.


Quick Reference

ip link Commands

CommandPurpose
ip link showList all links
ip link show dev eth0Show one interface
ip -br link showBrief one-line format
ip link set dev eth0 upEnable interface
ip link set dev eth0 downDisable interface
ip link set dev eth0 mtu 9000Change MTU
ip link set dev eth0 address 00:11:22:33:44:55Change MAC

Virtual Link Creation

CommandPurpose
ip link add name br0 type bridgeCreate bridge
ip link add name bond0 type bond mode active-backupCreate bond
ip link add link eth0 name eth0.20 type vlan id 20Create VLAN
ip link add name dummy0 type dummyCreate dummy
ip link set dev eth0 master br0Attach port to bridge

Flags and States

Flag / StateMeaning
<UP>Administratively enabled
<LOWER_UP>Carrier present
state UPOperational
state DOWNAdministratively disabled
state UNKNOWNNormal for loopback/dummy

Best Practices

โœ… Do This:

ip link show dev enp0s8
<!-- Verify state before making changes -->           # โœ…
ip link set dev enp0s8 up
<!-- Bring link up before adding addresses -->        # โœ…
ip link set dev enp0s8 master br0
<!-- Attach member to bridge without IP -->           # โœ…

โŒ Don’t Do This:

ip link set dev eth0 down
<!-- On a remote system: SSH session terminates -->   # โŒ
ip link add name br0 type bridge
# Then forget ip link set br0 up
<!-- Bridge exists but is DOWN -->                   # โŒ
# Assume ip link changes persist across reboot
<!-- Runtime-only; configure via nmcli/Netplan -->    # โŒ

Common Pitfalls

PitfallWhy It HappensFix
Address assigned but no trafficLink is DOWNip link set dev up
Bridge created but not forwardingBridge DOWN or no ports attachedip link set br0 up, attach ports
VLAN not workingPhysical parent DOWNBring parent and VLAN device up
SSH disconnectBrought down primary interfaceUse console or avoid down on primary
MTU mismatchPeer uses different MTUVerify both ends; use jumbo frames consistently

Real-World Examples

1. Show All Links

ip link show

2. Brief Format

ip -br link show

3. Bring Up

sudo ip link set dev enp0s8 up

4. Bring Down

sudo ip link set dev enp0s8 down

5. Change MTU

sudo ip link set dev enp0s8 mtu 9000

6. Create Bridge

sudo ip link add name br0 type bridge

7. Attach Port

sudo ip link set dev enp0s8 master br0

8. Create VLAN

sudo ip link add link enp0s3 name enp0s3.20 type vlan id 20

9. Create Bond

sudo ip link add name bond0 type bond mode active-backup

10. Create Dummy

sudo ip link add name dummy0 type dummy

Visual

ip link vs ip addr

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ip link set dev enp0s8 up                   โ”‚
โ”‚  (Layer 2: enables the device)               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                   โ”‚
                   โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ip addr add 192.168.1.50/24 dev enp0s8      โ”‚
โ”‚  (Layer 3: assigns address)                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                   โ”‚
                   โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Interface is UP with an address             โ”‚
โ”‚  Traffic flows                               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The link must be up before the address is meaningful.

Bridge Topology

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  br0 (bridge, IP address assigned here)      โ”‚
โ”‚                                              โ”‚
โ”‚  โ”œโ”€โ”€ enp0s8 (port, no IP)                    โ”‚
โ”‚  โ””โ”€โ”€ enp0s9 (port, no IP)                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                   โ”‚
                   โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Member ports forward at Layer 2             โ”‚
โ”‚  The bridge holds the Layer 3 configuration  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Bridges and bonds hold the IP address; member ports do not.


Summary

ItemValue
List linksip link show
Brief formatip -br link show
Enable interfaceip link set dev up
Disable interfaceip link set dev down
Change MTUip link set dev mtu
Create bridgeip link add name br0 type bridge
Attach portip link set dev master
Create VLANip link add link dev name dev.id type vlan id
PersistenceRequires nmcli, Netplan, or systemd-networkd

Key takeaways:

  • ip link manages the device, ip addr manages the address. An interface must be UP at the link layer before any address on it can carry traffic.
  • Virtual devices are created with ip link add. Bridges, bonds, VLANs, and dummy interfaces are all link-layer constructs.
  • Member ports do not hold IP addresses. In a bridge or bond, the IP address is assigned to the logical device, not to the physical ports .
  • All changes are runtime-only. Persistence requires a network manager. The LFCS exam tests the runtime command and the knowledge that persistence is separate.
  • Bringing down the primary interface kills connectivity. On a remote system, this terminates SSH and requires console access to recover.

Remember: ip link is the tool that makes the interface exist and operate. ip addr gives it an identity. Without the link, the address is just a number. The exam expects you to know both layers and the order in which they must be configured: link up first, then address, then route.

Was this helpful?


Stop using slow, ad-bloated tool sites! ๐Ÿคฎ

๐Ÿ”Ž Search “KandZ Tools” on Google to use many professional utilities for free.

KandZ.me is the ultimate minimalist hub for:
โœ… Finance (Mortgage, Interest, Inflation)
โœ… Tech (Base64, JSON, Dev Suite, IP)
โœ… Health (BMI, BMR, TDEE)
โœ… Productivity (Timer, Workspace, QR)

โšก๏ธ Fast & Private
๐Ÿ”’ No data leaves your device
๐Ÿ’Ž 100% Free

๐Ÿ”— Use it now: https://tools.kandz.me
๐Ÿ”– Bookmark itโ€”youโ€™ll need it later!