100% found this document useful (1 vote)
2K views

Networks Basic Commands

This document provides an overview of basic network commands including: 1. hostname - Finds host/domain name and IP address 2. ping - Tests network connection 3. ifconfig - Gets network configuration 4. netstat - Shows network connections, routing tables, and interface statistics 5. nslookup - Queries DNS lookups 6. traceroute - Shows the route packets take to reach a network host It then provides more details on commonly used commands like ping, traceroute, and netstat to troubleshoot network issues and view network information.

Uploaded by

Srija Kondru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
2K views

Networks Basic Commands

This document provides an overview of basic network commands including: 1. hostname - Finds host/domain name and IP address 2. ping - Tests network connection 3. ifconfig - Gets network configuration 4. netstat - Shows network connections, routing tables, and interface statistics 5. nslookup - Queries DNS lookups 6. traceroute - Shows the route packets take to reach a network host It then provides more details on commonly used commands like ping, traceroute, and netstat to troubleshoot network issues and view network information.

Uploaded by

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

BASIC NETWOKS COMMONDAS

Finding host/domain name and IP address -hostname

test network connection –ping


getting network configuration –ifconfig
Network connections routing tables, interface statistics – netstat
query DNS lookup name – nslookup
communicate with another hostname – telnet
outing steps that packets take to get to network host – traceroute
view user information –finger
checking status of destination host - telnet

1.ping
Use ping to see if a host is alive. This super simple command helps you check the status of a host or

a network segment. Ping command sends an ICMP ECHO_REQUEST packet to the target host and

waits to see if it replies.

However, some hosts block ICMP echo requests with a firewall. Some sites on the internet may also

do the same.

By default, ping runs in an infinite loop. To send a defined number of packets, use -c flag.
$ ping -c 3 google.com
PING google.com (172.217.167.238): 56 data bytes
64 bytes from 172.217.167.238: icmp_seq=0 ttl=118 time=7.898 ms
64 bytes from 172.217.167.238: icmp_seq=1 ttl=118 time=7.960 ms
64 bytes from 172.217.167.238: icmp_seq=2 ttl=118 time=6.247 ms

--- google.com ping statistics ---


3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 6.247/7.368/7.960/0.793 ms

A failed ping could be due to


•network failure

•host being not alive

•firewall blocking ICMP ECHO requests


2. traceroute
If ping shows missing packets, you should use traceroute to see what route the packets are taking. 

Traceroute shows the sequence of gateways through which the packets travel to reach their

destination. For example, traceroute from my

Machine to google.com shows the following:


$ traceroute google.com
traceroute to google.com (172.217.167.46), 64 hops max, 52 byte packets
1 dlinkrouter.dlink (192.168.0.1) 5.376 ms 2.076 ms 1.932 ms
2 10.194.0.1 (10.194.0.1) 5.190 ms 5.125 ms 4.989 ms
3 broadband.actcorp.in (49.207.47.201) 7.165 ms 5.749 ms 5.755 ms
4 broadband.actcorp.in (49.207.47.225) 5.918 ms * 8.483 ms
...

9 108.170.251.97 (108.170.251.97) 6.359 ms

del03s16-in-f14.1e100.net (172.217.167.46) 5.448 ms


108.170.251.97 (108.170.251.97) 6.400 ms

Line 4 in this output shows a * in the round trip times. This indicates no response was
received. This can be due to many reasons – as the traceroute ICMP packets are low-
priority, these may be dropped by a router. Or there could be simply congestion. If you
see a * in all the time fields for a given gateway, then possibly the gateway is down.

3.netstat

Most useful and very versatile for finding a connection to and from the host. You can find out all the
multicast groups (network) subscribed by this host by issuing "netstat -g"

netstat -nap | grep port will display process id of application which is using
that port
netstat -a or netstat –all will displayall connections including TCP and UDP
netstat --tcp or netstat –twill display only TCP connection
netstat --udp or netstat –u will display only UDP connection
netstat -g will display all multicastnetworksubscribed by this host

Here is an example:
$ netstat -i
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-
OVR Flg
eth0 1500 0 4001 0 0 0 2283 0 0
0 BMRU
eth1 1500 0 27154 0 0 0 838962 0 0
0 BMRU
lo 65536 0 0 0 0 0 0 0 0
0 LRU

Copy
Using-r flag will display the routing table. This shows the path configured for sending network

packets.
$ netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt
Iface
default 10.0.2.2 0.0.0.0 UG 0 0 0
eth0
10.0.0.0 * 255.255.255.0 U 0 0 0
eth1
10.0.2.0 * 255.255.255.0 U 0 0 0
eth0

Copy
An asterisk in the last two lines indicates that no gateway is required to send packets to any host on

these networks. This host is directly connected to the networks 10.0.0.0 and 10.0.2.0.

Inthe first line, the destination is the default, which means any packet destined for a
network not listed in this table is handled by the router 10.0.2,2.
netstat command without any options displays a list of open sockets. Use -I flag to show only

listening sockets, which by default, are not shown. You can use -a flag to show listening and non-

listening sockets.
2. Peer-peer communication

Computer Network Architecture

Peer-To-Peer network

Peer-To-Peer network is a network in which all the computers are linked together with
equal privilege and responsibilities for processing the data.

Peer-To-Peer network is useful for small environments, usually up to 10 computers.

Peer-To-Peer network has no dedicated server.

Special permissions are assigned to each computer for sharing the resources, but this can
lead to a problem if the computer with the resource is down.

Some Examples of Client-Server Architecture


1.BitTorrent (file sharing),
2.Tor (anonymous internet browsing),
3.Bitcoin (a decentralized transaction ledger).
BENEFITS OF P2P NETWORKS
P2P networks offer many benefits compared to the client-server paradigm.

•Cost efficiency: There is no central server or network operating system (NOS) to maintain and pay for,
making P2P economical.

•Low failure rate: There is no single point of failure unless the network is very tiny.

•Robust and agile: P2P networks are highly resistant to changes. If one peer quits, the entire network suffers
little. When many peers join the network simultaneously, the network can easily manage the additional
demand. Additionally, the absence of a centralized server means that P2P networks may withstand attacks
quite effectively due to their decentralized structure.

•Enhanced accessibility: Because the file library is readily accessible, clients may access any file at any
moment.

•Efficient and straightforward retrieval: In P2P networking, the retrieval procedure is uncomplicated. For
example, when a system is abruptly short down or connection is lost during downloads, the network resumes
the download from the point where it was interrupted once the connection is re-established.

3.Client/Server Network

Client/Server network is a network model designed for the end users called clients, to
access the resources such as songs, video, etc. from a central computer known as Server.

The central controller is known as a server while all other computers in the network are
called clients.

A server performs all the major operations such as security and network management.

A server is responsible for managing all the resources such as files, directories, printer,
etc.

All the clients communicate with each other through a server. For example, if client1
wants to send some data to client 2, then it first sends the request to the server for the
permission. The server sends the response to the client 1 to initiate its communication with
the client 2.
Some Examples of Client-Server Architecture
1.Email servers
2. File servers

3.Web servers

You might also like