blog
  • Blogs
    • Medium Articles
      • Linux
        • 40 Powerful Linux Networking Commands You Must Know.
        • These (Linux) VI Editor Shortcuts You Must Know
        • Bash/Linux Interview Questions for DevOps Engineers
        • Page 1
      • Git
        • 40 Powerful Git Commands Every Developer Should Know
        • 10 Git Best Practices That Every Developer Must Know
      • DevOps/SRE Interview Questions and Answers
        • Top DevOps/SRE Interview Questions and Answers on AWS VPC
        • Top 10 Common DevOps/SRE Interview Questions and Answers on Terraform Best Practices
        • Top 10 Common DevOps/SRE Interview Questions and Answers on Kubernetes Best Practices
        • Top 10 Common DevOps/SRE Interview Questions and Answers on Dockerfiles
        • Top 10 Common DevOps/SRE Interview Questions and Answers on Grafana
      • Installation
        • Docker Installation on Ubuntu 20/22
        • Install WireGuard VPN on Docker Compose
        • Install Redis on Docker Compose
        • Gravitee Docker Compose
      • Kubernetes Series 2025
        • Understanding Kubernetes: Part 1 -Control Plane
        • Understanding Kubernetes: Part 2 -Worker Node
        • Understanding Kubernetes: Part 3 -Pod
        • Understanding Kubernetes: Part 4-ReplicaSets
        • Understanding Kubernetes: Part 5 -Deployment
        • Understanding Kubernetes: Part 6 -DaemonSets
        • Understanding Kubernetes: Part 7 -StatefulSet
        • Understanding Kubernetes: Part 8 -ConfigMap
        • Understanding Kubernetes: Part 9 -Kubernetes Secret
        • Understanding Kubernetes: Part 10 -StorageClass
        • Understanding Kubernetes: Part 11 -Persistent Volume (PV)
        • Understanding Kubernetes: Part 12 -Persistent Volume Claim (PVC)
        • Understanding Kubernetes: Part 13 -Services
        • Understanding Kubernetes: Part 14 -ClusterIP Service
        • Understanding Kubernetes: Part 15 -NodePort Service
        • Understanding Kubernetes: Part 16 -Load Balancer Service
        • Understanding Kubernetes: Part 17 -Ingress
        • Understanding Kubernetes: Part 18 -Ingress Controller
        • Understanding Kubernetes: Part 19 -Headless Service
        • Understanding Kubernetes: Part 20-Network Policy
        • Understanding Kubernetes: Part 21 -CNI
        • Understanding Kubernetes: Part 22 Kubernetes Resource Requests & Limits
        • Understanding Kubernetes: Part 23 Node Selector
        • Understanding Kubernetes: Part 24 Taints and Tolerations
        • Understanding Kubernetes: Part 25 Affinity and Anti-Affinity
        • Understanding Kubernetes: Part 26 Preemption and Priority
        • Understanding Kubernetes: Part 27 Role and RoleBinding
        • Understanding Kubernetes: Part 28 ClusterRole and ClusterRoleBinding
        • Understanding Kubernetes: Part 29 Service Account
        • Understanding Kubernetes: Part 30 Horizontal Pod Autoscaler (HPA)
        • Understanding Kubernetes: Part 31 Vertical Pod Autoscaler (VPA)
        • Understanding Kubernetes: Part 33 Startup Probe
        • Understanding Kubernetes: Part 34 Liveness Probe
        • Understanding Kubernetes: Part 35 Readiness Probe
        • Understanding Kubernetes: Part 36 Container Network Interface (CNI)
        • Understanding Kubernetes: Part 37 Container Runtime Interface (CRI)
        • Understanding Kubernetes: Part 38 Container Storage Interface (CSI)
      • Cloudflare
        • Cloudflare Tunnel for Secure HTTP Routing
      • Nginx
        • Nginx use cases that every engineer must know
Powered by GitBook
On this page
  • Basic Network Information 🌐
  • 1. ifconfig
  • 2. ip
  • 3. route
  • 4. hostname
  • 5. hostnamectl
  • Testing Network Connectivity 🔍
  • 6. ping
  • 7. traceroute
  • 8. mtr
  • 9. fping
  • DNS and Name Resolution 🌍
  • 10. dig
  • 11. nslookup
  • 12. host
  • 13. resolvconf
  • Monitoring Network Connections 📈
  • 14. netstat
  • 15. ss
  • 16. lsof
  • 17. iftop
  • 18. nload
  • Managing Network Interfaces and Routes 🔧
  • 19. iptables
  • 20. iptraf
  • 21. ethtool
  • 22. arp
  • 23. iwconfig
  • 24. nmcli
  • 25. nmtui
  • Data Transfer and Remote Access 🔒
  • 26. scp
  • 27. wget
  • 28. curl
  • 29. telnet
  • 30. nc (netcat)
  • 31. ssh-keygen
  • Security and Diagnostics 🔐
  • 32. tcpdump
  • 33. nmap
  • 34. iperf
  • 35. sshd
  • Additional Commands for Network Management ️
  • 36. route add
  • 37. route del
  • 38. ss -s
  1. Blogs
  2. Medium Articles
  3. Linux

40 Powerful Linux Networking Commands You Must Know.

PreviousLinuxNextThese (Linux) VI Editor Shortcuts You Must Know

Last updated 5 months ago

Linux networking commands are foundational for effective network management and troubleshooting, particularly in roles like DevOps and Site Reliability Engineering (SRE). This guide introduces 50 essential Linux commands, each designed to make network troubleshooting, monitoring, and configuration straightforward. Mastery of these commands can help you swiftly diagnose network issues, monitor bandwidth, and configure complex network setups with confidence.

Basic Network Information 🌐

These commands help you quickly access network configuration details.

1. ifconfig

  • Displays network interface information.

  • Example: ifconfig

2. ip

  • Shows or manipulates IP addresses, routing, and network devices.

  • Example: ip address show

3. route

  • Displays or modifies the IP routing table, useful for managing traffic routes.

  • Example: route -n

4. hostname

  • Shows or sets the system’s hostname.

  • Example: hostname

5. hostnamectl

  • Controls hostname settings and provides status info.

  • Example: hostnamectl status

Testing Network Connectivity 🔍

Use these commands to verify connectivity to other hosts and test network routes.

6. ping

  • Sends packets to a host to check connectivity and response times.

  • Example: ping google.com

7. traceroute

  • Traces the path packets take to a host, helping identify delays or connectivity issues.

  • Example: traceroute google.com

8. mtr

  • Combines ping and traceroute functionalities, offering real-time network diagnostics.

  • Example: mtr google.com

9. fping

  • Pings multiple hosts quickly, useful for network discovery.

  • Example: fping -a -g 192.168.1.1 192.168.1.254

DNS and Name Resolution 🌍

These commands assist with domain name resolution and troubleshooting DNS issues.

10. dig

  • Performs DNS lookups, showing detailed information about domain names.

  • Example: dig google.com

11. nslookup

  • Interactively queries Internet name servers.

  • Example: nslookup google.com

12. host

  • Another utility for DNS lookups.

  • Example: host google.com

13. resolvconf

  • Manages DNS information and updates settings.

  • Example: resolvconf -u

Monitoring Network Connections 📈

These commands provide insights into network traffic and open connections on your system.

14. netstat

  • Displays network connections, routing tables, and interface statistics.

  • Example: netstat -an

15. ss

  • Displays socket statistics, a faster alternative to netstat.

  • Example: ss -tulpn

16. lsof

  • Lists open files, showing which files are being accessed over the network.

  • Example: lsof -i :80

17. iftop

  • Monitors bandwidth usage in real-time, visualizing data usage per interface.

  • Example: iftop

18. nload

  • Visualizes incoming and outgoing network traffic.

  • Example: nload

Managing Network Interfaces and Routes 🔧

Use these commands to configure network interfaces, routing tables, and traffic flow.

19. iptables

  • Tool for packet filtering and NAT configuration, used for firewall setup.

  • Example: iptables -L

20. iptraf

  • An interactive network monitor, perfect for live traffic analysis.

  • Example: iptraf

21. ethtool

  • Displays or modifies settings on Ethernet devices.

  • Example: ethtool eth0

22. arp

  • Shows or modifies the Address Resolution Protocol (ARP) cache.

  • Example: arp -a

23. iwconfig

  • Configures wireless network interfaces.

  • Example: iwconfig

24. nmcli

  • A command-line client for NetworkManager, used to manage connections.

  • Example: nmcli connection show

25. nmtui

  • Text-based interface for NetworkManager, making it easy to manage network settings.

  • Example: nmtui

Data Transfer and Remote Access 🔒

These tools help transfer data and manage files across remote systems securely.

26. scp

  • Securely copies files between hosts.

  • Example: scp file.txt user@remote:/path

27. wget

  • Downloads files from the internet non-interactively.

28. curl

  • Transfers data to and from servers, great for testing APIs.

29. telnet

  • Connects to other systems using the TELNET protocol.

  • Example: telnet google.com 80

30. nc (netcat)

  • Utility for creating arbitrary TCP and UDP connections.

  • Example: nc -l 8080

31. ssh-keygen

  • Generates and manages SSH authentication keys.

  • Example: ssh-keygen -t rsa

Security and Diagnostics 🔐

Monitor network security, troubleshoot issues, and gather diagnostic information.

32. tcpdump

  • Captures network packets for analysis.

  • Example: tcpdump -i eth0

33. nmap

  • Scans networks for open ports and vulnerabilities.

  • Example: nmap -sP 192.168.1.0/24

34. iperf

  • Measures TCP and UDP bandwidth performance, useful for network performance testing.

  • Example: iperf -c server_ip

35. sshd

  • Manages the SSH daemon for secure remote access.

  • Example: service sshd restart

Additional Commands for Network Management ️

These commands cover specific scenarios, from adding routes to checking system stats.

36. route add

  • Adds a new route to the routing table.

  • Example: route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.1.1

37. route del

  • Deletes a route from the routing table.

  • Example: route del -net 192.168.2.0 netmask 255.255.255.0

38. ss -s

  • Shows summary of socket statistics.

  • Example: ss -s

These 40 commands provide a solid foundation for effective Linux network management, empowering you to quickly identify and resolve network issues, monitor performance, and configure network settings across multiple systems. By integrating these tools into your troubleshooting process, you’ll be better equipped to maintain reliable and secure network infrastructure.

💬 If you have any suggestions or questions, please leave a comment below! 👏 If you found this article helpful, feel free to give it a clap and share it with your friends.

Feel free to connect, and let’s continue the conversation!😊

Thank you! 🙏

Example: wget

Example: curl

YouTube:

LinkedIn:

Instagram:

·

DevOps | SRE | Carrers | Cloud | AI | Software Automation

http://example.com/file.zip
http://example.com/api
Techwithpatil
Tech with Patil
techwithpatil
https://techwithpatil.com
Written by techwithpatil
150 Followers
259 Following