Tutorial Exercise 1
Tutorial Exercise 1
4.07.2024
Aim:
To study and execute the basic networking commands in Windows and Linux
Software:
Command Prompt (Windows) and Terminal (Linux)
Procedure:
Windows
Note: The screen will show the IP address, subnet mask and the default gateway. The IP address and
the default gateway should be in the same network or subnet; otherwise this host wouldn’t be able
to communicate outside the network.
IP address: 10.1.224.107
IP address: 10.0.2.15
b. To see more information, type ipconfig/all (Windows) OR ifconfig –a (Linux) and press Enter key. It
will show the detailed IP configuration of the computer on the screen.
Ping Command
The ping command is one of the most often used networking utilities for detecting
devices on a network and for troubleshooting network problems. When you ping a device
you send that device a short message, which it then sends back (the echo). Ping uses the
Internet Control Message Protocol (ICMP) echo-request and echo-reply feature to test the
physical connectivity.
a. Ping to the Google Server. Open command prompt (Windows)/Terminal(Linux) and type ping
<IPaddress or google.com>. Note the result (in both Windows and Linux)
Windows
b. Ping the computer’s loopback IP address. Type the following command: ping 127.0.0.1
The address 127.0.0.1 is reserved for loopback testing. If the ping is successful, then TCP/IP is
properly installed and functioning on this computer.
Windows
Traceroute Command
Traceroute or tracert command shows the path a packet of information takes from your
computer to one you specify. It will list all the routers it passes through until it reaches its
destination, or fails to and is discarded. In addition to this, it will tell you how long each 'hop'
from router to router takes.
a. Trace the route to the psgtech website. Try in both windows and Linux. Record the output and
interpret.
Windows
NETSTAT
The command "netstat" is often used for troubleshooting network issues, monitoring network
activity, and identifying potential security risks.
windows
NSLOOKUP:
Nslookup is a command-line tool used to query DNS (Domain Name System) servers and display
information about domain names, IP addresses, and mail servers. It's a useful tool for
troubleshooting DNS issues, verifying domain information, and debugging network connectivity
problems
WINDOWS:
import subprocess
import re
import os
def ping_host():
try:
if packets_info_windows:
if rtt_info_windows:
else:
else:
except subprocess.CalledProcessError as e:
print("Ping command failed. Please check the hostname or IP address and try
again.")
except Exception as e:
ping_host()
Result:
The basic network commands has been studied, executed in Windows and Linux.