Linux Network Configuration: ip, nmcli, Netplan and Troubleshooting

On modern Linux, use the ip command (iproute2) to view and make temporary network changes, and your distribution's network manager for permanent configuration: NetworkManager with nmcli on RHEL, Fedora and many desktops; Netplan YAML files on Ubuntu Server, which hand off to systemd-networkd or NetworkManager. Configure an IP address, gateway and DNS, then verify with ip addr, ip route, resolvectl status and ping.

Jul 19, 2025 - 12:20
Updated: 
102k

Linux Administration in IT Infrastructure · Comparison

Linux Network Configuration: ip, nmcli, Netplan and Troubleshooting

Quick answer: On modern Linux, use the ip command (iproute2) to view and make temporary network changes, and your distribution's network manager for permanent configuration: NetworkManager with nmcli on RHEL, Fedora and many desktops; Netplan YAML files on Ubuntu Server, which hand off to systemd-networkd or NetworkManager. Configure an IP address, gateway and DNS, then verify with ip addr, ip route, resolvectl status and ping. Older commands such as ifconfig and route are deprecated.

Key takeaways

  • ip changes are lost at reboot unless saved in the network manager's configuration.
  • Use one network management tool per host to avoid conflicts.
  • Check addresses, routes and DNS in that order when troubleshooting.
  • Keep console access when changing networking on remote servers.
  • Document static addressing and VLANs in your inventory.

Table of Contents

Which Tool Does Your Distribution Use?

DistributionDefaultCommand or files
RHEL, Rocky, AlmaLinux, FedoraNetworkManagernmcli, nmtui
Ubuntu ServerNetplan with systemd-networkd/etc/netplan/*.yaml
Ubuntu DesktopNetplan with NetworkManagernmcli or GUI
Debian (classic)ifupdown/etc/network/interfaces

See Red Hat's networking guide and the Netplan documentation.

How Do You View the Current Configuration?

ip -br addr             # brief list of interfaces and addresses
ip route                # routing table, including default gateway
resolvectl status       # DNS servers (systemd-resolved)
nmcli device status     # NetworkManager view
hostnamectl             # hostname

The ip manual covers every subcommand.

How Do You Set a Static IP with nmcli?

sudo nmcli con mod "System eth0" ipv4.method manual \
  ipv4.addresses 192.168.10.20/24 ipv4.gateway 192.168.10.1 \
  ipv4.dns "192.168.10.1 1.1.1.1"
sudo nmcli con up "System eth0"
nmcli con show "System eth0" | grep ipv4

See the nmcli manual.

How Do You Set a Static IP with Netplan?

# /etc/netplan/01-static.yaml
network:
  version: 2
  ethernets:
    eth0:
      addresses: [192.168.10.20/24]
      routes:
        - to: default
          via: 192.168.10.1
      nameservers:
        addresses: [192.168.10.1, 1.1.1.1]

# test with automatic rollback, then apply
sudo netplan try
sudo netplan apply

netplan try reverts automatically if you lose connectivity and do not confirm.

How Do You Configure VLANs and Bonding?

# VLAN 30 on eth0 (NetworkManager)
sudo nmcli con add type vlan con-name vlan30 dev eth0 id 30 ipv4.method manual ipv4.addresses 10.30.0.5/24

# Bond two NICs for redundancy (active-backup)
sudo nmcli con add type bond con-name bond0 ifname bond0 bond.options "mode=active-backup"
sudo nmcli con add type ethernet slave-type bond con-name bond0-p1 ifname eth1 master bond0
sudo nmcli con add type ethernet slave-type bond con-name bond0-p2 ifname eth2 master bond0

# Temporary test only (lost on reboot)
sudo ip addr add 192.168.10.99/24 dev eth0

What Is a Good Troubleshooting Sequence?

  1. Link: ip link shows the interface UP; check cables or Wi-Fi.
  2. Address: ip addr shows a correct IP and prefix.
  3. Gateway: ip route has a default route; ping the gateway.
  4. Internet: ping 1.1.1.1.
  5. DNS: resolvectl query example.com or dig example.com.
  6. Firewall: check nftables or firewalld rules.
  7. Logs: journalctl -u NetworkManager or journalctl -u systemd-networkd.

Related: fixing DNS problems and Linux firewalls. WebAsha offers RHCSA training.

References

Frequently Asked Questions

Run ip -br addr for a brief list, or ip addr show for full details of every interface.

Use nmcli con mod with ipv4.method manual, addresses, gateway and DNS, then bring the connection up.

Edit a Netplan YAML file in /etc/netplan, run netplan try, then netplan apply.

ip changes are temporary; save configuration through NetworkManager, Netplan or networkd.

It is deprecated on most distributions; use ip from iproute2 instead.

Run resolvectl status on systems using systemd-resolved, or view /etc/resolv.conf.

It applies a configuration temporarily and rolls back if you do not confirm, preventing lockouts.

With nmcli con add type vlan, specifying the parent device and VLAN ID.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Vaishnavi

Vaishnavi is a skilled tech professional at the Ethical Hacking Training Institute in Pune, responsible for managing and optimizing the technical infrastructure that supports advanced cybersecurity education. With deep expertise in network security, backend operations, and system performance, she ensures that practical labs, online modules, and assessments run smoothly and securely. Her behind-the-scenes contributions play a vital role in delivering a seamless and secure learning experience for aspiring ethical hackers.