Cyber Services / All lessons / CentOS / Linux Administration / Network Management Cheat Sheet

Network Management Cheat Sheet

Module 22 of 33 · 2 min read · Free to read

MODULES ↓ Command blocks have a COPY button

Advanced Configuration & Troubleshooting with nmcli and ip

This cheat sheet provides essential commands and references for managing network interfaces on CentOS 8.5 using NetworkManager's nmcli and the ip utility.

TCP/IP Model Overview

Application Layer (HTTP, FTP, DNS)
Transport Layer (TCP, UDP)
Internet Layer (IP, ICMP)
Network Access Layer (Ethernet, MAC)

Network Inspection Commands

πŸ”

Interface Information

Show all network interfaces and IP addresses:

ip address show

Show only active interfaces:

ip address show up

Show link layer information:

ip link show
πŸ—ΊοΈ

Routing Information

Display the routing table:

ip route show

Show NetworkManager connections:

nmcli connection show

Show active connections only:

nmcli connection show --active
πŸ“Š

Device Status

Show device status:

nmcli device status

Show detailed connection info:

nmcli connection show enp0s3
Replace "enp0s3" with your interface name

Configuration Commands

βš™οΈ

Static IP Configuration

Set static IP address:

sudo nmcli connection modify enp0s3 ipv4.addresses 192.168.1.200/24

Set default gateway:

sudo nmcli connection modify enp0s3 ipv4.gateway 192.168.1.1

Set DNS servers:

sudo nmcli connection modify enp0s3 ipv4.dns "8.8.8.8,1.1.1.1"

Change to manual (static) method:

sudo nmcli connection modify enp0s3 ipv4.method manual
πŸ”„

Connection Management

Apply configuration changes:

sudo nmcli connection down enp0s3 && sudo nmcli connection up enp0s3
Warning: This will disconnect remote sessions. Use with caution!

Add a secondary IP address:

sudo nmcli connection modify enp0s3 +ipv4.addresses 192.168.1.201/24

Disable IPv6:

sudo nmcli connection modify enp0s3 ipv6.method ignore
βž•

Creating New Connections

Create a new connection:

sudo nmcli connection add type ethernet con-name "Internal Network" ifname enp0s8 ipv4.addresses 172.16.10.10/24 ipv4.method manual autoconnect yes

Activate the new connection:

sudo nmcli connection up "Internal Network"

Delete a connection:

sudo nmcli connection delete "Internal Network"

Troubleshooting Commands

πŸ“‘

Connectivity Testing

Test basic IP connectivity:

ping 8.8.8.8

Test DNS resolution:

ping google.com

Trace network path:

traceroute google.com

Alternative path tracing:

tracepath google.com
πŸ”Ž

DNS Diagnostics

Query DNS information:

dig google.com

Query specific DNS server:

dig @8.8.8.8 google.com

Check DNS configuration:

cat /etc/resolv.conf
πŸ“

Logs and Monitoring

Check NetworkManager logs:

journalctl -u NetworkManager.service

Check system messages:

tail -f /var/log/messages

Check firewall rules:

sudo firewall-cmd --list-all

Graphical Tools

πŸ’»

nmtui

Launch NetworkManager Text User Interface:

sudo nmtui
Useful for visual configuration when working directly on the server

Troubleshooting Flow

  1. Verify IP configuration: ip address show and ip route show
  2. Test local connectivity: ping <gateway>
  3. Test internet connectivity: ping 8.8.8.8
  4. Test DNS resolution: dig google.com
  5. Trace path if needed: traceroute google.com
  6. Check firewall: sudo firewall-cmd --list-all
  7. Review logs: journalctl -u NetworkManager.service
Modules (33) ← CentOS / Linux Administration