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 Control Message Protocol) to communicate to other devices. You can ping host name or ip address using below command.
example: ping 201.54.100.1 or ping www.google.com
2. hostname
Gives the host name of the computer they are logged into. To set the hostname permanently use /etc/sysconfig/network file.
3. traceroute
traceroute is a network troubleshooting utility that shows the number of hops taken to reach the destination and also determines the packet traveling path.
4. netstat
Netstat (Network Statistic) command displays interfaces, connection information, routing table information etc.
Execute it with the following options and write the output:
netstat –t netstat –s –t netstat -i
5. ifconfig
ifconfig is used for displaying network interface information.
6. who
Displays information of all users who are logged in
7. whoami
The whoami command writes the user name (i.e., login name) of the owner of the current login session to standard output.
8. nmap
Network mapper tool to discover hosts and services on a computer network.
9. tcpdump
Tcpdump prints out a description of the contents of packets on a network interface that match the boolean expression; the description is preceded by a time stamp, printed, by default, as hours, minutes, seconds, and fractions of a second since midnight.
Sample output for ARP protocol:
arp who-has 128.3.254.6 tell 128.3.254.68
arp reply 128.3.254.6 is-at 02:07:01:00:01:c4