Essential Network Troubleshooting

Essential Network Troubleshooting

Introduction

We all know how crucial it is to address network issues before they escalate, particularly in environments supporting numerous users.

Let’s start by pinpointing the causes of network issues. End-user network issues often stem from various sources:

  1. Physical connectivity issues

  2. Slow internet performance

  3. DNS Problems

  4. Conflicting duplicate or static IP addresses

  5. External Factors: ISP outages

There are countless tools for troubleshooting and resolving network issues, and guess what? Most of them are readily available within common operating systems. Here are the essential commands I rely on when encountering connectivity issues on Windows-based computers.

ipconfig

Before we start checking connections with other devices, it is important to check the configurations of our devices. This is where ipconfig steps in.

Ipconfig displays the network configuration details which include IP address, subnet mask, default gateway.

ipconfig /all gives detailed information

ipconfig /all

ipconfig /release releases the IP from DHCP servers

ipconfig /release

ipconfig/renew renews the IP address from DHCP servers

ipconfig /renew

ipconfig /flushdns resolves DNS-related problems by clearing the contents of the DNS resolver cache.

ipconfig /flushdns

ping

Ping command uses ICMP protocol to test connectivity between two devices. When we execute the ping command, the ICMP echo request is sent to the destination, then the destination sends back the ICMP echo reply to the source. This command allows us to measure if we can reach a device on the other end and the round trip time between our device and the destination device.

The syntax for the ping command typically follows this format:

ping [options] [hostname or IP address]

Example:

C:\Users\Caleb>ping google.com

Pinging google.com [172.217.170.206] with 32 bytes of data:
Reply from 172.217.170.206: bytes=32 time=8ms TTL=118
Reply from 172.217.170.206: bytes=32 time=8ms TTL=118
Reply from 172.217.170.206: bytes=32 time=7ms TTL=118
Reply from 172.217.170.206: bytes=32 time=8ms TTL=118

Ping statistics for 172.217.170.206:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 7ms, Maximum = 8ms, Average = 7ms

In the above example, Time – shows the round-trip time, and Lost 0 – means all the packets were sent successfully and no packet loss. Therefore, google.com is reachable

On the other hand, if there is packet loss e.g., "Lost = 1" or "Lost = 2", it means that some of the packets were not received or responded to, which could indicate network connectivity issues.

Use -n flag to specify how many messages you want to send

ping -n 5 google.com

Use -t flag for continuous ping

ping -t google.com

traceroute

Traceroute is used to trace the path a packet traverses from our device to a destination device. Using this command, we can identify the intermediate devices or hops that a packet passes through.

tracert [options] [hostname or IP address]

The output of the traceroute command includes the IP addresses of the routers (hops), their domain names (if available), and the round-trip time for each hop.

C:\Users\Caleb>tracert google.com

Tracing route to google.com [172.217.170.174]
over a maximum of 30 hops:

  1     3 ms     2 ms     2 ms  192.168.100.1
  2     2 ms     2 ms     1 ms  XX.155.94.132
  3     8 ms     8 ms     8 ms  XX.155.90.162
  4     8 ms     8 ms    10 ms  XX.155.94.50
  5     8 ms     7 ms     7 ms  172.217.170.174

Trace complete.

Flag -d prevents tracert from translating IP addresses into hostnames, which speeds up the tracing process.

-h flag sets the maximum number of hops that tracert will try before stopping the trace.

tracert -d -h 4 google.com

telnet

We use the telnet to check the status of a specific port in the destination. It helps us determine if a particular port is open and accessible.

telnet [IP address] [port]

If the port is open and accessible, the command prompt or terminal screen will go blank, and you will see a cursor waiting for your input. This indicates that the port is open and ready to accept connections.

If the port is closed or inaccessible, you will see an error message, such as "Connection refused" or "Could not open connection to the host." This means that the port is closed or the device is not listening on that port.

nslookup

nslookup can help troubleshoot DNS-related issues. The nslookup command queries DNS servers to retrieve domain-related information such as associated IP addresses, reverse DNS lookups, and details about authoritative DNS servers

C:\Users\Dell>nslookup google.com
Server:  UnKnown
Address:  192.168.100.1

Non-authoritative answer:
Name:    google.com
Addresses:  2a00:1450:401a:801::200e
          172.217.170.206

In the example above, 192.168.100.1 is the IP address of the DNS server queried while 172.217.170.206 is the IPv4 address linked with the domain "google.com".

By default, nslookup uses your computer's configured DNS server. If you want to query a specific DNS server, type the domain name or IP address you wish to query, and then include the specific DNS server's IP address.

nslookup google.com 8.8.8.8

This command queries the DNS server with the IP address 8.8.8.8 for information related to the domain name "google.com".

💡
Extra Tips
  • Physical Connections: Ensure physical connections (cables, connectors) are secure and not damaged.

  • Firewall: Check firewall settings as they often block network communication. Disable temporarily for testing purposes if needed.

  • Software Conflicts: Third-party antivirus or security software can sometimes interfere with network connections. Temporarily disable them for testing.

  • Monitoring Tools: By Utilizing monitoring tools like DataDog, Nagios, or PRTG we can stay ahead of potential problems. These tools predict issues, cut downtime, and give us the edge in managing a reliable network.

Conclusion

Remember, start with the basics: check the physical connectivity of devices, eliminate software clashes, and explore the command-line tools. Sometimes, a simple 'ping' might just hold the key to solving your connectivity issues. And if you hit a roadblock, don't hesitate to reach out to your local IT guru for support.

Take a look at the simple network scanner I've created, which uses ping requests to tell if devices are online or not.

Stay connected and keep those networks running smoothly! 🌐✨