Use IPv4 when checking an address, mask, subnet boundary or interface assignment, or when an IPv4 host cannot reach its gateway or a neighbor on the same subnet.
IPv4 · IP Fundamentals
IPv4 uses 32-bit addresses written as four decimal octets (192.0.2.10) with a prefix length (/24) that separates network and host bits; hosts reach other networks through a default gateway.
1. Host address and prefix — is the destination in the same subnet or not?
2. Same subnet → arp -a / show ip arp for the destination.
3. Different → gateway in the same subnet as the host? Gateway ARP entry present?
4. 169.254.x.x → DHCP failed; go to DHCP.
5. show ip route <dest> on the gateway and traceroute <dest>.
address and mask valid → same-subnet check → ARP for destination or gateway → frame delivered → gateway routes onward → return path exists
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show ip interface briefVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Commands Verify boundary
show ip interface brief
ipconfig /all # Windows
ip -4 addr # Linux
Step 2 What it is Narrow the fault
IPv4 uses 32-bit addresses written as four decimal octets. Each address has a network part (the prefix) and a host part. Special ranges: private 10/8, 172.16/12, 192.168/16 (RFC 1918); loopback 127/8; link-local 169.254/16 (APIPA); multicast 224/4; CGNAT 100.64/10.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Subtopics
Go one level deeper into this subject.
Addressing: Network address, Host address, Broadcast address, Prefix.
Subtopic Private IPv4Private IPv4 addresses (RFC 1918: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are not routed on the internet; hosts using them reach the internet through NAT.
Subtopic Interface ConfigurationIPv4 interface configuration assigns an address and mask with ip address <ip> <mask> and enables the interface with no shutdown; verify with show ip interface brief and show ip interface <if>.
Subtopic ARPARP: ARP request, ARP reply, ARP cache.
Same subnet → the host ARPs for the destination directly; different subnet → it ARPs for the default gateway. Network and broadcast addresses are not usable for hosts (except /31 point-to-point links). 127.0.0.0/8 is loopback and 169.254.0.0/16 means the host got no DHCP address.
show ip interface brief— interface addresses and status.show ip route <dest>— the route and next hop used.show ip arp <next-hop>— next hop resolved to a MAC address.ping <dest> source <if>— reachability from a chosen source.traceroute <dest>— where the path stops.- Host:
ipconfig /all(Windows) orip -br addrandip route(Linux).
ReferenceWhy it matters1 section · depth on demand
IPv4 in practice
An IPv4 address is 32 bits, written as four octets. The prefix length decides how many bits identify the network:
| Prefix | Mask | Addresses | Usable hosts |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | 2 (point-to-point, RFC 3021) |
Private ranges (RFC 1918): 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. A host sends to its own subnet directly (ARP for the destination) and everything else to its default gateway.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
IPv4
IPv4 is the original Internet Protocol, defined in RFC 791. Its header carries version and header length, type of service, total length (up to 65 535 bytes), identification, flags and fragment offset, time to live, protocol, a header checksum, 32-bit source and destination addresses and optional options.
Header fields (RFC 791)
| Field | Bits | Purpose |
|---|---|---|
| Version | 4 | 4 |
| IHL | 4 | Header length in 32-bit words (minimum 5 = 20 bytes) |
| Type of Service | 8 | Now the DS field (DSCP and ECN) |
| Total Length | 16 | Packet length including header |
| Identification | 16 | Groups fragments of one datagram |
| Flags | 3 | DF (don't fragment), MF (more fragments) |
| Fragment Offset | 13 | Position in 8-byte units |
| TTL | 8 | Hop limit; discarded at zero |
| Protocol | 8 | Upper-layer protocol |
| Header Checksum | 16 | Header only; recalculated per hop |
| Source / Destination | 32 each | Addresses |
Fragmentation (RFC 791)
A datagram larger than the next link's MTU is fragmented, unless DF is set, in which case it's discarded (and an ICMP "fragmentation needed" message lets the sender learn the path MTU). Every IP module must forward 68-byte datagrams without further fragmentation, and every host must accept 576-byte datagrams.
host$ ping -M do -s 1472 -c 2 10.30.0.15
PING 10.30.0.15 (10.30.0.15) 1472(1500) bytes of data.
1480 bytes from 10.30.0.15: icmp_seq=1 ttl=62 time=1.12 ms
host$ ping -M do -s 1473 -c 1 10.30.0.15
ping: local error: message too long, mtu=1500
host$ sudo tcpdump -ni eth0 -v icmp -c 1 | grep -o "ttl [0-9]*"
ttl 62
TTL 62 from a host that starts at 64 shows two routed hops.
Address classes (RFC 791)
RFC 791 defined classes A, B and C by leading bits. Classless addressing (CIDR, with prefix lengths) replaced them, but the class boundaries still appear in older documentation and in behaviour such as classful summarisation.
Documented example, not captured output.
Quick reference
An IPv4 address is 32 bits, written as four decimal octets, and the prefix length says how many of those bits identify the network; the remaining bits number the hosts inside it. A device compares a destination with its own prefix to decide whether to deliver directly (same subnet, using ARP) or send the packet to its default gateway. Choosing the prefix is therefore a capacity decision: every bit moved from host to network halves the number of usable addresses and doubles the number of subnets. Two addresses per subnet are reserved (network and broadcast), except on /31 point-to-point links and /32 host routes. The special ranges below should be recognised on sight, because seeing one in a fault (for example 169.254.x.x) already tells you what went wrong.
IPv4 essentials: 32-bit addresses, subnet masks/prefix lengths, private ranges (RFC 1918: 10/8, 172.16/12, 192.168/16), CGNAT range 100.64/10 (RFC 6598), link-local 169.254/16, loopback 127/8, multicast 224/4.
| Prefix | Hosts | Mask |
|---|---|---|
| /24 | 254 | 255.255.255.0 |
| /25 | 126 | 255.255.255.128 |
| /26 | 62 | 255.255.255.192 |
| /27 | 30 | 255.255.255.224 |
| /28 | 14 | 255.255.255.240 |
| /30 | 2 | 255.255.255.252 |
| /31 | 2 (point-to-point, RFC 3021) | 255.255.255.254 |
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in IP Fundamentals → IPv4. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc791.html · confidence 94%