| title | Linux Networking - Complete Guide | ||||
|---|---|---|---|---|---|
| description | Complete guide to Linux Networking - Complete Guide | ||||
| category | Networking | ||||
| tags |
|
||||
| difficulty | beginner | ||||
| last_updated | 2026-06-06 | ||||
| related_commands |
Master the complete Linux networking stack from fundamentals to advanced enterprise configurations. Learn TCP/IP, interface management, routing, VLANs, bonding, and troubleshooting for production environments.
- Beginners: Network fundamentals and basic configuration
- System Administrators: Network setup and maintenance
- Network Engineers: Advanced routing, VLANs, troubleshooting
- DevOps Engineers: Network automation and container networking
- Enterprise Architects: Design scalable network infrastructures
Basic Level:
- Linux command-line proficiency
- Understanding of IP addresses (basic concepts)
Advanced Topics:
- System administration experience
- Understanding of OSI model
- Familiarity with network protocols
- Network Fundamentals: TCP/IP, OSI model, subnetting, DNS, DHCP
- Interface Management: Configure network interfaces with ip, nmcli, NetworkManager
- Routing: Static routes, default gateway, policy routing
- VLANs: 802.1Q VLAN configuration and management
- Bonding/Teaming: NIC aggregation for redundancy and performance
- Troubleshooting: Debug network issues with modern tools
Topics:
- OSI Model (7 layers) and TCP/IP Model (4 layers)
- IP Addressing (IPv4/IPv6, CIDR, subnetting)
- MAC Addresses and ARP
- DNS and /etc/hosts, /etc/resolv.conf
- DHCP client and server configuration
- Network interface naming (predictable names)
Quick Start:
# View IP addresses
ip addr show
# View routing table
ip route show
# Test connectivity
ping -c 4 8.8.8.8
# DNS lookup
dig google.comTopics:
- ip command (modern replacement for ifconfig)
- NetworkManager and nmcli
- Static IP configuration (RHEL/Debian)
- Interface states (UP, DOWN, LOWER_UP)
- Temporary vs persistent configuration
Quick Start:
# List interfaces
nmcli device status
# Configure static IP
nmcli con mod ens33 ipv4.addresses 192.168.1.100/24
nmcli con mod ens33 ipv4.gateway 192.168.1.1
nmcli con mod ens33 ipv4.dns 8.8.8.8
nmcli con mod ens33 ipv4.method manual
nmcli con up ens33Topics:
- Routing table management
- Default gateway configuration
- Static routes
- Policy-based routing
- Multiple routing tables
Quick Start:
# View routes
ip route show
# Add static route
ip route add 10.0.0.0/24 via 192.168.1.1
# Add default gateway
ip route add default via 192.168.1.1
# Persistent routes (RHEL)
echo "10.0.0.0/24 via 192.168.1.1" >> /etc/sysconfig/network-scripts/route-ens33Topics:
- 802.1Q VLAN tagging
- VLAN interface creation
- VLAN trunking
- Inter-VLAN routing
- VLAN configuration persistence
Quick Start:
# Load 8021q module
modprobe 8021q
# Create VLAN interface (VLAN 10)
ip link add link ens33 name ens33.10 type vlan id 10
# Assign IP to VLAN interface
ip addr add 192.168.10.1/24 dev ens33.10
# Bring up VLAN interface
ip link set dev ens33.10 upTopics:
- NIC bonding (7 modes: 0-6)
- Mode 0 (balance-rr): Round-robin for load balancing
- Mode 1 (active-backup): Failover for high availability
- Mode 4 (802.3ad/LACP): Dynamic link aggregation
- Mode 5 (balance-tlb): Adaptive transmit load balancing
- Mode 6 (balance-alb): Adaptive load balancing
- Configuration with NetworkManager
- Teaming (modern alternative to bonding)
Quick Start:
# Create bond interface (mode 1 - active-backup)
nmcli con add type bond con-name bond0 ifname bond0 mode active-backup
nmcli con add type ethernet con-name bond0-port1 ifname ens33 master bond0
nmcli con add type ethernet con-name bond0-port2 ifname ens34 master bond0
nmcli con up bond0Topics:
- Connectivity testing (ping, traceroute, mtr)
- Socket statistics (ss, netstat)
- Packet capture (tcpdump, wireshark)
- DNS troubleshooting (dig, host, nslookup)
- ARP cache management
- Network performance testing (iperf)
Quick Start:
# Check listening ports
ss -tuln
# Trace route
traceroute google.com
# Capture packets
tcpdump -i ens33 -n
# Test bandwidth
iperf3 -s # Server
iperf3 -c server_ip # Client- @_OVERVIEW.md)
- @_OVERVIEW.md)
- @_OVERVIEW.md)
- VLANs
- Bonding & Teaming
- @_OVERVIEW.md)
- Network Commands:
01_Commands/Network_Commands/ - Firewall:
04_Security/Firewall/ - Performance:
05_Performance/Network_Performance/ - System Administration:
07_System_Administration/
- Previous: @_OVERVIEW.md)
- Next: @_OVERVIEW.md)
- Home: @_START_HERE.md)
RHEL/Rocky (NetworkManager):
nmcli con mod ens33 ipv4.addresses 192.168.1.100/24
nmcli con mod ens33 ipv4.gateway 192.168.1.1
nmcli con mod ens33 ipv4.dns "8.8.8.8 8.8.4.4"
nmcli con mod ens33 ipv4.method manual
nmcli con up ens33Ubuntu (Netplan):
# /etc/netplan/01-netcfg.yaml
network:
version: 2
ethernets:
ens33:
addresses: [192.168.1.100/24]
gateway4: 192.168.1.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]# Create bond (active-backup)
nmcli con add type bond con-name bond0 ifname bond0 mode active-backup
nmcli con mod bond0 ipv4.addresses 192.168.1.100/24
nmcli con mod bond0 ipv4.gateway 192.168.1.1
nmcli con mod bond0 ipv4.method manual
# Add slave interfaces
nmcli con add type ethernet con-name bond0-port1 ifname ens33 master bond0
nmcli con add type ethernet con-name bond0-port2 ifname ens34 master bond0
# Activate
nmcli con up bond0# Load VLAN module
modprobe 8021q
echo "8021q" >> /etc/modules-load.d/vlan.conf
# Create VLAN 10 interface
nmcli con add type vlan con-name vlan10 ifname ens33.10 dev ens33 id 10
nmcli con mod vlan10 ipv4.addresses 192.168.10.1/24
nmcli con mod vlan10 ipv4.method manual
nmcli con up vlan10- Use predictable network interface names (ens33, enp0s3) - standard since systemd
- Use NetworkManager (nmcli) for RHEL/Rocky/Fedora systems
- Use Netplan for Ubuntu server configurations
- Test configuration before rebooting - always maintain console/IPMI access
- Document network changes in version control or change management system
- Use bonding/teaming for critical servers (mode 1 or 4)
- Implement VLAN segmentation for security and traffic isolation
- Monitor with modern tools (ss, ip, nmcli, ethtool)
- Use nftables/firewalld instead of raw iptables
- Don't use deprecated net-tools (ifconfig, route, netstat, arp) - removed from modern distributions
- Don't use network-scripts - removed in RHEL 9, Ubuntu doesn't use them
- Don't configure without backup access - always have console/IPMI/serial available
- Don't forget persistence - temporary changes via
ipcommand are lost on reboot - Don't use VLAN 1 (default untagged VLAN) - security best practice
- Don't bond interfaces across switches without LACP (802.3ad) support
- Don't skip firewall configuration - firewalld enabled by default, configure it
- Don't disable IPv6 unless absolutely required - it's the future
ip addr show # Show IP addresses
ip link show # Show interfaces
ip route show # Show routes
ip -s link # Show interface statistics
ip addr add 192.168.1.100/24 dev ens33 # Add IP
ip link set dev ens33 up # Bring interface up
ip route add 10.0.0.0/24 via 192.168.1.1 # Add routenmcli device status # Show devices
nmcli connection show # Show connections
nmcli con show ens33 # Show connection details
nmcli con up ens33 # Activate connection
nmcli con down ens33 # Deactivate connection
nmcli con reload # Reload configurationping -c 4 8.8.8.8 # Test connectivity
traceroute google.com # Trace route
ss -tuln # Show listening ports
tcpdump -i ens33 # Capture packets
dig google.com # DNS lookup
arp -a # View ARP cacheLast Updated: 2026-06-06 Coverage: Fundamentals, Interface Config, Routing, VLANs, Bonding, Troubleshooting Level: Beginner to Advanced Target Distributions: RHEL 8/9/10, Ubuntu 22.04/24.04, SUSE SLES 15/Leap 15+
This documentation focuses on modern networking tools and configurations (2024-2026).
RHEL 8/9/10 & Compatible Distributions:
- NetworkManager - Primary network configuration daemon (network-scripts removed in RHEL 9)
- nmcli - Command-line NetworkManager interface
- firewalld - Dynamic firewall using nftables backend (RHEL 9+)
- nftables - Modern packet filtering framework (replaces iptables)
- systemd-networkd - Alternative lightweight network manager
- Predictable network names - ens33, enp0s3 (not eth0)
Ubuntu 22.04/24.04:
- Netplan - YAML-based network configuration (uses NetworkManager or systemd-networkd backend)
- NetworkManager - Available for desktop/laptop configurations
- systemd-networkd - Default for server installations
- ufw - Simplified firewall (frontend for nftables)
- nftables - Standard packet filtering
SUSE SLES 15/Leap 15+:
- wicked - Default network configuration (SUSE-specific)
- NetworkManager - Alternative for desktops
- firewalld - Default firewall
- YaST - System configuration tool includes network management
| Deprecated Tool | Modern Replacement | Status | Notes |
|---|---|---|---|
| ifconfig | ip addr, ip link | ❌ Removed | Not in default install (RHEL 8+, Ubuntu 22.04+) |
| route | ip route | ❌ Removed | Part of deprecated net-tools |
| netstat | ss | ❌ Removed | Slower, less detailed than ss |
| arp | ip neigh | ❌ Removed | Part of deprecated net-tools |
| network-scripts | NetworkManager, Netplan | ❌ Removed | Removed in RHEL 9, Ubuntu uses Netplan |
| iptables (direct) | firewalld, nftables | Works but discouraged; use firewalld/nftables | |
| ifup/ifdown | nmcli con up/down | NetworkManager commands preferred |
RHEL 9 / Rocky Linux 9:
- firewalld uses nftables backend by default
- network-scripts completely removed
- nmcli enhanced with better WiFi and VPN support
- WireGuard VPN in kernel
- IPv6 enabled by default
Ubuntu 22.04/24.04:
- Netplan 0.105+ with improved documentation
- systemd-networkd default for servers
- nftables default firewall backend
- WireGuard VPN integrated
- IPv6 preferred over IPv4
SUSE SLES 15 SP5+:
- wicked 0.6+ with improved bonding
- firewalld 1.x with zones
- Enhanced YaST network configuration