Utvikling · verktøy

IPv4-subnett-kalkulator

Skriv inn en IPv4-adresse med CIDR-prefiks, for eksempel 192.168.1.10/24, for å se subnettdetaljene.

Kjøres i nettleseren. Ingen opplasting.

Network address
—
Subnet mask
—
Wildcard mask
—
Broadcast address
—
First usable address
—
Last usable address
—
Total addresses
—
Usable hosts
—

Om verktøyet

IPv4-subnett-kalkulator sem complicação.

Den lokale IPv4-kalkulatoren viser normalisert nettverk, maske, jokertegnmaske, kringkastingsadresse, adresseantall og brukbart vertsintervall. Den håndterer /31-punkt-til-punkt-prefikser og /32-prefikser med én adresse eksplisitt; IPv6 beregnes ikke.

Veiledning

Slik bruker du IPv4-subnett-kalkulator

The IPv4 Subnet Calculator reads one address written with a prefix length, such as 192.168.1.10/24, and fills eight lines: network address, subnet mask, wildcard mask, broadcast address, first and last usable address, total addresses and usable hosts. It handles IPv4 prefixes from /0 to /32. It does not read IPv6, split a block into smaller subnets or check whether an address is in use.

Slik gjør du

  1. Type an IPv4 address, a slash and a prefix length from 0 to 32 into the box, for example 172.16.5.130/26. The box opens with 192.168.1.10/24 already worked out.
  2. Press Calculate subnet. The eight result lines refresh. If the entry is wrong, a short message appears and the result lines are not reliable until you fix it.
  3. Use the network, mask and wildcard lines when you write a route, a firewall rule or an access list, and use the first and last usable lines as the host range.
  4. Check the usable hosts line before you plan a subnet, because it is two lower than the total for prefixes up to /30.

Eksempler

A common office network

Du skriver inn
Address
192.168.1.10/24
Du får
Network
192.168.1.0
Mask
255.255.255.0
Wildcard
0.0.0.255
Broadcast
192.168.1.255
First
192.168.1.1
Last
192.168.1.254
Total
256
Usable
254

A /24 keeps the first 24 bits and leaves 8 for hosts, so there are 256 addresses. The first is the network address and the last is the broadcast address, which leaves 254 for devices.

Kjørt med verktøyets egen kode.

An address in the middle of a block

Du skriver inn
Address
172.16.5.130/26
Du får
Network
172.16.5.128
Mask
255.255.255.192
Wildcard
0.0.0.63
Broadcast
172.16.5.191
First
172.16.5.129
Last
172.16.5.190
Total
64
Usable
62

A /26 block holds 64 addresses and starts on a multiple of 64 in the last number. The address .130 falls in the block that starts at .128, so the tool reports that block, not .130.

Kjørt med verktøyets egen kode.

A point-to-point link

Du skriver inn
Address
10.0.0.4/31
Du får
Network
10.0.0.4
Mask
255.255.255.254
Wildcard
0.0.0.1
Broadcast
N/A (/31 point-to-point)
First
10.0.0.4
Last
10.0.0.5
Total
2
Usable
2

A /31 holds only two addresses and has no separate broadcast address, so both can be used by the two ends of a link. The tool shows a note in the broadcast line instead of an address.

Kjørt med verktøyets egen kode.

Når det er nyttig

  • Work out how many devices fit in a network before you choose a prefix for an office, a lab or a home setup.
  • Find the network address of any host address to see whether two machines sit in the same subnet.
  • Get the wildcard mask for an access list or routing rule without doing the bit maths by hand.
  • Check your answers while you practise subnetting for a networking course.

Begrensninger

  • It takes one IPv4 address with a prefix from /0 to /32. A dotted mask such as 255.255.255.0, a missing prefix, an octet above 255 or an IPv6 address is refused with a message.
  • After a refused entry, the result lines can still show numbers from an earlier calculation. Ignore them until the message says Done.
  • Leading zeros are read as ordinary decimal, so 010 counts as 10. Some systems read a leading zero as octal, so write octets without extra zeros.
  • It does not know which addresses are reserved, assigned or already in use on your network. It only does the arithmetic of the prefix.

Tips

  • Each extra bit in the prefix halves the block, so /25 holds 128 addresses and /26 holds 64. Use this to size a subnet quickly.
  • Compare the network lines of two hosts. If they match for the same prefix, the hosts share a subnet.
  • For private networks, stay inside the ranges reserved for them, such as 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.

Kilder

Vanlige spørsmål

Sobre IPv4-subnett-kalkulator.

What do I type into the IPv4 subnet calculator?

Type one IPv4 address, a slash and the prefix length, for example 192.168.1.10/24. The address does not have to be the first one in its block. The tool rounds it down to the network address of the block it belongs to.

Why are usable hosts two fewer than the total addresses?

In an ordinary subnet the first address names the network and the last one is the broadcast address, so neither is given to a device. That is why a /24 has 256 addresses but 254 usable hosts.

How does the tool treat /31 and /32 prefixes?

A /31 has two addresses and both count as usable, as described for point-to-point links in RFC 3021. A /32 is a single address, so the first, last and network lines all show it. In both cases the broadcast line holds a note.

What is a wildcard mask?

It is the subnet mask turned upside down: every bit is flipped. For 255.255.255.0 the wildcard is 0.0.0.255. Some router and firewall rules use it to say which part of an address may vary.

Can this tool work with IPv6?

No. It only handles IPv4 addresses with prefixes from /0 to /32, and an IPv6 address such as 2001:db8::1/64 is refused. IPv6 subnets use 128-bit addresses and need a different calculator.

Can I enter the mask instead of the slash number?

Not directly. The box expects the slash form. To convert a dotted mask, count the one bits in it. For example, 255.255.255.192 has 26 one bits, so type the address followed by /26.

Is the address I type sent anywhere?

The page states that it runs in your browser with no upload, and the calculation is plain arithmetic on the text in the box. Even so, avoid pasting addresses you are not allowed to share into any web page.

Hvordan bruker du Subnett-kalkulator?

Skriv inn en IPv4-adresse med CIDR-prefiks, for eksempel 192.168.1.10/24, for å se subnettdetaljene.

Lastes dataene mine opp til en server?

Nei. Behandlingen skjer i nettleseren din, og opplysningene dine lastes ikke opp.