DEV Community

Cover image for Linux Networking Commands Every Engineer Should Learn
Pallavi
Pallavi

Posted on

Linux Networking Commands Every Engineer Should Learn

🌐 Linux Networking Commands Every Engineer Should Learn

Modern software systems are no longer confined to a single machine. Applications run across servers, containers, cloud environments, Kubernetes clusters, edge devices, and distributed networks spread across multiple regions.

In this interconnected world, networking issues can bring entire systems to a halt.

🚫 A web application may suddenly become unreachable.

🚫 A microservice may fail to communicate with another service.

🚫 A database connection may timeout.

🚫 A Kubernetes pod may become inaccessible.

When such incidents occur, experienced engineers don't immediately blame the application code. Instead, they begin investigating the network.

This is where Linux networking commands become invaluable.

Whether you're a Linux administrator, DevOps engineer, cloud architect, software developer, cybersecurity analyst, or Site Reliability Engineer (SRE), understanding Linux networking tools is a fundamental skill.


πŸš€ Why Networking Skills Matter for Modern Engineers

Consider a common production scenario.

Situation

βœ… Application deployed successfully

βœ… CPU usage is normal

βœ… Memory usage is healthy

❌ Users cannot access the application

Possible causes include:

βœ”οΈ DNS Resolution Failure

βœ”οΈ Routing Issues

βœ”οΈ Firewall Restrictions

βœ”οΈ Network Latency

βœ”οΈ Port Accessibility Problems

βœ”οΈ Load Balancer Misconfiguration

βœ”οΈ Container Networking Issues

Without networking knowledge, identifying the root cause becomes difficult.

Linux networking commands provide visibility into what's happening beneath the application layer.


πŸ” Understanding the Networking Troubleshooting Workflow

Experienced engineers often follow a structured approach:

Application Issue
       ↓
Check Connectivity
       ↓
Verify DNS
       ↓
Validate Routing
       ↓
Check Ports
       ↓
Inspect Traffic
       ↓
Identify Root Cause
Enter fullscreen mode Exit fullscreen mode

The commands covered in this guide form the foundation of that workflow.


🌐 1. ip Command

The ip command is one of the most important networking utilities in modern Linux systems.

It replaces legacy tools such as:

βœ… ifconfig

βœ… route

βœ… arp


Display IP Addresses

ip addr show
Enter fullscreen mode Exit fullscreen mode

Example Output

eth0: 192.168.1.100/24
Enter fullscreen mode Exit fullscreen mode

This reveals:

βœ”οΈ IP Address

βœ”οΈ Subnet Mask

βœ”οΈ Network Interface Information


Display Routing Table

ip route
Enter fullscreen mode Exit fullscreen mode

Example Output

default via 192.168.1.1 dev eth0
Enter fullscreen mode Exit fullscreen mode

This shows how packets travel through the network.

Why Engineers Use It

βœ… Diagnose connectivity issues

βœ… Verify network interfaces

βœ… Validate routing configurations


πŸ“‘ 2. ping Command

The ping command checks network connectivity between systems.

Example

ping google.com
Enter fullscreen mode Exit fullscreen mode

Example Output

64 bytes from google.com:
time=18 ms
Enter fullscreen mode Exit fullscreen mode

What Ping Helps Identify

βœ”οΈ Network Reachability

βœ”οΈ Packet Loss

βœ”οΈ Latency Issues

βœ”οΈ DNS Functionality

Practical Scenario

ping database-server
Enter fullscreen mode Exit fullscreen mode

Useful when troubleshooting database connectivity issues.


πŸ›£οΈ 3. traceroute Command

Sometimes a destination is reachable, but packets experience delays.

This is where traceroute becomes useful.

Example

traceroute google.com
Enter fullscreen mode Exit fullscreen mode

Example Output

1 Router A
2 ISP Gateway
3 Regional Backbone
4 Google Network
Enter fullscreen mode Exit fullscreen mode

What It Shows

βœ”οΈ Every network hop

βœ”οΈ Routing path

βœ”οΈ Bottlenecks

βœ”οΈ Routing loops

Real-World Benefits

βœ… Network troubleshooting

βœ… ISP issue detection

βœ… Cloud connectivity analysis


πŸ”Ž 4. nslookup Command

DNS is often the hidden cause of application failures.

Example

nslookup google.com
Enter fullscreen mode Exit fullscreen mode

Output

Name: google.com
Address: 142.250.x.x
Enter fullscreen mode Exit fullscreen mode

Why It Matters

Applications communicate through:

βœ”οΈ Domain Names

Not:

❌ Raw IP Addresses

If DNS fails, applications become inaccessible.


πŸ“– 5. dig Command

Engineers often prefer dig because it provides detailed DNS information.

Example

dig google.com
Enter fullscreen mode Exit fullscreen mode

Important Sections

βœ”οΈ ANSWER SECTION

βœ”οΈ AUTHORITY SECTION

βœ”οΈ QUERY TIME

Common Use Cases

βœ… DNS Troubleshooting

βœ… Mail Server Verification

βœ… Cloud Service Validation

βœ… Performance Analysis


πŸ“Š 6. netstat Command

Although largely replaced by newer tools, netstat remains widely used.

Example

netstat -tuln
Enter fullscreen mode Exit fullscreen mode

Example Output

TCP 0.0.0.0:80 LISTEN
TCP 0.0.0.0:443 LISTEN
Enter fullscreen mode Exit fullscreen mode

What It Shows

βœ”οΈ Active Connections

βœ”οΈ Listening Ports

βœ”οΈ Routing Tables

βœ”οΈ Network Statistics

Why It Matters

When a website is inaccessible, verifying listening ports is critical.


⚑ 7. ss Command

The modern replacement for netstat is ss.

Example

ss -tulnp
Enter fullscreen mode Exit fullscreen mode

Output

LISTEN 0 128 *:80
Enter fullscreen mode Exit fullscreen mode

Advantages

βœ”οΈ Faster Performance

βœ”οΈ Better Scalability

βœ”οΈ Improved Filtering

In large cloud environments, ss handles thousands of connections efficiently.


🌍 8. curl Command

The curl command is one of the most powerful networking tools available.

Example

curl https://api.example.com
Enter fullscreen mode Exit fullscreen mode

What It Can Do

βœ”οΈ Test REST APIs

βœ”οΈ Download Files

βœ”οΈ Verify HTTPS Endpoints

βœ”οΈ Debug Application Responses

Check HTTP Headers

curl -I https://example.com
Enter fullscreen mode Exit fullscreen mode

Example Output

HTTP/1.1 200 OK
Enter fullscreen mode Exit fullscreen mode

A favorite tool among backend developers and DevOps engineers.


πŸ“₯ 9. wget Command

The wget utility is primarily used for downloading content.

Example

wget https://example.com/file.zip
Enter fullscreen mode Exit fullscreen mode

Common Uses

βœ… Software Installation

βœ… Script Automation

βœ… Backup Downloads

βœ… Repository Synchronization


🏷️ 10. host Command

The host command provides quick DNS lookups.

Example

host google.com
Enter fullscreen mode Exit fullscreen mode

Output

google.com has address
142.250.x.x
Enter fullscreen mode Exit fullscreen mode

A lightweight alternative to:

βœ”οΈ dig

βœ”οΈ nslookup


πŸ”— 11. arp Command

ARP (Address Resolution Protocol) maps IP addresses to MAC addresses.

Example

arp -a
Enter fullscreen mode Exit fullscreen mode

Output

192.168.1.10 at
00:11:22:33:44:55
Enter fullscreen mode Exit fullscreen mode

Why It Matters

Useful for identifying:

βœ… Duplicate IP Addresses

βœ… Local Network Issues

βœ… Device Connectivity Problems


πŸ”¬ 12. tcpdump Command

When deep packet analysis is required, engineers use tcpdump.

Example

tcpdump -i eth0
Enter fullscreen mode Exit fullscreen mode

Captures packets traversing a network interface.


Capture HTTP Traffic

tcpdump port 80
Enter fullscreen mode Exit fullscreen mode

Real-World Use Cases

βœ… API Debugging

βœ… Security Investigations

βœ… Packet Analysis

βœ… Protocol Troubleshooting

Think of tcpdump as a network microscope.


πŸ” 13. nmap Command

The nmap utility is widely used for network discovery and security assessments.

Example

nmap 192.168.1.10
Enter fullscreen mode Exit fullscreen mode

Output

80/tcp open
443/tcp open
Enter fullscreen mode Exit fullscreen mode

What It Helps Identify

βœ”οΈ Open Ports

βœ”οΈ Running Services

βœ”οΈ Network Devices

βœ”οΈ Security Vulnerabilities


πŸ›€οΈ 14. route Command

Although largely replaced by the ip command, route remains useful.

Example

route -n
Enter fullscreen mode Exit fullscreen mode

This displays routing information used by the operating system.

Common Uses

βœ… Route Verification

βœ… Gateway Troubleshooting

βœ… Cloud Networking Analysis


πŸ“ˆ 15. mtr Command

The mtr command combines:

βœ”οΈ ping

βœ”οΈ traceroute

into a single diagnostic tool.

Example

mtr google.com
Enter fullscreen mode Exit fullscreen mode

Benefits

Provides real-time:

βœ… Packet Loss Statistics

βœ… Latency Analysis

βœ… Route Visibility

Many SRE teams rely on MTR during incident response.


πŸ“‹ Essential Networking Commands Cheat Sheet

Command Purpose
ip Interface and routing management
ping Connectivity testing
traceroute Path analysis
nslookup DNS lookup
dig Advanced DNS diagnostics
ss Socket statistics
netstat Network statistics
curl API and HTTP testing
wget File downloads
host DNS lookup
arp IP-to-MAC mapping
tcpdump Packet capture
nmap Port scanning
route Route inspection
mtr Combined ping and traceroute

☁️ Linux Networking in Cloud & DevOps Environments

Today's engineers rarely work with standalone servers.

Instead, they manage:

βœ… AWS

βœ… Azure

βœ… Google Cloud

βœ… Kubernetes Clusters

βœ… Docker Containers

Modern Traffic Flow

User
 ↓
Load Balancer
 ↓
Ingress Controller
 ↓
Kubernetes Service
 ↓
Application Pod
Enter fullscreen mode Exit fullscreen mode

A failure at any layer can impact availability.

This is why networking skills are a critical component of modern DevOps and Multi-Cloud with AI environments.


πŸ“Š Networking Commands and Data Analytics Workloads

Large-scale analytics systems rely heavily on networking.

Examples include:

βœ… Hadoop Clusters

βœ… Spark Environments

βœ… Data Warehouses

βœ… Streaming Platforms

Network bottlenecks can dramatically affect performance.

Engineers frequently use networking tools to diagnose distributed system issues.


πŸ€– Networking in the Era of Generative AI & Agentic AI

Modern AI systems rely on:

βœ… Distributed Model Serving

βœ… API Communication

βœ… Vector Databases

βœ… Multi-Cloud Deployments

βœ… GPU Clusters

Example AI Workflow

User Query
      ↓
API Gateway
      ↓
LLM Service
      ↓
Vector Database
      ↓
Response Generation
Enter fullscreen mode Exit fullscreen mode

Every component depends on reliable network communication.

Networking commands help diagnose:

βœ”οΈ Latency Issues

βœ”οΈ DNS Failures

βœ”οΈ Packet Loss

βœ”οΈ Service Connectivity Problems


πŸ’‘ Best Practices for Network Troubleshooting

Experienced engineers follow a systematic methodology.

βœ… Step 1: Verify Connectivity

ping target-server
Enter fullscreen mode Exit fullscreen mode

βœ… Step 2: Check DNS Resolution

dig domain.com
Enter fullscreen mode Exit fullscreen mode

βœ… Step 3: Verify Routes

ip route
Enter fullscreen mode Exit fullscreen mode

βœ… Step 4: Confirm Port Accessibility

ss -tulnp
Enter fullscreen mode Exit fullscreen mode

βœ… Step 5: Analyze Packets

tcpdump
Enter fullscreen mode Exit fullscreen mode

This structured approach significantly reduces troubleshooting time.


🎀 Common Interview Questions

❓ What is the difference between ping and traceroute?

βœ… Ping checks connectivity and latency.

βœ… Traceroute identifies the route packets take.


❓ Why is ss preferred over netstat?

βœ… Faster

βœ… More Efficient

βœ… Better for Modern Linux Systems


❓ What is tcpdump used for?

βœ… Packet Capture

βœ… Security Analysis

βœ… Protocol Troubleshooting


❓ Which command is best for DNS troubleshooting?

βœ… dig

because it provides the most detailed DNS information.


❓ How do you check open ports on Linux?

ss -tulnp
Enter fullscreen mode Exit fullscreen mode

or

netstat -tuln
Enter fullscreen mode Exit fullscreen mode

🎯 Final Thoughts

Networking is one of the most critical skills in modern engineering.

Whether you're:

βœ… Managing Linux Servers

βœ… Troubleshooting Cloud Applications

βœ… Operating Kubernetes Clusters

βœ… Building AI-Powered Systems

βœ… Working in DevOps

understanding network behavior is essential.

Commands such as:

βœ”οΈ ip

βœ”οΈ ping

βœ”οΈ traceroute

βœ”οΈ dig

βœ”οΈ ss

βœ”οΈ curl

βœ”οΈ tcpdump

βœ”οΈ nmap

provide deep visibility into how systems communicate and where failures occur.

πŸš€ The most effective engineers aren't those who memorize commandsβ€”they're the ones who understand when and why to use them. Mastering these Linux networking tools will dramatically improve your ability to diagnose problems, optimize performance, and maintain reliable production systems.

As infrastructure continues evolving toward cloud-native architectures, distributed computing, and AI-driven platforms, Linux networking expertise remains one of the most valuable technical skills an engineer can possess.

Source:

Top comments (0)