Ex - No: 1 Study of Basic Network Commands
Ex - No: 1 Study of Basic Network Commands
Ex - No: 1 Study of Basic Network Commands
Aim: To learn to use basic network commands like tcpdump, netstat, ifconfig, nslookup and
traceroute.
Basic commands:
1. ifconfigCommand:
ifconfig in short “interface configuration” utility for system/network administration in
Unix/Linux operating systems to configure, manage and query network interface parameters via
command line interface or in a system configuration scripts.
The “ifconfig” command is used for displaying current network configuration information, setting
up an ip address, netmask or broadcast address to an network interface, creating an alias for network
interface, setting up hardware address and enable or disable network interfaces.
1. View All Network Setting
The “ifconfig” command with no arguments will display all the active interfaces details. The
ifconfig command also used to check the assigned IP address of an server.
[root@tecmint ~]# ifconfig
2. TcpdumpCommand:
tcpdump is a most powerful and widely used command-line packets sniffer or package analyzer tool
which is used to capture or filter TCP/IP packets that received or transferred over a network on a
specific interface. It is available under most of the Linux/Unix based operating systems. tcpdump
also gives us a option to save captured packets in a file for future analysis. It saves the file in a pcap
format, that can be viewed by tcpdump command or a open source GUI based tool
calledWireshark(Network Protocol Analyzier) that reads tcpdumppcap format files.
Commands:
1. Capture Packets from Specific Interface
The command screen will scroll up until we interrupt and when we execute tcpdump command it
will captures from all the interfaces, however with -i switch only capture from desire interface.
# tcpdump -i eth0
# tcpdump -c 5 -i eth0
# tcpdump -A -i eth0
# tcpdump -D
3. netstat Command:
netstat (network statistics) is a command line tool for monitoring network connections both
incoming and outgoing as well as viewing routing tables, interface statistics etc. netstat is available
on all Unix-like Operating Systems and also available on Windows OS as well. It is very useful in
terms of network troubleshooting and performance measurement. netstat is one of the most basic
network service debugging tools, to tell what ports are open and whether any programs are listening
on ports.
4. nslookupCommand:
nslookup is a command-line administrative tool for testing and troubleshooting DNS servers
(Domain Name Server). It is used to query specific DNS resource records (RR) as well. Most
operating systems comes with built-in nslookup feature.
5. TRACEROUTE Command:
traceroute is a network troubleshooting utility which shows number of hops taken to reach
destination also determine packets traveling path. Below we are tracing route to global DNS server
IP Address and able to reach destination also shows path of that packet is traveling.
# traceroute 4.2.2.2
Result:
Thus the basic network commands were studied and executed.