0% found this document useful (0 votes)
75 views18 pages

CNS Lab 2

This lab report summarizes the use of basic networking commands like ipconfig, ping, tracert, arp, netstat, route, and getmac. The objectives were to familiarize with these commands, their functions, and syntax. Various commands were executed on the local computer and their outputs were observed and commented on. This helped understand how the commands display network configuration and status information, verify connectivity, show the path to destinations, and view routing tables. The conclusions were that the lab made familiar with the networking commands and their parameters through hands-on practice.

Uploaded by

PRANAV POUDEL
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)
75 views18 pages

CNS Lab 2

This lab report summarizes the use of basic networking commands like ipconfig, ping, tracert, arp, netstat, route, and getmac. The objectives were to familiarize with these commands, their functions, and syntax. Various commands were executed on the local computer and their outputs were observed and commented on. This helped understand how the commands display network configuration and status information, verify connectivity, show the path to destinations, and view routing tables. The conclusions were that the lab made familiar with the networking commands and their parameters through hands-on practice.

Uploaded by

PRANAV POUDEL
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/ 18

TRIBHUVAN UNIVERSITY

INSTITUTE OF ENGINEERING
PULCHOWK CAMPUS

A
LAB REPORT
ON

BASIC NETWORKING COMMANDS

SUBMITTED BY:
PRANAV POUDEL (074BCT026)

SUBMITTED TO:
DEPARTMENT OF ELECTRONICS AND COMPUTER
ENGINEERING

DATE: June 13 2021


Objectives
● To be familiar with basic networking commands and their uses

Requirements
● Computer(s) with Internet Connectivity

Exercise

1. Explain the following commands briefly with their functions and few syntaxes.
a. ipconfig
It displays all current TCP/IP (Transmission Control Protocol/Internet Protocol) network
configurations values and refreshes Dynamic Host Configuration Protocol (DHCP) and
Domain Name System (DNS) settings.
Syntax
ipconfig [/allcompartments] [/all] [/renew [<adapter>]] [/release
[<adapter>]] [/renew6[<adapter>]] [/release6 [<adapter>]] [/flushdns]
[/displaydns] [/registerdns] [/showclassid <adapter>] [/setclassid
<adapter> [<classID>]]

By default, it displays Internet Protocol version 4 (IPv4) and IPv6 addresses, subnet
mask, and default gateway for all adapters.
e.g:
To display the basic TCP/IP configuration
Ipconfig
To display the full TCP/IP configuration for all adapters
ipconfig/all

b. getmac
This command returns the media access control (MAC) address and a list of network
protocols associated with each address for all network cards either on local or across
network computer
Syntax
getmac[.exe][/s <computer> [/u <domain\<user> [/p <password>]]][/fo
{table | list | csv}][/nh][/v]

e.g:
To display the physical address of the network adapters (NIC) in a computery with
transport name
getmac
c. ping
This command is used to verify IP-level connectivity to another TCP/IP computer by
sending Internet Control Message Protocol (ICMP) echo Request messages where
receipt of corresponding echo Reply messages are displayed, along with round-trip time
Syntax
ping [/t] [/a] [/n <count>] [/l <size>] [/f] [/I <TTL>] [/v <TOS>]
[/r <count>] [/s <count>] [{/j <hostlist> | /k <hostlist>}] [/w
<timeout>] [/R] [/S <Srcaddr>] [/4] [/6] <targetname>
e.g
To ping discord.com
ping discord.com
To ping the destination 10.0.99.221 with 10 echo Request messages, each of which has
a Data field of 1000 bytes
ping /n 10 /l 1000 10.0.99.221

d. tracert
This command determines the path taken to a destination by sending Internet Control
Message Protocol (ICMP) echo Request or ICMPv6 messages to the destination with
incrementally increasing time to live (TTL) field values.This command send the first echo
Request message with a TTL of 1 and incrementing the TTL by 1 on each subsequent
transmission until the target responds or the maximum number of hops is reached. The
maximum number of hops is 30 by default and can be specified using the /h parameter.
Syntax
tracert [/d] [/h <maximumhops>] [/j <hostlist>] [/w <timeout>] [/R]
[/S <srcaddr>] [/4][/6] <targetname>
e.g
To trace the path to the host named facebook.com
tracert facebook.com
To trace the path to the host named facebook.com and prevent the resolution of each IP
address to its name
tracert /d facebook.com

e. arp
It displays and modifies the Address Resolution Protocol (ARP) cache. The ARP cache
contains one or more tables that are used to store IP addresses and their resolved
Ethernet or Token Ring physical addresses where there isis a separate table for each
Ethernet or Token Ring network adapter installed on computer.
Syntax
arp [/a [<inetaddr>] [/n <ifaceaddr>]] [/g [<inetaddr>] [-n
<ifaceaddr>]] [/d <inetaddr> [<ifaceaddr>]] [/s <inetaddr>
<etheraddr> [<ifaceaddr>]]
e.g
To display the arp cache tables for all interfaces
arp /a
To display the arp cache table for the interface that is assigned the IP address 10.0.0.99
arp /a /n 10.0.0.99

f. Netstat
This command displays active TCP connections, ports on which the computer is
listening, Ethernet statistics, the IP routing table, IPv4 statistics (for the IP, ICMP, TCP,
and UDP protocols), and IPv6 statistics (for the IPv6, ICMPv6, TCP over IPv6, and UDP
over IPv6 protocols)
Syntax
netstat [-a] [-b] [-e] [-n] [-o] [-p <Protocol>] [-r] [-s]
[<interval>]
E.g
To display both the Ethernet statistics and the statistics for all protocols
netstat -e -s
To display the statistics for only the TCP and UDP protocols,
netstat -s -p tcp udp

g. route
This command displays and modifies the entries in the local IP routing table.
Syntax
route [/f] [/p] [<command> [<destination>] [mask <netmask>]
[<gateway>] [metric <metric>]] [if <interface>]]
e.g.
To display the entire contents of the IP routing table
route print
To add a default route with the default gateway address of 192.168.12.1
route add 0.0.0.0 mask 0.0.0.0 192.168.12.1
To display the routes in the IP routing table that begin with 10
route print 10.*
2. Note down the observation of each step with necessary commands specified in
activities B mentioned above and comment on it.

-Ipconfig

Comments
It shows basic TCP/IP configurations which includes IPv6, IPv4, subnet mask and default
gateways.
-Ipconfig/all
Comments
It displays the full TCP/IP configuration for all adapters which includes additional information
such as DHCP Server, DNS Servers, etc which can be seen from above figure.
-getmac

Comments
Here, MAC address of network adapters of computer were displayed.

-ping gateway

-ping isp (wordlink.com.np)


-ping google.com

-ping 103.5.150.3

Comments
Except worldlink.com.np, connection to all TCP/IP computers were verified but worldlink.com.np
was live when trying to access through browser. Maybe ICMP echo request message were
blocked by firewall in device that hosted worldlink.com.np so that we couldn’t verify connectivity
through ping command
-tracert gateway

-tracert isp
-tracert google.com

-trace 103.5.150.3

Comments
It displayed the path taken by packet to reach at mentioned host. It is seen that packet always
first reach to gateway which is 192.168.1.254 and then to isp [27.34.8.1] then to different path
before reaching destination.
-arp -a

After pinging a device1

After pinging a device2


Comments
First, It shows the current ARP cache contents. After pinging the local device, it is seen that
content of ARP cache was updated by re-running the command as ip of device1[192.168.1.64]
and device2[192.168.1.105] was updated at first and second ping respectively.

- netstat -a
Comments
It displays the all the active and inactive connections, TCP and UDP ports the device is currently
listening to.
- netstat -e

- netstat -r
Comments
netstat -e commands shows generated statistics of the network interface like number of bytes,
unicast packets, non-unicast packets, discards, errors, etc. sent and receive and netstat -r
Shows inference list, IPv4 route table and IPv6 route table.

- route print
- route print -4

route print -6
Comments
route print displays the content of both IPv4 and IPv6 routing tables where as with parameter -4
and -6, it shows content of IPv4 and IPv6 routing tables respectively.

Conclusions
In this lab, various networking commands were studied and executed which made us familiar
with them. Different parameters of these commands were explored and outputs were noted.
Insights were given to these outputs and lab was completed successfully.

You might also like