What are common networking commands?

0188

Here are some common networking commands used in the terminal to manage and troubleshoot network connections:

Basic Networking Commands:

  1. ping:

    • Tests connectivity to a host by sending ICMP echo requests.
    ping example.com           # Ping a website
  2. ifconfig (or ip a):

    • Displays network interface configuration (use ip a for modern systems).
    ifconfig                   # Show network interfaces and their configurations
    ip a                       # Show network interfaces using the ip command
  3. netstat:

    • Displays network connections, routing tables, and interface statistics.
    netstat -tuln              # Show listening ports and their status
  4. traceroute (or tracert on Windows):

    • Traces the route packets take to a network host.
    traceroute example.com     # Trace the route to a website
  5. nslookup:

    • Queries the DNS to obtain domain name or IP address mapping.
    nslookup example.com       # Get the IP address of a domain

Advanced Networking Commands:

  1. curl:

    • Transfers data from or to a server using various protocols (HTTP, FTP, etc.).
    curl http://example.com    # Fetch the content of a webpage
  2. wget:

    • Downloads files from the web.
    wget http://example.com/file.zip  # Download a file
  3. ssh:

    • Securely connects to a remote server via SSH.
    ssh user@example.com       # Connect to a remote server
  4. scp:

    • Securely copies files between hosts on a network.
    scp localfile.txt user@example.com:/path/to/destination/  # Copy a file to a remote server
  5. iptables:

    • Configures the Linux kernel firewall.
    sudo iptables -L           # List current firewall rules

Network Troubleshooting Commands:

  1. dig:

    • Performs DNS lookups and displays detailed information.
    dig example.com            # Get DNS information for a domain
  2. route:

    • Displays or modifies the IP routing table.
    route -n                   # Show the routing table
  3. hostname:

    • Displays or sets the system's hostname.
    hostname                   # Show the current hostname

Additional Useful Commands:

  • whois: Retrieves domain registration information.
  • iperf: Measures network bandwidth between two hosts.

These commands are fundamental for managing and troubleshooting network connections in Linux and other Unix-like operating systems. If you have any specific commands you'd like to learn more about, feel free to ask!

0 Comments

no data
Be the first to share your comment!