How to Manage Network in Linux: A Complete Guide to Interfaces, IPs, and Troubleshooting
Every Linux administrator eventually runs into the same wall: a server won’t reach the internet, a new interface refuses to come up, or a bonded connection silently drops packets. Unlike Windows, where a graphical wizard hides most of the complexity, Linux hands you direct control over every layer of the network stack — which is powerful, but only if you know where to look.
This guide walks through the practical side of Linux network management: how interfaces are named, how to assign static and dynamic IP addresses, how to use tools like nmcli, ip, iwconfig, and ethtool, and how to build more advanced setups such as bridges and bonded NICs. We’ll close with a troubleshooting toolkit you can rely on when something breaks at 2 a.m.
Whether you’re preparing for a Linux certification, managing a homelab, or administering production servers, this is the reference you’ll want bookmarked.
Understanding Linux Network Interface Names
Before touching any configuration, it helps to know what you’re actually looking at. Linux interface names follow a few different conventions depending on the distribution and hardware detection method in use.
Traditional vs. Predictive Naming
Older systems used simple, sequential names:
- eth0, eth1 — wired Ethernet interfaces
- wlan0, wlan1 — wireless interfaces
Modern distributions (especially those using systemd) often switch to predictable network interface names, which encode the physical location of the device. For example:
- enp0s3 — an Ethernet device on PCI bus 0, slot 3
- wlp3s0 — a wireless device on PCI bus 3, slot 0
This naming scheme prevents interfaces from shuffling order after a reboot or hardware change — a problem that used to plague multi-NIC servers. You can inspect and rename interfaces using tools like mii-tools, or simply confirm current names with ip link.
Where Connections Are Saved
Each major distribution stores its persistent network configuration in a different location:
| Distribution | Configuration Path |
|---|---|
| Debian/Ubuntu | /etc/network/interfaces |
| SUSE | /etc/sysconfig/network/ifcfg-* |
| Red Hat/CentOS | /etc/sysconfig/network-scripts/ifcfg-* |
Knowing this matters more than it seems — troubleshooting a “connection not persisting after reboot” issue almost always traces back to editing the wrong file for your distro.
Configuring Static and Dynamic IP Addresses
Netplan on Ubuntu
Modern Ubuntu releases use Netplan, a YAML-based abstraction layer that sits on top of either NetworkManager or systemd-networkd. A typical configuration file lives at /etc/netplan/50-cloud-init.yaml and might look like this:
network:
renderer: NetworkManager
ethernets:
eth0:
dhcp4: yes
eth1:
dhcp4: no
addresses: [192.168.10.10/24]
gateway4: 192.168.10.1
version: 2
Here, eth0 pulls an address automatically via DHCP, while eth1 is pinned to a static address with an explicit gateway. After editing the file, apply it with sudo netplan apply — a step that’s easy to forget and a common reason “my changes didn’t work.”
Static Configuration on Kali Linux
Distributions still using the legacy /etc/network/interfaces format follow a slightly different syntax:
iface eth0 inet static
address 192.168.0.20
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.10
To switch an interface back to DHCP on the fly, without editing config files, you can run:
ifconfig eth0 up
dhclient eth0
Enabling DHCP Manually
Sometimes you just need an interface to grab an address immediately, without worrying about persistent configuration. A single command handles that:
sudo dhclient eth0
This is especially useful when testing a new NIC or recovering a misconfigured interface without a full reboot.
Managing Networks with NetworkManager
For most desktop distributions and many modern servers, NetworkManager has become the default way to handle connections — replacing manual file editing with a service that can be queried and controlled from the command line.
Install it with:
sudo apt install network-manager
nmcli: The Command-Line Powerhouse
nmcli is the primary tool for interacting with NetworkManager without a GUI. Running it alone gives you a snapshot of every interface:
nmcli
Sample output shows connection status, device type, hardware address, and routing information — for example, confirming that eth0 is connected via netplan-eth0 and has been assigned an address like 172.27.240.211/20 with a default route through 172.27.240.1.
To list all saved connection profiles:
nmcli connection show
This returns a table of connection names, UUIDs, types, and the device each is bound to — useful when you have multiple profiles competing for the same interface.
For real-time visibility into connectivity changes (interface up/down events, new networks appearing), use:
nmcli monitor
It behaves similarly to a live terminal monitor you’d see on Cisco networking gear, streaming events as they happen instead of requiring repeated polling.
nmtui: A Text-Based GUI
If typing full nmcli commands feels tedious, nmtui provides a menu-driven interface directly in the terminal — ideal for headless servers accessed over SSH where a full graphical environment isn’t available.
The ip Command: Your Daily Driver
The ip command has largely replaced older tools like ifconfig and is the modern standard for interface and routing management.
ip addr show— displays IP address information for every interfaceip link— shows the operational status of each interfaceip link set eth1 up— enables theeth1interfaceip link set eth1 down— disables theeth1interfaceip route show— displays the current routing table, including default gateways
Because ip covers both addressing and routing in one tool, it’s worth mastering before reaching for anything else — most day-to-day networking tasks can be handled with just these five commands.
Configuring Wireless Interfaces with iwconfig
Wireless adapters have their own configuration needs, and iwconfig remains a common way to manage them at the driver level.
sudo iwconfig wlan0 nick "HomeNIC"
sudo iwconfig wlan0 mode Managed
sudo iwconfig wlan0 freq 2.437G
sudo iwconfig wlan0 channel 6
sudo iwconfig wlan0 retry 10
Understanding Wireless Modes
The mode parameter defines how the adapter behaves on the network:
- Managed — the standard client mode, connecting to an access point
- Ad-Hoc — peer-to-peer connection directly between devices, no access point required
- Master — turns the device into an access point itself
- Monitor — passively captures all traffic on the channel, commonly used for wireless security auditing
Frequency and channel settings matter most in environments with multiple overlapping networks, where manually selecting a less congested channel can noticeably improve throughput.
Diagnosing Hardware with ethtool
While ip and nmcli manage logical configuration, ethtool talks directly to the network card’s driver and hardware.
sudo ethtool -S eth0— displays detailed NIC statistics (packet counts, errors, drops)sudo ethtool -i eth0— shows driver and firmware informationsudo ethtool -t eth0— runs a hardware self-test on the card
This tool is invaluable when you suspect a physical or driver-level fault rather than a configuration problem — for instance, when link speed negotiates incorrectly or a card reports rising error counters.
Building a Network Bridge with brctl
Bridging combines two or more physical interfaces so they behave as a single logical switch port — commonly used in virtualization setups where VMs need direct access to the physical network.
sudo apt-get install -y bridge-utils
sudo brctl addbr br0
sudo ip addr flush dev eth0
sudo ip addr flush dev eth1
sudo brctl addif br0 eth0
sudo brctl addif br0 eth1
sudo ip addr add 192.168.10.10/24 dev br0
sudo ip link set dev br0 up
sudo ip link set dev eth0 up
sudo ip link set dev eth1 up
Notice that IP addresses are flushed from the individual interfaces before joining the bridge — the bridge itself, br0, becomes the addressable device going forward. Verify everything worked with brctl show and ip addr show br0.
NIC Bonding for Redundancy and Performance
NIC bonding (also called NIC teaming) combines multiple physical adapters into one logical connection, improving fault tolerance, throughput, or both depending on the mode selected.
Common Bonding Modes
- mode=0 (balance-rr) — round-robin traffic distribution for load balancing and fault tolerance
- mode=1 (active-backup) — one active NIC with the rest on standby
- mode=2 (balance-xor) — transmission based on XOR of source and destination MAC addresses
- mode=3 (broadcast) — sends identical traffic across all slave interfaces
- mode=4 (802.3ad) — dynamic link aggregation (requires compatible switch configuration)
- mode=5 (balance-tlb) — adaptive transmit load balancing
- mode=6 (balance-alb) — adaptive load balancing in both directions
Setting Up a Bond with nmcli
sudo apt install -y network-manager
sudo nmcli connection add type bond ifname bond0 con-name bond0 mode 802.3ad
sudo nmcli connection add type ethernet ifname eth0 master bond0
sudo nmcli connection add type ethernet ifname eth1 master bond0
sudo nmcli connection modify bond0 ipv4.method manual ipv4.addresses 192.168.1.100/24 ipv4.gateway 192.168.1.1
sudo nmcli connection modify bond0 ipv4.dns "8.8.8.8 8.8.4.4"
sudo nmcli connection up bond0
Confirm the bond is active with nmcli device status, and inspect deeper details through /proc/net/bonding/bond0. Note that if NetworkManager isn’t actively managing bond0, it may show as “unmanaged” — a common point of confusion when mixing manual and NetworkManager-based configuration on the same system.
Essential Network Configuration Files
Two files quietly control much of how a Linux system resolves and reaches other devices.
/etc/hosts
A local, static lookup table mapping hostnames to IP addresses — checked before any DNS query is made:
127.0.0.1 localhost
127.0.1.1 pc
192.168.10.15 win10_user01
/etc/resolv.conf
Defines which DNS servers the system queries for name resolution:
nameserver 8.8.8.8
nameserver 8.8.4.4
On systemd-based distributions, this file is often managed automatically by systemd-resolved, so manual edits can be overwritten — worth checking /etc/systemd/resolved.conf if changes aren’t sticking.
Troubleshooting: A Practical Toolkit
When something breaks, working through issues layer by layer saves time. Here’s a structured approach, organized by the type of problem you’re chasing.
Routing Issues
Use route, netstat -r, or ip route to confirm traffic is being sent through the correct gateway.
Tracing Packet Hops
traceroute, tracepath, mtr, or nmap reveal where along the path a connection is failing or slowing down.
ARP Resolution Problems
The arp command shows the mapping between IP addresses and MAC addresses on the local network — useful for spotting duplicate IP conflicts.
Network Saturation
iftop and iperf measure bandwidth usage and maximum throughput, helping distinguish a genuinely saturated link from a misconfiguration.
Packet Loss and Timeouts
ping, tcpdump, wireshark, and netcat let you verify basic reachability and inspect raw traffic when something is silently dropping packets.
Name Resolution Failures
nslookup, dig, host, and whois isolate whether a problem is a DNS issue or something deeper in the connection itself.
Adapter-Level Problems
ethtool, nmcli, ip, and legacy ifconfig help confirm whether the hardware and driver layer are functioning correctly before assuming the problem is in software configuration.
A good rule of thumb: start with ping, move to traceroute/mtr if that fails, then check dig/nslookup if the destination resolves to the wrong address or doesn’t resolve at all.
Conclusion
Linux network management isn’t one tool — it’s a layered toolkit, and knowing which layer you’re troubleshooting is half the battle. Interface naming and configuration files determine what persists across reboots. nmcli, nmtui, and ip handle day-to-day connectivity. iwconfig and ethtool dig into wireless and hardware specifics. Bridging and bonding extend a system’s networking capabilities for virtualization and redundancy. And when things go wrong, a structured troubleshooting path — routing, hops, ARP, saturation, packet loss, DNS, and hardware — gets you to the root cause faster than guessing.
Bookmark this guide as your quick-reference sheet the next time a Linux box won’t talk to the network the way it should.
Frequently Asked Questions
What’s the difference between ifconfig and ip?
ifconfig is a legacy tool that’s deprecated on many modern distributions, while ip is its actively maintained replacement, handling both addressing and routing in a single, more powerful command.
Do I need NetworkManager if I already use Netplan?
On Ubuntu, Netplan is a configuration layer that can render its settings through either NetworkManager or systemd-networkd — you choose the renderer, but you don’t necessarily need both running actively.
Which bonding mode should I use for redundancy alone, without load balancing?
mode=1 (active-backup) is the simplest choice — one NIC stays active while the other waits as a standby, with no special switch configuration required.
Want more hands-on Linux guides like this?
Subscribe to the GEANTECHNOLOGY newsletter for weekly tutorials on networking, cybersecurity, and server administration — or take the next step and secure your infrastructure further.