0Pricing
Linux Command Line Mastery · Lezione

Introduzione ai comandi di rete: `ping`, `ip`, `netstat`

Esplori i comandi di base per verificare la connettività di rete e visualizzare la configurazione della rete.

Introduzione ai comandi di rete: `ping`, `ip`, `netstat` è una lezione Linux Command Line Mastery gratuita su CoddyKit. Questa è la lezione 2 di 4. Puoi leggere la lezione completa qui gratuitamente — poi esercitati direttamente nel browser con un editor di codice integrato e un tutor IA disponibile 24/7. Fa parte del percorso di apprendimento Linux Command Line Mastery, e i tuoi progressi si sincronizzano tra il web e l'app CoddyKit. Il corso Linux Command Line Mastery include 4 lezioni in totale.

Parti di questa lezione non sono ancora state tradotte e vengono mostrate in inglese.

Intro to Network Commands

Welcome to this lesson on essential Linux networking commands! Understanding these tools is crucial for diagnosing network issues and viewing your system's network configuration.

We'll explore ping for checking connectivity, ip for comprehensive network interface management, and netstat for viewing active connections.

What is Ping?

The ping command is a fundamental tool used to test the reachability of a host on an Internet Protocol (IP) network. It sends small data packets to a target and waits for a response.

  • Purpose: Check if a remote computer or server is online.
  • Measurement: Calculates the Round-Trip Time (RTT) for packets to reach the host and return.
  • Analogy: Think of it like a sonar pulse for your network!

Ping Your Network

Let's try using ping to check connectivity to a well-known website. The command will send continuous pings until you stop it (usually with Ctrl+C).

Observe the output: the time it takes for packets to return and the 'TTL' (Time To Live) value, which indicates how many 'hops' the packet can make before being discarded.

ping google.com

Ping Options: Limiting Pings

Sometimes you don't need continuous pings. The -c option allows you to specify the number of echo requests to send.

This is useful for a quick check without having to manually stop the command. After sending the specified number of packets, ping will provide a summary.

ping -c 4 google.com

Meet the `ip` Command

The ip command is a modern and powerful utility for showing or manipulating routing, network devices, interfaces, and tunnels. It's designed to replace older tools like ifconfig and route.

ip is versatile, with many subcommands for different tasks. We'll look at ip addr for addresses and ip route for routing information.

Your IP Address with `ip addr`

To view the IP addresses assigned to your network interfaces, you use the ip addr show (or simply ip a) subcommand.

  • lo: The loopback interface (127.0.0.1), used for communication within the same machine.
  • eth0/wlan0: Your primary wired (Ethernet) or wireless interface.

Look for the inet lines to find your IPv4 addresses.

ip addr show

Network Routes with `ip route`

The ip route show command displays your system's routing table. The routing table tells your computer how to send network traffic to different destinations.

A key entry is the default via route, which indicates your default gateway – the router your computer uses to send traffic to the internet or other networks it doesn't know directly.

ip route show

What is Netstat?

netstat (network statistics) is a command-line tool that displays network connections (both incoming and outgoing), routing tables, and a number of network interface statistics.

While ip is often preferred for configuration, netstat remains useful for quickly checking what services are listening on your machine and what connections are established.

Active Connections with `netstat`

To see active network connections and listening ports, you can use netstat with several options:

  • -t: Show TCP connections.
  • -u: Show UDP connections.
  • -l: Show only listening sockets.
  • -p: Show the PID/program name owning the socket.
  • -n: Show numerical addresses instead of trying to resolve hostnames.

Combining these, netstat -tulpn gives a comprehensive view.

netstat -tulpn

Network Command Challenge

Test your understanding of the networking commands we've covered.

Recap: Network Basics

Great job! In this lesson, you've gained an introduction to fundamental Linux networking commands:

  • ping: For testing host reachability and measuring round-trip time.
  • ip: A powerful, modern tool for viewing and configuring network interfaces and routing tables.
  • netstat: Useful for displaying active network connections and listening ports.

Keep practicing these commands to become more comfortable with network diagnostics!

Domande Frequenti

La lezione «Introduzione ai comandi di rete: `ping`, `ip`, `netstat`» è gratuita?

Sì — il testo completo di «Introduzione ai comandi di rete: `ping`, `ip`, `netstat`» è gratuito qui sul web. Per esercitarvi in modo interattivo (un editor di codice integrato e un tutor IA 24/7) e sbloccare il resto del corso Linux Command Line Mastery, passa a CoddyKit PRO. Il corso Linux Command Line Mastery include 4 lezioni in totale.

Cosa imparerò in «Introduzione ai comandi di rete: `ping`, `ip`, `netstat`»?

Esplori i comandi di base per verificare la connettività di rete e visualizzare la configurazione della rete. Eserciti Linux Command Line Mastery con codice pratico che esegui direttamente nel browser, e un tutor IA 24/7 risponde alle tue domande mentre lavori sulla lezione.

Ho bisogno di esperienza per iniziare Linux Command Line Mastery?

Non è richiesta alcuna esperienza precedente. Linux Command Line Mastery su CoddyKit è strutturato per principianti e studenti avanzati, quindi puoi iniziare da qui o dall'inizio e procedere al tuo ritmo. Questa è la lezione 2 di 4.

Quanto tempo richiede la lezione «Introduzione ai comandi di rete: `ping`, `ip`, `netstat`»?

La maggior parte delle lezioni CoddyKit richiede circa 5–10 minuti. Ogni lezione è breve e interattiva, quindi fai progressi costanti e riprendi esattamente da dove hai lasciato su web e app.

Posso scrivere ed eseguire codice in questa lezione Linux Command Line Mastery?

Sì. Ogni lezione Linux Command Line Mastery include un editor di codice integrato, quindi scrivi ed esegui codice reale direttamente nel tuo browser e ricevi feedback istantaneo dall'IA — nessuna configurazione locale necessaria.

Tutte le lezioni di questo corso

  1. Gestione di utenti e gruppi: `useradd`, `usermod`, `groupadd`
  2. Introduzione ai comandi di rete: `ping`, `ip`, `netstat`
  3. Accesso remoto sicuro: `ssh` e `scp`
  4. Permessi e proprietà dei file con chmod e chown
← Torna a Linux Command Line Mastery