IPv4
100%

Subnetting · Lesson 1

IPv4

Learn how IPv4 addresses, prefixes, scopes, and Linux interface output fit together.

IPv4 provides 32-bit source and destination addresses for routed packets. An address is meaningful together with its prefix, interface, scope, route policy, and lifetime—not as a permanent identifier for an entire device.

Dotted-Decimal Notation

IPv4 is displayed as four eight-bit octets separated by dots:

192.0.2.165

Each octet ranges from 0 through 255, so the complete address contains four bytes. The prefix length identifies how many leading bits belong to the network prefix, as in 192.0.2.165/24.

How large is an IPv4 address?

Address Scope and Purpose

Not every IPv4 address is globally routable. Examples include loopback 127.0.0.0/8, link-local 169.254.0.0/16, private ranges such as 10.0.0.0/8, and documentation ranges such as 192.0.2.0/24. Multicast and limited broadcast addresses have other semantics.

Private addresses can be reused in separate networks. NAT may translate them for external communication, but NAT is not required for communication within the private routed domain.

Why can 10.0.0.1 appear in many organizations?

Inspecting Linux IPv4 Addresses

Display IPv4 assignments with:

$ ip -4 address show

A line such as this reports more than the address:

inet 192.0.2.165/24 brd 192.0.2.255 scope global dynamic eth0

It shows prefix, broadcast, scope, dynamic origin marker, and interface. Additional lines can show valid and preferred lifetimes. An interface can hold several IPv4 addresses.

What does /24 mean in 192.0.2.165/24?

Determining the Selected Source

The presence of an address does not prove Linux will use it for a destination. Routes, policy rules, metrics, and application binding influence source selection. Query the current routing decision:

$ ip route get 198.51.100.20

Read the selected next hop, interface, and source, then test the real application path. Do not alter addresses on a remote host without console access and a rollback plan.

What can ip route get DESTINATION show?

Lesson complete

You finished IPv4

You can now read an IPv4 address as part of interface and routing state.

  • Recognize IPv4 as four octets totaling 32 bits.

  • Interpret an address together with its prefix.

  • Distinguish private, loopback, link-local, and other scopes.

  • Inspect assignments and the source selected for a destination.

Keep your learning progress

Create a free account to save this lesson and continue learning on any device.

Create a free account
Next Lesson
Back to Subnetting