OSI Model Quick Reference
Understanding layers helps troubleshoot network issues[cite: 21]:
Layer Name Example Linux Tools
7 Application HTTP, SSH, DNS curl, ssh, dig[cite: 21]
6 Presentation SSL/TLS, JPEG openssl[cite: 21]
5 Session NetBIOS, RPC netstat[cite: 21]
4 Transport TCP, UDP ss, netstat[cite: 21]
3 Network IP, ICMP ping, traceroute, ip route[cite: 21]
2 Data Link Ethernet, MAC ip link, arp[cite: 21]
1 Physical Cables, Hubs ethtool, mii-tool[cite: 21]
TCP vs UDP Comparison
Feature TCP UDP
Connection Connection-oriented Connectionless[cite: 21]
Reliability Guaranteed delivery, ordering Best effort, no guarantee[cite: 21]
Speed Slower (overhead) Faster (no handshake)[cite: 21]
Use Cases HTTP, SSH, SMTP, FTP DNS, DHCP, Streaming, VoIP[cite: 21]
Header Size 20-60 bytes 8 bytes[cite: 21]
Common Ports Reference
Port Service Protocol Description
22 SSH TCP Secure Shell[cite: 21]
53 DNS TCP/UDP Domain Name System[cite: 21]
80 HTTP TCP Web traffic[cite: 21]
443 HTTPS TCP Secure web traffic[cite: 21]
25 SMTP TCP Email sending[cite: 21]
110 POP3 TCP Email retrieval[cite: 21]
143 IMAP TCP Email access[cite: 21]
3306 MySQL TCP Database[cite: 21]
5432 PostgreSQL TCP Database[cite: 21]
6379 Redis TCP In-memory store[cite: 21]
🎯 Learning Objectives
Understand Linux networking architecture[cite: 21].
Identify network interfaces[cite: 21].
Learn IPv4, IPv6 and CIDR notation[cite: 21].
View network configuration and routing[cite: 21].
Understand basic DNS configuration[cite: 21].
📋 Prerequisites
Complete Chapters 1–7 before starting this chapter[cite: 21].
1. Linux Networking Architecture
Application ──► TCP / UDP ──► IP Layer ──► Network Interface ──► Physical Network[cite: 21]
Linux networking is layered, allowing applications to communicate reliably across local and remote networks[cite: 21].
🏢 Enterprise Insight
Production servers commonly have multiple network interfaces for application traffic, management, backup and storage networks[cite: 21].
2. Network Interfaces
ip link
ip addr
ip -br addr
hostname -I
Interface Purpose
lo Loopback interface[cite: 21].
eth0 / ens* Ethernet interface[cite: 21].
VLAN Logical network segmentation[cite: 21].
Bridge Virtual switching[cite: 21].
Virtual NIC Used by virtual machines[cite: 21].
3. IP Addressing
Concept Example
IPv4 192.168.1.10/24[cite: 21]
Private Range 10.0.0.5/16[cite: 21]
Private Range 172.16.20.50/24[cite: 21]
IPv6 2001:db8::10/64[cite: 21]
CIDR notation combines the IP address with the network prefix length, replacing traditional subnet mask notation[cite: 21].
5. DNS Basics
File Purpose
/etc/resolv.conf DNS server configuration[cite: 21].
/etc/hosts Local hostname resolution[cite: 21].
6. Linux vs IBM AIX
Linux IBM AIX
ip addr ifconfig -a[cite: 21]
ip route netstat -rn[cite: 21]
ss -tuln netstat -an[cite: 21]
7. Hands-on Practice
List all interfaces using ip link[cite: 21].
Display IP addresses with ip addr[cite: 21].
Show routing information[cite: 21].
View listening ports[cite: 21].
Inspect /etc/resolv.conf and /etc/hosts[cite: 21].
8. Common Mistakes
Confusing IP addresses with hostnames[cite: 21].
Ignoring the default gateway[cite: 21].
Editing DNS files without backups[cite: 21].
Overlooking IPv6 configuration[cite: 21].
9. Part 1 Summary
📌 Key Takeaways
Linux networking starts with interfaces, IP addressing and routing[cite: 21].
Use ip commands to inspect network configuration[cite: 21].
DNS relies on /etc/resolv.conf and /etc/hosts[cite: 21].
ss helps identify listening services[cite: 21].
10. Connectivity Testing (ping, traceroute)
ping -c 4 google.com
traceroute google.com
tracepath google.com
ping verifies basic IP connectivity[cite: 21]. traceroute and tracepath display the route packets take to a host[cite: 21].
11. Routing & Default Gateways
Route Type Purpose
Default Gateway Route used for external networks[cite: 21].
Static Route Manually configured network path[cite: 21].
Connected Route Automatically created for local networks[cite: 21].
💡 Tip
If the default gateway is missing or incorrect, external network communication usually fails[cite: 21].
12. Network Configuration (nmcli, curl)
nmcli acts as the terminal manager for NetworkManager setups[cite: 21]. Transfer network metrics or download assets using web tools[cite: 21]:
curl https://example.com
wget https://example.com/file.zip
13. OpenSSH Remote Administration (ssh, scp)
SSH encrypts remote machine communication channels securely[cite: 21]. HARDEN access rules inside /etc/ssh/sshd_config by shutting off root parameters and passwords[cite: 21]. Distribute key pairs via ssh-keygen and ssh-copy-id[cite: 21].
14. Production Networking Troubleshooting
Problem Possible Cause Useful Commands
Cannot SSH SSH service stopped or firewall blocked systemctl, ss, journalctl[cite: 21]
DNS Failure Incorrect resolver configuration cat /etc/resolv.conf, ping[cite: 21]
Wrong Gateway Incorrect default route ip route[cite: 21]
Commands Covered in This Chapter
ip - Show or manipulate routing, devices, and policy routing[cite: 21]
ping - Send ICMP ECHO_REQUEST packets to network hosts[cite: 21]
traceroute - Print the route packets take to a network host[cite: 21]
ss - Dump socket statistics cleanly (modern netstat alternative)[cite: 21]
dig / nslookup - DNS resolution queries[cite: 21]
ssh / scp / sftp - OpenSSH remote suite tools[cite: 21]
curl / wget - Network page and asset transfer downloaders[cite: 21]
ufw / iptables - System packet filtering and firewall controls[cite: 21]