109.3 Basic network

Tech Tutorial: 109.3 Basic Networking Troubleshooting on Linux #

Introduction #

In this tutorial, we will explore how to troubleshoot networking issues on Linux client hosts. The ability to diagnose and resolve network problems is crucial for maintaining the integrity and efficiency of a network. We’ll cover essential commands and utilities that every system administrator should know to effectively troubleshoot networking issues in a Linux environment.

Key Knowledge Areas: #

  • Understanding IP configuration
  • Analyzing network connectivity
  • Diagnosing routing issues
  • Checking port availability

Utilities: #

  • ip
  • ifconfig
  • netstat
  • ping
  • traceroute
  • tracepath
  • mtr
  • route
  • host
  • dig
  • ss

Step-by-Step Guide #

1. Checking IP Configuration #

ip and ifconfig #

To start troubleshooting, you first need to check the current IP configuration of your machine.

Example with ip:

ip addr show

This command will display all the network interfaces along with their IP addresses, which can help you verify if they are correctly configured.

Example with ifconfig (deprecated but still used in some systems):

ifconfig

Similar to ip addr show, ifconfig displays the network interfaces and their details.

2. Analyzing Network Connectivity #

ping #

To check connectivity to another network host, use ping.

Example:

ping -c 4 google.com

This command sends four ICMP echo requests to google.com and shows if the packets are returned.

3. Diagnosing Routing Issues #

traceroute and tracepath #

These tools help trace the path data takes to reach an external host, identifying where problems occur.

Example with traceroute:

traceroute google.com

Example with tracepath:

tracepath google.com

Both commands show the route packets take to reach the target address and can help identify at which hop an issue might be occurring.

4. Checking Port Availability #

netstat and ss #

These tools are used to display network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.

Example with netstat:

netstat -tulpn

This command lists all listening ports along with the service names and process IDs.

Example with ss:

ss -tuln

This is a more modern alternative to netstat and provides similar output.

5. Additional Utilities for DNS issues and More #

host, dig #

To check DNS records and diagnose DNS issues, host and dig are invaluable tools.

Example with host:

host google.com

This command retrieves DNS information about google.com, including its IP address.

Example with dig:

dig google.com

dig provides a more detailed DNS query information than host.

6. Advanced Routing and Network Traffic Diagnosis #

mtr, route #

Example with mtr:

mtr google.com

mtr combines the functionality of traceroute and ping and provides a continuously updated list of routers.

Example with route:

route -n

Displays the kernel routing table in a numeric format, helping diagnose routing issues.

Conclusion #

In this tutorial, we’ve covered a variety of tools and commands that are essential for troubleshooting networking issues on Linux systems. By understanding how to use these tools, you can quickly diagnose and resolve network problems, ensuring reliable network connectivity. Practice using these commands in a controlled environment to gain familiarity and confidence in your troubleshooting skills.