Experiment No.1 Aim: Fundamentals of Computer Network.: 1.ifconfig Command

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Shubham Saroj A-08

EXPERIMENT NO.1
Aim: Fundamentals of Computer Network.
• Understanding the basic networking commands i.e. ifconfig ,ip,
traceroute, tracepath, ping, netstat, ss, dig, nslookup, route, host, arp,
hostname, curl or wget, mtr, whois, tcpdump.
Requirements: PC, NS 2 so@ware.
Objec;ve:
• A@er compleBon of this experiment you will be able to be familiar with
various types of computer networking commands.

Program and Program Outcomes:


1.ifconfig command
ifconfig is used to configure the kernel-resident network interfaces. It is used at
boot Bme to set up interfaces as necessary. A@er that, it is usually only needed
when debugging or when system tuning is needed. If no arguments are given,
ifconfig displays the status of the currently acBve interfaces. If a single interface
argument is given, it displays the status of the given interface only; if a single -a
argument is given, it displays the status of all interfaces, even those that are
down. Otherwise, it configures an interface.
Syntax:
ifconfig
Shubham Saroj A-08

2.traceroute command
Tracer out command in Linux prints the route that a packet takes to reach
thehost. This command is useful when you want to know about the route and
all the hops that a packet takes.
Syntax:
traceroute host_address

3.tracepath command
The tracepath command in Linux allows to trace the path to the desBnaBon
path determining MTU along this path using UDP port or any other ports that
will not require any superuser permissions.
Syntax:
tracepath host_address
Shubham Saroj A-08

4.ping command
PING (Packet Internet Groper) command is used to check the network
connecBvity between host and server/host. This command takes as input the IP
address or the URL and sends a data packet to the specified address with the
message “PING” and get a response from the server/host this Bme is recorded
which is called latency. Fast ping low latency means faster connecBon. Ping
uses ICMP(Internet Control Message Protocol) to send an ICMP echo
message to the specified host if that host is available then it sends ICMP reply
message. Ping is generally measured in millisecond every modern operaBng
system has this ping pre-installed.
Syntax:
ping IP address/host_name:
Example:
ping google.com
Shubham Saroj A-08


5.Netstat Command:
In compuBng, netstat is a command-line network uBlity that displays network
connecBons for Transmission Control Protocol, rouBng tables, and a number of
network interface and network protocol staBsBcs.
Stands for: Network staBsBcs
FuncBon: Print network connecBons, rouBng tables, interface staBsBcs,
masquerade connecBons, and mulBcast memberships
Syntax:
netstat [address_family_opBons] [--tcp|-t] [--udp|-u] [--raw|-w] [--listening|-l]
[--all|-a] [--numeric|-n] [--numeric-hosts][--numeric-ports][--numeric-ports] [--
symbolic|-N] [--extend|-e[--extend|-e]] [--Bmers|-o] [--program|-p] [--
verbose|-v] [--conBnuous|-c] [delay]
Example:
netstat
Shubham Saroj A-08
Shubham Saroj A-08

6.ss command
Linux ss command is the replacement for netstat command. It is regarded as a
much faster and more informaBve command than netstat.

The faster response of ss is possible as it fetches all the informaBon from within
the kernel userspace. This command gives informaBon about all TCP, UDP, and
UNIX socket connecBons.

You can use -t, -u, -x in the command respecBvely to show TCP/UDP or UNIX
sockets. You can combine each of these with "a" to show the connected and
listening sockets.

Syntax:
ss
Shubham Saroj A-08
Shubham Saroj A-08

7.dig command
Linux dig command stands for Domain InformaBon Groper. This command is
used in DNS lookup to query the DNS name server. It is also used to
troubleshoot DNS related issues.

It is mainly used to verify DNS mappings, MX Records, host addresses, and all
other DNS records for a be_er understanding of the DNS topography.

This command is an improvised version of nslookup command.

Syntax:

dig IP address/host_name/path

8.nslookup command
nslookup (stands for “Name Server Lookup”) is a useful command for ge`ng
informaBon from DNS server. It is a network administraBon tool for querying
the Domain Name System (DNS) to obtain domain name or IP address mapping
or any other specific DNS record. It is also used to troubleshoot DNS related
problems.
Syntax:
Shubham Saroj A-08

nslookup [opBons] i.e. nslookup host_address

9.route command
Linux route command displays and manipulates the rouBng table exisBng for
your system. A router is basically used to find the best way to send the packets
across to a desBnaBon.

Syntax:
route
Shubham Saroj A-08

10. host command


Linux host command displays the domain name for a given IP address and IP
address for a given hostname. It is also used to fetch DNS lookup for DNS
related query.

We can combine the host command with -t, and get DNS resource records like
SOA, NS, A, PTR, CNAME, MX, SRV.

Syntax:

host IP address/host_address

11. arp command


arp command manipulates the System’s ARP cache. It also allows a complete
dump of the ARP cache. ARP stands for Address ResoluBon Protocol. The
primary funcBon of this protocol is to resolve the IP address of a system to its
mac address, and hence it works between level 2(Data link layer) and level
3(Network layer).

Syntax:

arp
Shubham Saroj A-08

12. iwconfig command


Linux iwconfig is used to configure the wireless network interface. It is used to
set and view the basic WI-FI details like SSID and encrypBon. To know more
about this command, refer to the man page.
Syntax:
iwconfig

13. hostname command


Linux hostname command allows us to set and view the hostname of the
system. A hostname is the name of any computer that is connected to a
network that is uniquely idenBfied over a network. In simple words, hostname
is the simple command used to view and set the hostname of a system.
Syntax:
hostname
Shubham Saroj A-08

14. curl & wget command


Linux curl and wget commands are used in downloading files from the internet
through CLI. The curl command has to be used with the opBon "O" to fetch the
file, while the wget command is used directly.

Syntax:
wget <fileLink>
Shubham Saroj A-08

15. mtr command


Linux mtr command is a combinaBon of ping and the traceroute command. It
conBnuously displays informaBon regarding the packets sent with the ping
Bme of each hop. It is also used to view the network issues.
Syntax:
mtr IP address/host_name/path

16. whois command


whois command in Linux to find out informaBon about a domain, such as the
owner of the domain, the owner’s contact informaBon, and the nameservers
that the domain is using. In simple words, whois command is used to fetch all
the informaBon related to a website.
Syntax:
whois IP address/host_name/path
Shubham Saroj A-08


Shubham Saroj A-08

17. ifplugstatus command


Linux ifplugstatus command is used to check if a cable is plugged into the
network interface. This command is not directly available on Ubuntu. You can
install this using the command below:
Command:

sudo apt-get install ifplugd


Syntax:
ifplugstatus
Shubham Saroj A-08

18. tcpdumb command


tcpdump is a most powerful and widely used command-line packets sniffer or
package analyser tool which is used to capture or filter TCP/IP packets that
received or transferred over a network on a specific interface.
In simple words, it captures the traffic that is passing through the network
interface and displays it.
Syntax:
tcpdumb –D

19. ip command
The ip command is a powerful tool for configuring network interfaces that any
Linux system administrator should know. It is used to bring interfaces up or
down, assign and remove addresses and routes, manage ARP cache, and much
more.
This is the latest and updated version of ifconfig command.
Syntax:
ip [ OPTIONS ] OBJECT { COMMAND | help }
Example:
To display a list of all network interfaces and the associated ip address type the
following command:
ip addr show
Shubham Saroj A-08

Command:
Ip -4 addr

Command:
Ip -6 addr
Shubham Saroj A-08

Conclusion:
Thus we have studied the use of different basic networking commands.
Lab Outcome:
Execute and evaluate network administraBon commands and demonstrate
their use in different network scenarios.

You might also like