Skip to main content
RunBook Academy

LinuxXX · Linux Network ConfigurationInterface config

Linux interface configuration - addresses, MTU, offloads

Foundation⏱ ~12 minipethtool

What you'll learn

  • Assign a static IPv4 and IPv6 address to an interface
  • Change MTU and verify it took effect
  • Recognise common offload settings and their trade-offs
  • Tune ring buffers and other low-level parameters

Prerequisites

Verified against Ubuntu 24.04 LTS · Debian 12 (Bookworm) · RHEL 9.x · Rocky Linux 9.x · AlmaLinux 9.x · Linux kernel 6.1 LTS / 6.6 LTS · systemd 255+ · OpenSSH 8.7p1 (RHEL 9) / 9.6p1 (Ubuntu 24.04) · nftables 1.0.x · chrony 4.x · Pacemaker 2.1.x · Corosync 3.1.x · 2026-08-09

Not yet marked complete on this device.

Interface configuration on Linux happens at three levels:

  1. Logical: address, route, MTU.
  2. Driver: ring buffers, queue count, interrupt coalescing.
  3. Hardware / firmware: offloads, RSS, firmware settings.

The right tool depends on the level. ip works at level 1; ethtool works at levels 2 and 3.

Configure a static address

ip addr add 10.0.0.10/24 dev eth0
ip addr add 2001:db8:85a3:1::10/64 dev eth0
ip link set eth0 up

For a working host, you also need a route:

ip route add default via 10.0.0.1

And, for IPv6, a default route via the link-local router:

ip -6 route add default via fe80::1 dev eth0

These are all transient. They are useful for debugging but disappear at reboot. Persistent configuration is covered in the Netplan, NetworkManager, and systemd-networkd lessons.

MTU

MTU (Maximum Transmission Unit) is the largest IP packet an interface will send without fragmenting. The default on Ethernet is 1500 bytes. Jumbo frames use 9000; some tunnels require 1400-1450.

ip link show eth0                # current MTU
ip link set eth0 mtu 1400        # change it
ip link set eth0 mtu 9000        # jumbo frames

A wrong MTU causes silent packet loss. Symptoms:

  • Small flows work; large transfers fail.
  • TCP connections stall after handshake.
  • ping -M do -s 1472 fails; ping -M do -s 1400 works.

Offloads

Network cards can do work in hardware to relieve the CPU:

OffloadWhat it doesTrade-off
TSO (TCP Segmentation Offload)NIC splits large TCP segmentsSaves CPU; can confuse some packet captures
GRO (Generic Receive Offload)Coalesces incoming packetsReduces CPU; can hurt latency measurements
LRO (Large Receive Offload)Older, similar to GRODeprecated in favour of GRO
RSS (Receive Side Scaling)Hashes flows to queuesNeeded for multi-queue performance
checksum offloadNIC computes IP/TCP/UDP checksumSaves CPU; needed for high throughput
scatter-gatherDMA from multiple buffersSaves CPU
ethtool -k eth0                  # show all offloads
ethtool -K eth0 tso off          # disable TSO
ethtool -K eth0 gro off          # disable GRO

Common reason to disable offloads: packet captures look wrong, or an application measures sub-microsecond latency and the coalescing adds jitter.

Ring buffers

The NIC ring buffer holds packets between the NIC and the kernel:

ethtool -g eth0                  # show current and max
ethtool -G eth0 rx 4096          # set the rx ring to 4096

A small ring buffer drops packets under load (visible in ifconfig errors or ip -s link). Increase the ring if you see drops and CPU has headroom.

Tuning low-level driver parameters

ethtool -c eth0                  # show coalesce settings
ethtool -C eth0 adaptive-rx on   # adaptive rx coalescing
ethtool --set-priv-flags eth0 <flag> on   # driver-specific

Driver-specific settings vary. Always read the driver’s documentation before changing private flags.

Verify configuration took effect

ip -br addr show eth0
ip -br link show eth0
ip route show dev eth0
ethtool eth0
ethtool -k eth0 | grep -E 'tcp-segmentation|generic-receive'

If ip shows the change but the application still misbehaves, restart the application or the network service. Some applications cache the MTU at startup.

Knowledge check

Knowledge check · 3 questions

  1. Q1. How do you set the MTU on eth0 to 1400?

  2. Q2. TCP Segmentation Offload (TSO) saves CPU by having the NIC segment large TCP segments.

  3. Q3. Which of the following are reasons to disable a network offload? Select all that apply.

Passing score: 75%. Answers are checked in this browser.