breakitdown

127.0.0.0/8: loopback

Answer

The whole of 127.0.0.0/8, 16,777,216 addresses, is reserved for loopback: traffic to any of them never leaves the machine. 127.0.0.1 is the conventional localhost address, but on Linux you can also reach the local machine at 127.0.0.2 or 127.1.2.3.

Try

127.0.0.0/8 is 16,777,216 addresses: 127.0.0.0 to 127.255.255.255. 16,777,214 usable for hosts (the first is the network address, the last is broadcast).

12701111111000000000000000000000000000
8 network bits 24 host bits
Network
127.0.0.0
First usable
127.0.0.1
Last usable
127.255.255.254
Broadcast
127.255.255.255
Addresses
16,777,216
Usable hosts
16,777,214
Netmask
255.0.0.0
Wildcard (ACL) mask
0.255.255.255
Historic class
A
Range type
Loopback · not routed on the internet

Special-purpose range

Loopback 127.0.0.0/8 RFC 1122
Addresses that loop back to the same machine. 127.0.0.1 is 'localhost', but the whole /8 is loopback.

Split it into subnets

or

4 subnets.

SubnetUsable rangeHostsBroadcast
127.0.0.0/10127.0.0.1 – 127.63.255.2544,194,302127.63.255.255
127.64.0.0/10127.64.0.1 – 127.127.255.2544,194,302127.127.255.255
127.128.0.0/10127.128.0.1 – 127.191.255.2544,194,302127.191.255.255
127.192.0.0/10127.192.0.1 – 127.255.255.2544,194,302127.255.255.255

Is this IP in the range?

Range to CIDR blocks

What to know

Services bound to 127.0.0.1 accept connections only from the same machine, which is the usual way to keep a database or admin panel off the network. Debian and Ubuntu map the machine's own hostname to 127.0.1.1 in /etc/hosts.

Linux routes the entire /8 to the loopback interface. macOS configures only 127.0.0.1 by default; other addresses need an alias (sudo ifconfig lo0 alias 127.0.0.2).

Gotchas

Related explainers

← CIDR calculator