Come calcolare subnet, CIDR e range IP di una rete
Calcola subnet mask, indirizzo network e broadcast, range host utili, classe IP e scope (privato/pubblico) da IP/CIDR. RFC 4632, RFC 1918, VLSM. Esempi reti aziendali.
Segnala un errore di calcolo
Aiutaci a migliorare. Descrivi cosa non torna nel calcolo.
Risultato
| Voce | Valore |
|---|
Mostra dettagli completi
Condividi risultato
Disclaimer: questo calcolo ha valore puramente indicativo. Per decisioni importanti, consulta un professionista qualificato.
Come calcolare subnet, CIDR e range IP di una rete: data una notazione CIDR (es. 192.168.1.0/24), si calcolano network address, broadcast address, primo e ultimo host utile, subnet mask, totale indirizzi e host utilizzabili. CIDR (Classless Inter-Domain Routing, RFC 4632) sostituisce il sistema "classful" pre-1993 (Classi A/B/C) con prefissi a lunghezza variabile per uso efficiente IPv4. Formula totale indirizzi = 2^(32-prefix), host usabili = totale - 2 (riservando network e broadcast), tranne /31 (point-to-point RFC 3021) e /32 (host singolo). VLSM (Variable Length Subnet Mask) consente subnetting gerarchico. Strumento essenziale per network engineering, sysadmin Cisco/MikroTik/Juniper, configurazione firewall, VLAN, routing, troubleshooting, CCNA/CCNP/CCIE certificazione.
Formule subnetting CIDR
Conversione decimale a binario: ogni ottetto IP (0-255) e' un byte 8 bit. Esempio 192.168.1.0 = 11000000.10101000.00000001.00000000. Subnet mask /24 = 11111111.11111111.11111111.00000000 = 255.255.255.0. AND bit a bit IP & mask = network address. OR con wildcard inverso = broadcast.
Network address: IP & subnet_mask. Bit host (dopo prefisso) tutti a 0. Esempio 192.168.1.50/24: 192.168.1.50 & 255.255.255.0 = 192.168.1.0. Per /25 (subnet più' specifica): 192.168.1.50 & 255.255.255.128 = 192.168.1.0 (stesso) o 192.168.1.128 a seconda IP. Network address NON e' assegnabile a host.
Broadcast address: network | wildcard_mask. Bit host tutti a 1. Per 192.168.1.0/24: broadcast 192.168.1.255. Pacchetti diretti a broadcast raggiungono tutti host della subnet (Layer 2 switch). Broadcast NON e' assegnabile a host. Limited broadcast 255.255.255.255 e' broadcast di tutta la rete locale (DHCP discover).
Host range utilizzabili: da network+1 a broadcast-1. Per /24 (256 indirizzi): 254 host (256 - network - broadcast). Per /16 (65536 indirizzi): 65534 host. Per /23 (512 indirizzi): 510 host (utile per supernetting). Eccezioni RFC 3021: /31 point-to-point usa 2 IP entrambi assegnabili (router-router); /32 host route singolo (loopback, anycast).
Tabella prefissi CIDR comuni: /8 = 16M IP (una classe A), /16 = 65k IP (classe B intera o /16 ufficio grande), /24 = 256 IP (LAN tipica), /25 = 128 IP, /26 = 64 IP (ufficio piccolo), /27 = 32 IP, /28 = 16 IP (DMZ piccola), /29 = 8 IP (subnet ISP customer), /30 = 4 IP (P2P link), /31 = 2 IP (P2P RFC 3021), /32 = 1 IP (host route).
Storia e contesto
L'IP versione 4 (IPv4) fu standardizzato nel 1981 da Vint Cerf e Bob Kahn (RFC 791) presso DARPA. Sistema iniziale "classful": Classe A (/8 8 milioni IP, 126 reti), Classe B (/16, 65k IP, 16k reti), Classe C (/24, 254 IP, 2 milioni reti). Esaurimento rapido motivo' Classless Inter-Domain Routing (CIDR, RFC 1517-1520, 1993) introducendo prefissi variabili. RFC 1918 (1996, Rekhter et al) riservo' 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 per reti private. RFC 4632 (2006) consolido' standard CIDR. RFC 3021 (2000) /31 point-to-point per risparmio IP. RFC 6598 (2012) Carrier-Grade NAT 100.64.0.0/10. IPv6 (RFC 8200, 2017) sostituisce IPv4 con 128 bit (3,4*10^38 indirizzi); transizione lenta, IPv4 esaurito da IANA 2011 (a livello regionale 2011-2019 ARIN/RIPE/APNIC). Industria networking globale > 350 miliardi USD (Cisco, Juniper, Arista, Huawei). Cisco CCNA/CCNP/CCIE certifica skill subnetting. Italia: Garante Privacy GDPR Art 4(1) IP come dato personale.
Tabella prefissi CIDR e applicazioni
- /8: 16.777.216 indirizzi, 16.777.214 host - classe A intera, ISP tier-1
- /16: 65.536 - 65.534 host - aziende grandi, università'
- /19: 8.192 - 8.190 host - reti grandi enterprise
- /22: 1.024 - 1.022 host - office floor, stadium
- /23: 512 - 510 host - VLAN voce + dati combinata
- /24: 256 - 254 host - LAN classica casa/piccolo ufficio
- /25: 128 - 126 host - dipartimenti
- /26: 64 - 62 host - sala conferenze, IoT zona
- /27: 32 - 30 host - sotto-rete piccola
- /28: 16 - 14 host - DMZ servizi
- /29: 8 - 6 host - subnet pubblica ISP customer
- /30: 4 - 2 host - P2P link router-router
- /31: 2 - 2 host - P2P RFC 3021 (no broadcast)
- /32: 1 - 1 host - loopback, anycast singolare
Esempi numerici dettagliati
Esempio 1 - rete LAN aziendale Milano /24. CIDR 192.168.10.0/24. Network: 192.168.10.0. Broadcast: 192.168.10.255. Subnet mask: 255.255.255.0. Range host utili: 192.168.10.1 - 192.168.10.254 (254 host). Default gateway tipico: 192.168.10.1. Pool DHCP: 192.168.10.100-200. Riservati statici: 192.168.10.2-99 (server, stampanti). Conformita' RFC 1918 privato. Cisco IOS: int gigabitethernet 0/1, ip address 192.168.10.1 255.255.255.0.
Esempio 2 - subnet /22 superrete TIM Roma uffici. 10.20.0.0/22 = 1024 indirizzi 1022 host utili. Network 10.20.0.0, broadcast 10.20.3.255. 4 subnet /24 incluse (10.20.0/24, 10.20.1/24, 10.20.2/24, 10.20.3/24). Routing summary OSPF area 0: announce 10.20.0.0/22 invece di 4 /24 separate (route aggregation). Riduce tabella routing nei core router.
Esempio 3 - point-to-point router-router /30. 172.16.255.0/30. Network 172.16.255.0, broadcast 172.16.255.3. Host: 172.16.255.1 e .2 (2 utili, /30 standard). Per /31 (RFC 3021) entrambi 172.16.255.0 e .1 utilizzabili (no network/broadcast), risparmia 50% IP per links P2P. Tipico WAN MPLS Cisco/Juniper.
Esempio 4 - DMZ servizi web /28 Vodafone. 80.181.50.16/28 (pubblico ISP Vodafone Italia). Network 80.181.50.16, broadcast 80.181.50.31. Host range 80.181.50.17 - .30 (14 utilizzabili). Tipica configurazione DMZ piccola: webserver, mailserver, VPN gateway. Firewall ASA inside (RFC 1918) + outside (DMZ pubblico) + dmz (servers).
Esempio 5 - VLSM subnetting università' /16. Universita' Bologna 137.204.0.0/16 (65534 host). Subnet con VLSM: /20 facoltà (4094 host) per ogni macro-area, /24 dipartimenti (254 host), /27 laboratori (30 host), /30 trunk Ethernet inter-switch. Allocazione gerarchica permette riassegnazione modulare senza re-numbering globale. Cisco DNA Center automatizza in datacenter moderni.
Limiti e considerazioni
- IPv4 esaurito IANA 2011, RIR regionali 2011-2019: nuovi siti devono usare IPv6 o NAT/CGNAT.
- RFC 1918 private NON routabili Internet pubblica: NAT obbligatorio per Internet access.
- NAT/PAT (RFC 3022) traduce indirizzi privati a pubblici, breaking end-to-end principle (problema VoIP, P2P).
- CGNAT operatori mobili (Vodafone, TIM, WindTre): IP pubblico condiviso 100.64.0.0/10 (RFC 6598), problema port forward, gaming.
- Multicast /4 224.0.0.0/4 (Classe D): video streaming, IPTV, OSPF/EIGRP routing protocols.
- Loopback 127.0.0.0/8: localhost, non routabile fuori host.
- Link-local 169.254.0.0/16 (RFC 3927): autoconfiguration IPv4 quando DHCP fallisce (APIPA Microsoft).
- Subnet zero (/25 prima subnet) e all-ones storicamente vietate, RFC 1812 le riabilita su router moderni Cisco.
- VLSM richiede router supporto (default Cisco IOS, Juniper, MikroTik); legacy Class-C strict no.
- IPv6 transizione: dual-stack, 6to4, Teredo, NAT64 (RFC 6052) progressivamente.
Errori comuni
- Confondere network address con primo host (es. 192.168.1.0 NO, .1 SI).
- Assegnare broadcast a host (192.168.1.255 NO).
- Sovrapporre subnet (192.168.1.0/24 e 192.168.1.0/25 incompatibili).
- Ignorare gateway/loopback/multicast riservati.
- Calcolare host con formula 2^n invece di 2^n - 2 (errore /24 256 vs 254).
- Confondere subnet mask 255.255.255.0 con CIDR /24 (sono equivalenti).
- Routing senza summary: 200 /24 in tabella invece di 1 /16 aggregato.
- NAT con private classi sovrapposte LAN+VPN: routing loop, packet drop.
- IPv4 strictly classful: pre-1993 ostacola subnetting, deprecated.
- Mixing IPv4 con IPv6 senza dual-stack o tunneling appropriato.
Applicazioni numerate
- Sysadmin / NetAdmin: configurazione firewall, switch, router, Cisco/MikroTik/Juniper.
- Sicurezza: firewall ASA/FortiGate/PaloAlto rules, ACL VLAN segmentation.
- Cloud: AWS VPC subnet, GCP VPC, Azure VNet, Kubernetes pod CIDR.
- Datacenter: spine-leaf VXLAN BGP-EVPN, automation Ansible/Terraform.
- ISP: assegnazione customer, BGP advertisement, RIPE NCC database.
- VPN: site-to-site IPsec, OpenVPN tunneling, SSL VPN client routing.
- Wi-Fi enterprise: SSID multi-VLAN, captive portal, eduroam università'.
- IoT: subnet dedicate sensori MQTT, Zigbee, LoRaWAN gateway.
- Certificazioni: Cisco CCNA/CCNP/CCIE, Juniper JNCIA/JNCIP, CompTIA Network+.
- Conformita': GDPR Art 4(1) IP dato personale, ENISA cybersecurity EU.
Per supporto
Per domande tecniche o segnalazioni: info@calcoi.com. Strumento didattico per networking. Per applicazioni professionali consultare RFC 4632 CIDR, RFC 1918 private addresses, RFC 6598 CGNAT, RFC 3021 /31 point-to-point, Tanenbaum-Wetherall "Computer Networks" 5th ed (Pearson 2013), Forouzan "Data Communications and Networking" 5th ed (McGraw-Hill 2017), Cisco Press CCNA/CCNP study guides.
Aggiornato a luglio 2026
Domande frequenti
Cosa significa la notazione CIDR /24?
Differenza tra subnet mask e wildcard mask?
Quanti host in una subnet /24, /28, /30?
Cosa sono RFC 1918 indirizzi privati?
Differenza tra /30 e /31 per link router?
Come fare VLSM Variable Length Subnet Mask?
Come configurare un router Cisco per /24?
Formula
network = IP AND subnet_mask
broadcast = network OR (NOT subnet_mask)
mask = 0xFFFFFFFF << (32 - prefix)
total = 2^(32 - prefix)
hosts = 2^(32 - prefix) - 2 (eccetto /31 e /32)
first = network + 1
last = broadcast - 1
RFC 1918: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
RFC 791 IP; RFC 4632 CIDR; RFC 1918 private; RFC 3021 /31 P2P; RFC 6598 CGN
Commenti (0)
Accedi per lasciare un commento.
Ancora nessun commento. Sii il primo!