Lab7 - Basic Network Troubleshooting Commands
Lab7 - Basic Network Troubleshooting Commands
University
1. Lab Objectives
In this lab, we will look into some of the most popular network commands.
2. Introduction
Network commands prove helpful when there is a need to configure or
troubleshoot the network settings of our system. These commands are specifically
designed to troubleshoot network problems with minimum complexity using the
windows command prompt tool.
3. Networking Commands
1- ping
2- pathping
3- ipconfig , ipconfig / all
4- arp
5- netstat
6- tracert
7- nslookup
8- getmac
note: Command-line tools must be run at the prompt of the Cmd.exe command
interpreter. To open Command Prompt, click Start, click Run, type cmd, and then
click OK. To view help at the command-line, at the command prompt, type the
following: CommandName /?
1
1. Ping
Ping is the primary tool for troubleshooting IP-level connectivity. Type ping -? at a
command prompt to see a complete list of available command-line options. Ping
allows you to specify the size of packets to use (the default is 32 bytes), how many
to send, whether to record the route used, what Time To Live (TTL) value to use,
and whether to set the "don't fragment" flag.
When a ping command is issued, the utility sends an ICMP Echo Request to a
destination IP address. Try pinging the IP address of the target host to see if it
responds. If that succeeds, try pinging the target host using a host name. Ping first
attempts to resolve the name to an address through a DNS server, then a WINS server
(if one is configured), then attempts a local broadcast. When using DNS for name
resolution, if the name entered is not a fully qualified domain name, the DNS name
resolver appends the computer's domain name or names to generate a fully qualified
domain name.
If pinging by address succeeds but pinging by name fails, the problem usually lies
in name resolution, not network connectivity. Note that name resolution might fail
if you do not use a fully qualified domain name for a remote name. These requests
fail because the DNS name resolver is appending the local domain suffixes to a name
that resides elsewhere in the domain hierarchy.
C:\>ping 192.168.0.1
C:\>ping 192.168.0.1 -n 8
2
Reply from 192.168.0.1: bytes=32 time=1ms TTL=64
Reply from 192.168.0.1: bytes=32 time=1ms TTL=64
Reply from 192.168.0.1: bytes=32 time=2ms TTL=64
Reply from 192.168.0.1: bytes=32 time=1ms TTL=64
Reply from 192.168.0.1: bytes=32 time=1ms TTL=64
Reply from 192.168.0.1: bytes=32 time=1ms TTL=64
Reply from 192.168.0.1: bytes=32 time=1ms TTL=64
C:\>
C:\>ping 192.168.0.1 -t
ping < ip address > -t : send endless ping requests until interrupted. To interrupt,
press Ctrl+C.
C:\>ping www.google.com
3
C:\>ping www.google.com
C:\>
2. Pathping
Provides information about network latency and network loss at intermediate hops
between a source and destination. Pathping sends multiple Echo Request messages
to each router between a source and destination over a period of time and then
computes results based on the packets returned from each router. Because pathping
displays the degree of packet loss at any given router or link, you can determine
which routers or subnets might be having network problems. Pathping performs the
equivalent of the tracert command by identifying which routers are on the path. It
then sends pings periodically to all of the routers over a specified time period and
computes statistics based on the number returned from each.
example:
pathping -n www.google.com
4
3. ipconfig
In computing, ipconfig (internet protocol configuration) is a command line tool
application that used to control the network connections on Microsoft Windows OS
machine that displays all current TCP/IP network configuration values and can
modify Dynamic Host Configuration Protocol (DHCP) and Domain Name System
(DNS) settings.
5
4. arp
Displays and modifies entries in the Address Resolution Protocol (ARP) cache,
which contains one or more tables that are used to store IP addresses and their
resolved Ethernet or Token Ring physical addresses. There is a separate table for
each Ethernet or Token Ring network adapter installed on your computer. Used
without parameters, arp displays help.
example:
arp -a
6
5. netstat
In computing, netstat (network statistics) is a command-line network utility tool
that displays network connections for the Transmission Control Protocol (both
incoming and outgoing), routing tables, and a number of network interface (network
interface controller or software-defined network interface) and network.
7
To display active TCP connections and the process IDs every 5 seconds, type the
following command:
netstat -o 5
To display active TCP connections and the process IDs using numerical form, type
the following command:
netstat -n -o
8
6. Tracert
Determines the path taken to a destination by sending Internet Control Message
Protocol (ICMP) Echo Request messages to the destination with incrementally
increasing Time to Live (TTL) field values. The path displayed is the list of near-
side router interfaces of the routers in the path between a source host and a
destination. The near-side interface is the interface of the router that is closest to the
sending host in the path.
Examples
To trace the path to the host named google.com, type:
tracert google.com
To trace the path to the host named google.com and prevent the resolution of each
IP address to its name, type:
tracert -d google.com
C:\>tracert www.google.com
Tracing route to www.google.com [216.58.205.228] over a
maximum of 30 hops:
1 1 ms 1 ms 1 ms 192.168.0.1
2 2 ms 2 ms 1 ms 10.0.0.2
3 * 2 ms 2 ms 5.149.98.97
4 * 182 ms 303 ms 185.184.196.97
5 * * * Request timed out.
6 * * * Request timed out.
7 76 ms 80 ms 80 ms 185.90.104.11
8 71 ms 70 ms 70 ms 108.170.250.179
9 * 82 ms 81 ms 209.85.253.114
10 83 ms 81 ms 80 ms 216.239.41.57
11 * 76 ms 83 ms 108.170.236.248
9
12 72 ms 72 ms 72 ms 108.170.251.129
13 82 ms 82 ms 78 ms 216.239.48.43
14 83 ms 82 ms 83 ms fra15s24-in-f228.1e100.net
[216.58.205.228]
Trace complete.
C:\>
7. Nslookup
Nslookup is a useful tool for troubleshooting DNS problems, such as host name
resolution. When you start Nslookup, it shows the host name and IP address of the
DNS server that is configured for the local system, and then display a command
prompt (>) for further queries. If you type a question mark ( ? ), Nslookup shows all
available commands. You can exit the program by typing exit.
To look up a host's IP address using DNS, type the host name and press Enter.
Nslookup defaults to using the DNS server configured for the computer on which it
is running, but you can focus it on a different DNS server by typing server < name>
(where < name> is the host name of the server you want to use for future lookups).
Once another server is specified, anything entered after that point is interpreted as a
host name.
C:\>nslookup
Default Server: UnKnown
Address: 192.168.0.1
Non-authoritative answer:
Name: www.google.com
Addresses: 2a00:1450:4001:814::2004
172.217.22.36
10
www.yahoo.com
Server: UnKnown
Address: 192.168.0.1
8. getmac
DOS command used to show both local and remote MAC addresses. When run with
no parameters (ie. getmac) it displays MAC addresses for the local system. When
the /v parameter is used, it also displays the associated connection name and network
adapter name.
C:\>getmac
Physical Address Transport Name
==================================================
========
N/A Hardware not present
11
Com. and Info. Eng. Dep., Computer Network LAB.
Electronics Engineering College, Dr. Sara Raed
Ninevah University Date: 13 / Nov./2024
Homework Instructions
12