Networking commands in Linux Assignment
Execute the following commands and write their output
- ping:
This command is used to test connectivity between two nodes. Ping use ICMP (Internet ControlMessageProtocol)tocommunicatetootherdevices.Youcanpinghostnameoripaddressusingbelowcommand.
example:ping201.54.100.1orpingwww.google.com
2.hostname
Gives the host name of the computer they are logged into. To set the hostname permanentlyuse/etc/sysconfig/network file.
3.traceroute
traceroute isanetworktroubleshootingutilitythatshows the numberofhopstakentoreach the destination and alsodetermines the packettravelingpath.
4.netstat
Netstat (Network Statistic) command displays interfaces,connection information, routingtable informationetc.
Executeitwiththefollowingoptions andwritetheoutput:
netstat tnetstat s tnetstat -i
5.ifconfig
ifconfigisusedfordisplayingnetworkinterfaceinformation.
6.who
Displaysinformationofalluserswhoareloggedin
7.whoami
The whoami command writes the user name (i.e., login name) of the owner of the currentloginsession to standardoutput.
8.nmap
Networkmappertooltodiscoverhostsandservicesona computernetwork.
9.tcpdump
Tcpdumpprintsoutadescriptionofthecontentsofpacketsonanetworkinterface thatmatch the boolean expression; the description is preceded by a time stamp, printed, bydefault, ashours,minutes,seconds,and fractionsofa secondsincemidnight.
SampleoutputforARPprotocol:
arpwho-has128.3.254.6tell128.3.254.68
arpreply128.3.254.6is-at02:07:01:00:01:c4