IP Addresses and Subnet Prefixes
Quick answer
An IP address identifies a network-layer endpoint in a given routing context. A prefix length describes how many leading bits identify a network. Start with loopback before investigating any external connection.
Prepare the practice environment
Run python3 lab-fixtures/networking/setup.py from the extracted package root as an ordinary user. Enter the printed private path and check pwd. Use a fresh fixture, Bash with LC_ALL=C and set -o pipefail. Python 3 is required for the fixed local socket helper. Use only loopback or synthetic data; never apply sample configuration. Manual examples require an authorized disposable VM.
How it works
IPv4 uses 32 bits and IPv6 uses 128 bits. In 192.0.2.34/24 the first 24 bits identify 192.0.2.0/24; the remaining eight bits distinguish addresses. 127.0.0.1 and ::1 are loopback addresses. 192.0.2.0/24 and 2001:db8::/32 are documentation ranges, not destinations for experiments. Private address space and NAT are separate concepts. An interface may have several addresses; an address does not prove a service is listening.
Think of a prefix as a rule for grouping addresses, not as a test of connectivity. For example, 192.0.2.34 and 192.0.2.200 belong to the same /24, while 192.0.3.34 does not. A longer prefix describes a smaller address range. Do not infer the available host count from the IPv4 network/broadcast convention for every prefix: /31 point-to-point links and /32 host routes are special cases. IPv6 has no broadcast address.
Try the examples
The fourth field contains address/prefix in this iproute2 output; other systems may have extra addresses.
Expected stdout:
127.0.0.1/8IPv6 may be disabled in another environment.
Expected stdout:
::1/128python3 -c 'import ipaddress as i; print(i.ip_interface("192.0.2.34/24").network); print(i.ip_interface("2001:db8::34/64").network)'Python standard-library ipaddress performs offline arithmetic, not network access.
Expected stdout:
192.0.2.0/242001:db8::/64Common mistakes
Do not interpret /24 as 24 host bits or infer reachability from the mere presence of an address.
Practice
Compute the network for 192.0.2.130/26, then identify the two loopback addresses from the examples.
Related references
Study: ip. These are reference names, not deployed links.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
IP addresses and subnet prefixes — Knowledge Check
Apply network concepts to loopback, synthetic fixtures and VM-only scenarios.
How many bits are in IPv6?
What does /24 mean?
Which is IPv4 loopback?
Network of 192.0.2.130/26?