0% found this document useful (0 votes)
26 views

Network Troubleshooting Basics

Basics of network tag

Uploaded by

Manoj Jadhav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Network Troubleshooting Basics

Basics of network tag

Uploaded by

Manoj Jadhav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

ping

Ping is a versatile command-line tool used to check network connectivity between devices. It
sends ICMP echo requests to a specified destination and waits for an ICMP echo reply.

Here's how to use it:


Basic Usage: Open our command prompt or terminal and type ping [destination], where
[destination] is the hostname or IP address we want to ping.
For example, ping www.google.com.
Interpreting Results: After executing the command, we'll see statistics about the ping,
including the round-trip time (RTT) in milliseconds and any packet loss. This information
helps diagnose network issues.
Example: Suppose we want to check our connection to Google's servers. we enter ping
www.google.com in our command prompt. The output shows the time it takes for packets to
travel to Google's servers and back, along with any packet loss.

Created by Athira KK
1
traceroute
The traceroute command is used to trace the path that packets take from our device to a
destination host.

Example: traceroute google.com


It displays the IP addresses of the routers along the path and the time it takes for packets to
reach each router, helping diagnose network routing issues.

How does it work?


Traceroute launches UDP probes with increasing TTL values until it receives a "time exceeded"
message from ICMP. This iterative process uncovers each hop along the route, incrementing TTL
until reaching the destination or TTL limit.
The report we receive details Time to Live, IP addresses of route stops, and round-trip times.
Plus, asterisks mark unresponsive routers, aiding troubleshooting.

Created by Athira KK
2
telnet
The telnet command is used to establish a TCP connection to a remote host.

Example: telnet google.com 443


It allows us to check if a specific port on a remote host is open and responsive, aiding in
troubleshooting network connectivity.

While ping and traceroute can indicate server responsiveness, it doesn't guarantee
operational status. For instance, a server may respond to ping but lack essential services like
Apache, rendering it inaccessible. Conversely, servers not responding to ping may still be
reachable via other protocols due to firewall configurations.
To test network connectivity and protocol allowance effectively, Telnet proves invaluable.
Although outdated for remote access due to lack of encryption, Telnet remains useful for
protocol testing.
For example, testing a connection to google.com at port 443 with Telnet can confirm
successful network connections.
Created by Athira KK
3
curl
The curl command is a versatile tool for transferring data using various protocols.

Example: curl https://example.com


It can retrieve and display content from web servers, making it useful for testing APIs and
fetching web pages.

curl supports various protocols, primarily used for sending HTTP requests.
To perform a basic HTTP GET request,
curl http://example.com
For checking response codes and viewing headers only,
curl -I http://example.com
To utilize different request methods, such as POST, utilize the -X flag:
curl -X POST http://example.com
Moreover, curl excels at file downloads or storing responses with the -o flag:
curl http://example.com/file -o output.file

Created by Athira KK
4
dig
The dig command is a DNS lookup utility used to query DNS servers for information about
domain names. It retrieves various DNS records, including A, AAAA, CNAME, MX, and TXT
records.

Example : dig google.com - will query the DNS server for the IP address of "google.com".

For instance, querying the DNS record for google.com with dig google.com returns vital
information like the queried server, TTL, query class, query type, and the associated IP
address, such as 172.217.0.46.

While dig defaults to querying servers specified in /etc/resolv.conf, we can specify a


particular DNS server using the @ flag. Additionally, we can explore different record types
like MX, NS, or ALL using the -t option.

Created by Athira KK
5
netstat

The netstat command displays network connections, routing tables, interface statistics,
masquerade connections, and multicast memberships. It provides information about network
connections, routing information, and interface statistics.

Example: netstat -lp - shows the protocol, local address, and process ID (PID) of the listening
program.

Netstat offers various flag commands like:


-a: all active ports
-n: only numerical IP addresses and ports
-f: whenever possible, provide all names of foreign connections
-o: show process ID
-r: routing table

Created by Athira KK
6
nmap

The nmap command is a network scanning tool used to discover hosts and services on a
computer network. It sends packets to target hosts and analyses the responses to identify open
ports, running services, and potential vulnerabilities.

Example: nmap -sS target_ip scans the target IP address using TCP SYN scan.

In troubleshooting, nmap used to identify network assets and vulnerabilities.

For example, by conducting a ping scan to discover hosts and then probing specific hosts to
reveal active services like SSH and HTTP, facilitating further diagnostics or actions like SSH
connections or HTTP requests using tools like curl.

Created by Athira KK
7
ssh
SSH, or Secure Shell, is a protocol used to securely access and control remote computers over a
network. It encrypts all data transferred between the local and remote machines, making it safe
to use even on untrusted networks. This level of security is essential for protecting sensitive
data and troubleshooting networks with unknown security levels.

To launch SSH, use the basic syntax:


[ssh] [user_name@hostname] or [ssh] [user_name@ipaddress].
For example, ssh user@example.com.

After executing the command, we'll be prompted to enter the password associated with the
remote user account for authentication. While passwords are a common method, it's advisable
to set up password less authentication for added security whenever feasible.

Created by Athira KK
8
scp

SCP, or Secure Copy Protocol, is a secure method for transferring files between a local and
remote host. Unlike SSH, which allows us to execute commands on a remote server, SCP focuses
solely on file transfer.

If we want to copy a file named "example.txt" from our local machine to a remote server.
Example of SCP command like this:
scp example.txt user@example.com:/path/to/destination

Created by Athira KK
9

You might also like