Skip to content
Menu
DevSecOps Now!!!
  • About
  • Certifications
  • Contact
  • Courses
  • DevSecOps Consulting
  • DevSecOps Tools
  • Training
  • Tutorials
DevSecOps Now!!!

Linux Commands to Troubleshoot Network Issues

Posted on November 4, 2024

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

In the digital age, network connectivity plays a crucial role in every facet of technology, from individual computing to large-scale enterprise solutions. When network issues arise, they can lead to service interruptions, reduced productivity, and even financial loss. Troubleshooting these network issues effectively and promptly is essential for maintaining seamless connectivity and efficient workflows.

Linux is known for its robust suite of built-in tools designed to diagnose, monitor, and resolve network-related issues. Whether you’re a system administrator, a network engineer, or a developer working in a Linux environment, understanding these troubleshooting commands is invaluable. From checking connectivity and monitoring real-time network traffic to diagnosing DNS and routing issues, Linux provides a wide array of commands that empower users to swiftly detect and resolve issues.

This article provides an in-depth guide to essential Linux commands for network troubleshooting. Each command is explained to ensure you can effectively diagnose issues such as packet loss, DNS resolution failures, connectivity delays, and other common network problems. By mastering these commands, you’ll be well-equipped to handle complex network issues, ensuring the systems you manage stay online and perform at optimal levels.

What are the Linux Commands to Troubleshoot Network Issues?

Network issues can disrupt connectivity, cause downtime, and affect productivity. Below are essential Linux commands to help troubleshoot network issues efficiently.

1. Check Network Interface Details

Use this command to display all network interfaces and their status.

ip a

2. Check IP Address and Network Information

To view IP address, subnet mask, and more details:

ifconfig

3. Ping to Test Connectivity

Ping a destination IP or hostname to check if it’s reachable:

ping <destination_ip_or_hostname>

4. Traceroute to Trace Network Path

Trace the route taken to reach a remote server, identifying any delays.

traceroute <destination_ip_or_hostname>

5. nslookup to Check DNS Resolution

Use nslookup to resolve domain names to IP addresses.

nslookup <domain_name>

6. Dig for Detailed DNS Information

Use dig for a more detailed DNS lookup:

dig <domain_name>

7. Check Open Ports with Netstat

List open ports and listening services:

netstat -tuln

8. Check Active Connections with SS

View detailed information on active connections and listening ports.

ss -tuln

9. Monitor Real-Time Traffic with Tcpdump

Capture and analyze network packets in real-time:

sudo tcpdump -i <interface> -nn

10. Test Network Bandwidth with Iperf

Run a bandwidth test (iperf must be installed on both client and server).

iperf -c <server_ip>

11. Verify Routes with ip route

View routing table information:

ip route

12. Resolve Routing Issues with Route Command

Display and manage routes:

route -n

13. Test DNS Server Performance

Run dig on different DNS servers to test their performance:

dig <domain_name> @<dns_server_ip>

14. Check Firewall Rules with UFW (Ubuntu)

Verify if the firewall is blocking network traffic.

sudo ufw status verbose

15. Nmap for Network Scanning

Scan network for open ports and services (nmap must be installed).

nmap <target_ip>

16. Netcat for Port Connectivity Testing

Test connectivity to a port on a remote machine:

nc -zv <host> <port>

17. Use MTR for Comprehensive Network Path Analysis

Combines ping and traceroute for better analysis.

mtr <destination_ip_or_hostname>

18. Log Network Events with dmesg

View kernel messages for network-related logs:

dmesg | grep -i network

19. Monitor Real-Time Network Traffic with Iftop

Track incoming and outgoing traffic for each connection.

sudo iftop -i <interface>

20. Check Connectivity via CURL or WGET

Verify connectivity by fetching data from a URL:

curl -I <url>
wget --spider <url>

What are the Important things in troubleshooting network issues on Linux?

1. Network Interface Configuration

  • Importance: Properly configured network interfaces are essential for device connectivity.
  • Key Commands: ip a, ifconfig
  • Why It Matters: Misconfigured or disconnected interfaces often cause connectivity issues. Verify IP addresses, subnet masks, and interface statuses to ensure correct setup.

2. IP Address and Subnet Verification

  • Importance: IP addresses and subnetting ensure devices communicate on the same network.
  • Key Commands: ifconfig, ip addr show
  • Why It Matters: A wrong IP address or subnet can lead to unreachable devices and broken connections, especially in subnet-dependent systems.

3. Network Connectivity Testing

  • Importance: Determines whether devices can reach one another.
  • Key Commands: ping, traceroute
  • Why It Matters: Pinging can reveal packet loss, latency, and connectivity, while traceroute helps pinpoint network hops with delays or failures.

4. DNS Resolution

  • Importance: DNS resolves domain names to IP addresses, a necessity for internet connectivity.
  • Key Commands: nslookup, dig
  • Why It Matters: DNS issues prevent accessing websites or external resources, causing broken connectivity to URLs or services dependent on domain resolution.

5. Routing and Network Paths

  • Importance: Routing controls how packets travel from source to destination.
  • Key Commands: ip route, route, traceroute
  • Why It Matters: Misconfigured routes or routing issues can block or reroute traffic inefficiently. This is especially crucial in complex networks with multiple pathways.

6. Open Ports and Services

  • Importance: Determines which services are accessible from the network.
  • Key Commands: netstat, ss
  • Why It Matters: Checking open ports ensures that services are listening on the correct ports and aren’t blocked by firewalls or configuration errors.

7. Firewall Rules and Security

  • Importance: Firewalls protect the network but can also inadvertently block legitimate traffic.
  • Key Commands: ufw, iptables
  • Why It Matters: Misconfigured firewalls may block necessary traffic, so reviewing rules can identify any obstacles.

8. Network Traffic and Packet Analysis

  • Importance: Allows monitoring of live network data for analysis.
  • Key Commands: tcpdump, iftop
  • Why It Matters: Traffic analysis helps identify high bandwidth usage, network congestion, and potential security threats by examining packets directly.

9. DNS Server and Latency Analysis

  • Importance: Measures DNS performance and verifies it against backup or alternative DNS servers.
  • Key Commands: dig <domain> @<dns_server_ip>
  • Why It Matters: Slow or unreliable DNS servers can cause delays, and testing alternatives can help determine if a DNS server switch is needed.

10. Connection Performance and Bandwidth

  • Importance: Evaluates network speed and data transfer rates.
  • Key Commands: iperf, speedtest-cli
  • Why It Matters: Bottlenecks in bandwidth affect application performance. Testing speed and bandwidth ensures networks are operating at required levels.

11. Detailed Network Mapping and Path Analysis

  • Importance: MTR (My Traceroute) combines ping and traceroute for more comprehensive network diagnostics.
  • Key Commands: mtr <destination>
  • Why It Matters: MTR is excellent for ongoing diagnostics to observe how network paths behave over time, revealing intermittent issues in real-time.

12. Log Analysis for Network-Related Events

  • Importance: Logs contain historical data on network events and errors.
  • Key Commands: dmesg | grep network
  • Why It Matters: Reviewing logs helps pinpoint past network issues and ongoing errors that may affect current connectivity.

13. Protocol and Port Scanning

  • Importance: Scans reveal open services and potential vulnerabilities.
  • Key Commands: nmap
  • Why It Matters: Scanning lets you discover open ports and potential security gaps, ensuring all exposed services are intentional and secured.

14. Remote Connectivity Testing

  • Importance: Determines if the network can reach remote servers or services.
  • Key Commands: curl, wget
  • Why It Matters: curl and wget test connectivity to remote servers, helping confirm if issues are within the internal network or on remote servers.
Post Views: 1,637
  • Commands to Troubleshoot
  • Important things in troubleshooting
  • Important things in troubleshooting network issues on Linux
  • Linux
  • linux command
  • Linux Commands to Troubleshoot
  • Linux Commands to Troubleshoot Network
  • Linux Commands to Troubleshoot Network Issues
  • Network Issues
  • Troubleshoot
  • Troubleshoot Network Issues
  • Troubleshoot tips
  • What are the Linux Commands
  • What are the Linux Commands to Troubleshoot
Subscribe
Login
Notify of
guest
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
  • Mautic and PHP 8.3 Compatibility Guide (2026)
  • Certified AIOps Engineer: The Complete Career Path and Certification Guide
  • How to Rename Apache Virtual Host Files Safely (Step-by-Step Guide for Linux)
  • AIOps Foundation Certification: Everything You Need to Know to Get Certified
  • DevOps to Certified Site Reliability Professional: A Senior Mentor’s Guide
  • Certified Site Reliability Manager Training, Preparation, and Career Mapping
  • Certified Site Reliability Architect: The Complete Career Guide
  • What Is a VPN? A Complete Beginner-to-Advanced Tutorial
  • How to Install, Secure, and Tune MySQL 8.4 on Ubuntu 24.04 for Apache Event MPM and PHP-FPM
  • Complete Guide to Certified Site Reliability Engineer Career
  • Certified DevSecOps Professional Step by Step
  • Certified DevSecOps Manager: Complete Career Guide
  • Certified DevSecOps Engineer: Skills, Career Path and Certification Guide
  • Step-by-Step: Become a Certified DevSecOps Architect
  • Tuning PHP 8.3 for Apache Event MPM and PHP-FPM on Ubuntu: A Complete Step-by-Step Production Guide
  • Complete Step-by-Step Guide to Configure Apache Event MPM, Create index.php, Set Up VirtualHost, and Fix Ubuntu Default Page
  • Convert XAMPP Apache to Event MPM + System PHP-FPM
  • The Gateway to System Observability Engineering (MOE)
  • How to Finetune Apache and Prove It Works: A Real-World Guide to Testing Performance, Concurrency, HTTP/2, Memory, CPU, and Security
  • Building a High-Performance Apache Event MPM + PHP-FPM + MariaDB Stack (Advanced Server Optimization Guide)
  • Master Infrastructure as Code: The Complete Hashicorp Terraform Associate Guide
  • Building a High-Performance Apache Server with Event MPM + PHP-FPM (Step-by-Step Guide)
  • Is XAMPP Safer for Production Than Using Apache and PHP as Root? 2026 Practical Guide
  • Unlock Cloud Security Expertise with Certified Kubernetes Security Specialist (CKS)
  • How to Fix wpDiscuz Not Replacing Default WordPress Comments in Block Themes
  • Complete Guide to Certified Kubernetes Application Developer Certification
  • Overview of Certified Kubernetes Administrator (CKA) Certification
  • How to Install and Configure XAMPP on Ubuntu 24 Server (Latest Version – 2026 Complete Guide)
  • Mastering the Google Cloud Professional DevOps Engineer
  • Mastering Azure Cloud Security: The AZ-500 Path

Recent Comments

  1. digital banking on Complete Tutorial: Setting Up Laravel Telescope Correctly (Windows + XAMPP + Custom Domain)
  2. SAHIL DHINGRA on How to Uninstall Xampp from your machine when it is not visible in Control panel programs & Feature ?
  3. Abhishek on MySQL: List of Comprehensive List of approach to secure MySQL servers.
  4. Kristina on Best practices to followed in .httacess to avoid DDOS attack?
  5. Roshan Jha on Git all Commands

Archives

  • April 2026
  • March 2026
  • February 2026
  • January 2026
  • December 2025
  • November 2025
  • October 2025
  • September 2025
  • August 2025
  • July 2025
  • June 2025
  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022

Categories

  • Ai
  • AI Blogging
  • AiOps
  • ajax
  • Android Studio
  • Antimalware
  • Antivirus
  • Apache
  • Api
  • API Security
  • Api Testing
  • APK
  • Aws
  • Bike Rental Services
  • ChatGPT
  • Code Linting
  • Composer
  • cPanel
  • Cyber Threat Intelligence
  • Cybersecurity
  • Data Loss Prevention
  • Database
  • dataops
  • Deception Technology
  • DeepSeek
  • Devops
  • DevSecOps
  • DevTools
  • Digital Asset Management
  • Digital Certificates
  • Docker
  • Drupal
  • emulator
  • Encryption Tools
  • Endpoint Security Tools
  • Error
  • facebook
  • Firewalls
  • Flutter
  • git
  • GITHUB
  • Google Antigravity
  • Google play console
  • Google reCAPTCHA
  • Gradle
  • Guest posting
  • health and fitness
  • IDE
  • Identity and Access Management
  • Incident Response
  • Instagram
  • Intrusion Detection and Prevention Systems
  • jobs
  • Joomla
  • Keycloak
  • Laravel
  • Law News
  • Lawyer Discussion
  • Legal Advice
  • Linkedin
  • Linkedin Api
  • Linux
  • Livewire
  • Mautic
  • Medical Tourism
  • MlOps
  • MobaXterm
  • Mobile Device Management
  • Multi-Factor Authentication
  • MySql
  • Network Traffic Analysis tools
  • Paytm
  • Penetration Testing
  • php
  • PHPMyAdmin
  • Pinterest Api
  • Quora
  • SAST
  • SecOps
  • Secure File Transfer Protocol
  • Security Analytics Tools
  • Security Auditing Tools
  • Security Information and Event Management
  • Seo
  • Server Management Tools
  • Single Sign-On
  • Site Reliability Engineering
  • soft 404
  • software
  • SuiteCRM
  • SysOps
  • Threat Model
  • Twitter
  • Twitter Api
  • ubuntu
  • Uncategorized
  • Virtual Host
  • Virtual Private Networks
  • VPNs
  • Vulnerability Assessment Tools
  • Web Application Firewalls
  • Windows Processor
  • Wordpress
  • WSL (Windows Subsystem for Linux)
  • X.com
  • Xampp
  • Youtube
©2026 DevSecOps Now!!! | WordPress Theme: EcoCoded
wpDiscuz