Linux Networking Commands: Part 3

Linux Networking Commands: Part 3

In this part of our Linux learning series, I'll cover essential networking commands.

In this part of our Linux learning series, These commands will help you diagnose network issues, configure network interfaces, and interact with network services. Each command is explained with practical examples to help you understand and apply them.

1. ping

The ping command checks the connectivity between your system and a remote server by sending ICMP Echo Request packets.

ping google.com

2. netstat

The netstat command displays network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.

sudo apt install net-tools
netstat

3. ifconfig

The ifconfig command configures a network interface. It's used to view and change the configuration of network interfaces.

ifconfig

4. Traceroute vs Tracepath

Both traceroute and tracepath are used to trace the path packets take to a network host.

sudo apt-get update
sudo apt install traceroute inetutils-traceroute
traceroute youtube.com
tracepath youtube.com

5. mtr

The mtr command combines the functionality of traceroute and ping to provide detailed information about the network path to a host.

mtr youtube.com

6. nslookup

The nslookup command queries Internet name servers interactively. It’s used to find the IP address associated with a domain name.

nslookup youtube.com

7. telnet

The telnet command is used for interactive communication with another host using the TELNET protocol.

telnet youtube.com

8. hostname

The hostname command shows or sets the system's hostname.

hostname
cat /etc/hosts

9. ip

The ip command is used to show and manipulate routing, devices, policy routing, and tunnels.

ip address show

10. iwconfig

The iwconfig command is used to configure wireless network interfaces.

iwconfig

11. ss

The ss command dumps socket statistics. It's used to get detailed information about how the system is communicating with other machines.

ss

12. arp

The arp command manipulates or displays the kernel's IPv4 network neighbor cache.

arp

13. dig

The dig command is a flexible tool for interrogating DNS name servers.

dig youtube.com

14. nc (netcat)

The nc command is a versatile networking tool that can be used for network debugging and investigation.

nc youtube.com

15. whois

The whois command queries the WHOIS database for information about domain registration.

whois google.com

16. ifplugstatus

The ifplugstatus command checks the link status of a network cable.

ifplugstatus

17. route

The route command shows/manipulates the IP routing table.

route

18. nmap

The nmap command is a network exploration tool and security/port scanner.

nmap youtube.com

19. wget

The wget command retrieves files from the web.

wget https://filesamples.com/samples/document/docx/sample4.docx

20. watch

The watch command runs a program periodically, showing its output in fullscreen.

watch mtr trainwithshubham.com
watch -n 5 top

21. iptables

The iptables command is used to set up, maintain, and inspect the tables of IP packet filter rules in the Linux kernel.

sudo iptables --list-rules

22. curl

The curl command transfers data from or to a server, using one of the supported protocols (HTTP, FTP, IMAP, etc.).

curl -X GET https://dummy.restapiexample.com/api/v1/employees

23. jq

The jq command is used to process JSON. It’s a lightweight and flexible command-line JSON processor.

curl -X GET https://dummy.restapiexample.com/api/v1/employees | jq

By familiarizing yourself with these commands, you can effectively manage and troubleshoot your Linux network environment.