Computers are often connected to each on a network. They send request to each other in form of packets that travels from the host to destination. Linux provides various commands from network configuration and trouble-shooting.
Here are the list of important commands:
- Ping(Packet Internet Groper)
ping command is used to ensure that a computer can communicate to a specified device over the network. ping command sends Internet Control Message Protocol(ICMP) Echo request messages in the form of packets to the destination computer and waits inorder to get the response back. Once the packets are received by the destined computer, it starts sending the packets back. This commands keeps executing util it si interrupted.
ping command provides the details such as
- number of packets transmitted
- number of packets received
- time taken by the packet to return
ping command in generally used for the following purposes:
- measuring the time taken by the packets to return to determine speed of the connection
- to make sure that the network connection between host and the destined computer can be established
nslookup command queries the DNS in order to fetch the IP address or the domain name from DNS records.
This command is used to get the route of a packet. In other words, traceroute command is used to determine the path along which a packet travels. It also return the number of hops taken by the packet to reach the destination. This command prints to the console, a list of hosts through which the packet travels in order to the destination.
Image source: Google Images
netstat(Network Statistics) is the command that is used to display routing table, connection information, status of ports, etc. This command works with Linux Network Subsystem. This command basically displays the content of /proc/net file defined in linux file file system.
ARP(Address Resolution Protocol) command is used to display and modify ARP cache, that contains the mapping of IP address to MAC address. The system’s TCP/IP stack uses ARP in order to determine MAC address associated with an IP address.
ifconfig(Interface Configuration) is a utility in operating system that is used to set or display the IP address and netmask of a network interface. It also provides commands to enable or disable an interface. Many UNIX-like operating system initializes their network interfaces using ifconfig at boot time. ifconfig is also used to view the MTU(Maximum transmission unit).
This article is contributed by Mayank Kumar. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Computer Network | EIGRP Configuration
- Computer Network | AAA (authentication) configuration (locally)
- Linux Commands
- Fun Commands in Linux
- Computer Network | Zone-based firewall (Configuration)
- Computer Network | Basic configuration of adaptive security appliance (ASA)
- Computer Network | Dynamic Host Configuration Protocol (DHCP)
- Essential Linux/Unix Commands
- Custom commands for linux terminal
- Daily life Linux Commands
- Basic Linux Commands for day to day life
- Basic Shell Commands in Linux
- Internal and External Commands in Linux
- halt, poweroff and reboot Commands in Linux
- Useful and time saving bash commands in Linux