IP Address Types: IPv4 and IPv6 Addressing Explained
Learn IPv4 and IPv6 address types, CIDR, private and public ranges, unicast, multicast, DHCP, SLAAC, special-use addresses, and troubleshooting.
An IP address is a Layer 3 logical address assigned to a network interface. It allows devices to identify sources and destinations across an IP network. Routers examine destination IP addresses and forward packets between networks.
An IP address is different from a physical MAC address. A MAC address identifies an interface on a local Ethernet network and normally operates at Layer 2. An IP address is logical, can change when a device moves networks, and supports routing across multiple networks. Ethernet delivery commonly uses MAC addresses for the next local hop, while routers use IP addresses to make forwarding decisions.
For background, review the OSI Reference Model and computer network fundamentals.
Purpose of IP Addressing
IP addressing provides two related pieces of information:
- The network prefix identifies the IP network.
- The host portion identifies an interface within that network.
When a host sends traffic, it compares the destination with its own network prefix. If the destination is local, it attempts direct delivery. If the destination is remote, it sends the packet to its default gateway, which is usually a router interface on the local subnet.
IPv4 Address Structure
IPv4 uses a 32-bit address. It is usually written as four 8-bit octets in dotted-decimal notation, such as 192.168.10.34. Each octet has a value from 0 through 255.
A subnet mask separates network bits from host bits. The equivalent CIDR notation, or classless prefix notation, states how many leading bits belong to the network. For example, 192.168.10.34/24 uses 24 network bits and 8 host bits. Its subnet mask is 255.255.255.0.
| Notation | Meaning |
|---|---|
192.168.10.34 | IPv4 address in dotted-decimal notation |
255.255.255.0 | Subnet mask; the first 24 bits are network bits |
/24 | CIDR prefix length; 24 leading bits identify the network |
With a typical /24 subnet, 192.168.10.0 is the network address, 192.168.10.1 through 192.168.10.254 are usable host addresses, and 192.168.10.255 is the broadcast address.
Finding Network, Host, and Broadcast Values
For 192.168.10.34/24:
- Network:
192.168.10.0 - Usable hosts:
192.168.10.1through192.168.10.254 - Broadcast:
192.168.10.255
For 172.16.8.130/25, the final octet is divided into blocks of 128. The address belongs to the second block:
- Network:
172.16.8.128 - Usable hosts:
172.16.8.129through172.16.8.254 - Broadcast:
172.16.8.255
For an ordinary IPv4 subnet, do not assign the network or broadcast address to a host. A subnet with n host bits normally has 2^n - 2 usable host addresses, although special prefix lengths and point-to-point designs can have different rules.
Historical IPv4 Address Classes
Classful addressing divided IPv4 into fixed classes based mainly on the first octet. This system is important for exams and historical context, but modern networks use CIDR and variable-length prefixes instead of relying on Classes A, B, and C.
| Class | First-Octet Range | Address Range | Historical Default Prefix or Mask | Primary Purpose |
|---|---|---|---|---|
| A | 1–126 | 1.0.0.0–126.255.255.255 | /8, 255.0.0.0 | Large unicast networks |
| B | 128–191 | 128.0.0.0–191.255.255.255 | /16, 255.255.0.0 | Medium-sized unicast networks |
| C | 192–223 | 192.0.0.0–223.255.255.255 | /24, 255.255.255.0 | Small unicast networks |
| D | 224–239 | 224.0.0.0–239.255.255.255 | Not applicable | Multicast |
| E | 240–255 | 240.0.0.0–255.255.255.255 | Not applicable | Reserved or experimental use |
Class A excludes 127.0.0.0/8, which is reserved for loopback. Classful boundaries waste address space because every Class A, B, or C network had a fixed default size. CIDR permits prefixes such as /20, /27, and /30, making address allocation and route aggregation more efficient.
IPv4 Delivery Types
| Delivery Type | Destination Scope | Example | Key Behavior |
|---|---|---|---|
| Unicast | One interface | 192.168.10.20 | One sender communicates with one destination |
| Broadcast | All hosts in a local IPv4 broadcast domain | 255.255.255.255 | Routers normally do not forward it |
| Multicast | Subscribed members of a group | 224.0.0.5 | One sender can reach multiple interested receivers |
| Anycast | One suitable instance from a group of interfaces | Commonly implemented with IPv6 addresses | Routing selects a reachable or nearest instance |
Unicast is the usual one-to-one communication model. Broadcast is one-to-all within a local IPv4 broadcast domain. Multicast is one-to-many, but only hosts that join or listen to the group should receive the traffic. Anycast is a routing concept: several interfaces use the same address, and routing delivers traffic to one appropriate instance. Anycast is widely used with IPv6 services and infrastructure.
IPv4 Special-Use and Scope-Based Addresses
| Address or Prefix | Type | Routable on Public Internet | Typical Use | Notes |
|---|---|---|---|---|
10.0.0.0/8 | Private | No | Enterprise and home LANs | RFC 1918 range |
172.16.0.0/12 | Private | No | Internal networks | Includes 172.16.0.0 through 172.31.255.255 |
192.168.0.0/16 | Private | No | Home and small-office LANs | RFC 1918 range |
127.0.0.0/8 | Loopback | No | Testing the local host | 127.0.0.1 is commonly used |
169.254.0.0/16 | Link-local, APIPA | No | Self-assignment after IPv4 configuration failure | Valid only on the local link |
224.0.0.0/4 | Multicast | Not as ordinary unicast | Multicast groups | Includes 224.0.0.5 |
0.0.0.0 | Unspecified or default route context | No | Unknown local source or default route | Not a normal host destination |
255.255.255.255 | Limited broadcast | No | All hosts on the local IPv4 broadcast domain | Not forwarded by routers |
192.0.2.0/24 | Documentation | No | Examples and technical documents | TEST-NET-1 |
198.51.100.0/24 | Documentation | No | Examples and technical documents | TEST-NET-2 |
203.0.113.0/24 | Documentation | No | Examples and technical documents | TEST-NET-3 |
Network and Broadcast Addresses
The network address has all host bits set to zero. It identifies the subnet and is used in routing tables. The directed broadcast address has all host bits set to one, such as 192.168.10.255 for 192.168.10.0/24. It targets all hosts in a particular subnet, although routers commonly disable directed-broadcast forwarding to reduce abuse.
The limited broadcast address, 255.255.255.255, targets all IPv4 hosts on the local broadcast domain and is not routed to another network. Broadcast traffic is therefore constrained by routers and VLAN boundaries.
Identifying IPv4 Addresses
10.25.4.8,172.20.10.5, and192.168.50.25are private RFC 1918 addresses.8.8.8.8is not in an RFC 1918 range; it is an example of a publicly used address.127.0.0.1is loopback.169.254.25.10is IPv4 link-local.224.0.0.5is multicast.255.255.255.255is limited broadcast.
Publicly routable addresses must be globally unique within the Internet routing system and must be allocated and advertised appropriately. Reserved, private, loopback, link-local, multicast, and documentation ranges should not be treated as ordinary public unicast addresses.
Private and Public IPv4 Addressing
Private addresses are intended for internal use and are not globally routed on the public Internet. The RFC 1918 ranges are:
10.0.0.0/8172.16.0.0/12192.168.0.0/16
Organizations use these ranges inside LANs, data centers, and enterprise networks. Because private addresses are not unique across all organizations, a router commonly uses NAT, or Network Address Translation, to translate private source addresses to a public address. PAT extends this idea by using transport-layer port numbers so many internal hosts can share one public IPv4 address.
For example, clients in 192.168.1.0/24 can send Internet traffic to a gateway. The gateway translates their private source addresses to an allocated public IPv4 address before forwarding the traffic. NAT is useful for IPv4 address conservation, but it is not a complete security solution; firewalls and appropriate filtering are still required.
Static and Dynamic IP Address Assignment
| Method | Protocol Version | How Address Is Assigned | Best-Fit Use Cases | Limitations or Considerations |
|---|---|---|---|---|
| Static assignment | IPv4 or IPv6 | Manually configured on the device | Routers, servers, management interfaces, and infrastructure | Manual errors and duplicate-address risk |
| DHCP | IPv4 | DHCP server leases configuration to a client | End-user devices and frequently changing clients | Requires reachable DHCP service and suitable scope |
| DHCP reservation | IPv4, and related identity-based designs in IPv6 | Server reserves an address for a device identity, commonly its MAC address | Printers, servers, and devices needing predictable addresses | Depends on the reservation database and client identity |
| SLAAC | IPv6 | Host forms an address from a router advertisement prefix | Automatic IPv6 host addressing | Additional settings may require DHCPv6 or other mechanisms |
| DHCPv6 | IPv6 | DHCPv6 supplies addresses and/or configuration options | Managed enterprise IPv6 configuration | Behavior depends on router-advertisement flags and client support |
Static configuration gives administrators direct control but becomes difficult to maintain at scale. DHCP reduces manual work and can supply an address, subnet mask, default gateway, and DNS settings. A DHCP reservation combines centralized management with a predictable address.
Unmanaged static assignments can duplicate an address already leased by DHCP. Exclude infrastructure addresses from DHCP pools, document static assignments, and use reservations where practical.
IPv6 Address Structure and Notation
IPv6 uses 128-bit addresses. They are written as eight groups of hexadecimal digits separated by colons, for example 2001:0db8:0001:0010:0000:0000:0000:0020.
Leading zeros in any group may be removed, so the previous address becomes 2001:db8:1:10:0:0:0:20. One consecutive sequence of all-zero groups may be replaced by ::, but this compression can be used only once in an address. Therefore, the fully compressed form is 2001:db8:1:10::20.
IPv6 uses a prefix length, such as /64, instead of an IPv4-style dotted-decimal mask. A typical LAN receives a /64 prefix: the first 64 bits identify the subnet and the remaining 64 bits identify the interface. For example, 2001:db8:1:10::20/64 has the subnet prefix 2001:db8:1:10::/64.
IPv6 Address Types
| IPv6 Type | Prefix or Address | Scope | Typical Use | Key Notes |
|---|---|---|---|---|
| Global unicast | Commonly 2000::/3 | Global | Internet-routable IPv6 communication | Must be allocated and routed appropriately |
| Unique local | fc00::/7, commonly fd00::/8 | Organization or site | Private internal addressing | Not intended for public Internet routing |
| Link-local | fe80::/10 | Local link | Neighbor Discovery, router communication, and local operation | Routers do not forward it; an interface identifier may be needed when using it |
| Multicast | ff00::/8 | Defined by the multicast scope field | One-to-many group communication | IPv6 uses multicast instead of broadcast |
| Anycast | Uses an address assigned to multiple interfaces | Routing-dependent | Nearest service instance or redundant gateway | No separate anycast syntax; routing behavior provides the distinction |
| Loopback | ::1 | Local host | Testing the IPv6 protocol stack | Equivalent conceptually to IPv4 loopback |
| Unspecified | :: | None | Indicating that an address is not yet known | Not assigned as a normal host address |
IPv6 has no broadcast address. Functions that might use IPv4 broadcast are implemented with multicast, especially link-local multicast groups. An IPv4-mapped IPv6 address, such as ::ffff:192.0.2.10, represents an IPv4 address in software APIs and transition mechanisms. It does not make the underlying endpoint a native IPv6 host.
Recognizing IPv6 Addresses
2001:db8:1:10::20/64has global-unicast-style addressing, although2001:db8::/32is reserved for documentation.fd12:3456:789a::10/64is unique local.fe80::1is link-local.ff02::1is multicast to all nodes on the local link.::1is loopback.::is unspecified.
IPv6 Address Assignment
Router Advertisements are ICMPv6 messages that announce prefixes, default-router information, and address-configuration instructions. With SLAAC, a host uses an advertised prefix and generates its own interface identifier. A host also normally creates a link-local address for local IPv6 operations.
DHCPv6 can provide addresses, DNS information, and other configuration. Networks may use SLAAC and DHCPv6 together: router advertisements can tell hosts to form addresses with SLAAC while obtaining additional options from DHCPv6. Static IPv6 addresses remain appropriate for routers, servers, and infrastructure that require predictable addressing.
Link-local addresses support Neighbor Discovery and communication with local routers. They are not suitable for reaching a remote network because routers do not forward link-local traffic.
Cisco IOS Configuration and Verification
Example IPv4 interface configuration:
configure terminal
interface GigabitEthernet0/0
ip address 192.168.10.1 255.255.255.0
no shutdown
Example IPv6 interface configuration:
configure terminal
ipv6 unicast-routing
interface GigabitEthernet0/0
ipv6 address 2001:db8:10:1::1/64
no shutdown
Verify interface addresses and operational state:
show ip interface brief
show ipv6 interface brief
show running-config interface GigabitEthernet0/0
Test local reachability and inspect routing:
ping 192.168.10.1
ping ipv6 2001:db8:10:1::1
show ip route
show ipv6 route
On hosts, common inspection commands include:
ipconfig /all
ip addr
ip -6 addr
Troubleshooting IP Address Problems
169.254.x.x Address and No Remote Connectivity
An address in 169.254.0.0/16 commonly means the IPv4 client self-assigned an APIPA link-local address after failing to obtain a DHCP lease. Check physical connectivity, the switch port and VLAN, DHCP server availability, DHCP relay configuration, and whether the DHCP scope has free addresses. Correct the problem and renew the lease.
Duplicate-Address Alerts
Intermittent connectivity or duplicate-address warnings can result from two static devices using the same address, a static address overlapping a DHCP pool, or an incorrect reservation. Compare device configuration with DHCP scopes and reservations. Use ARP information and the switch MAC address table to locate conflicting devices. Reserve infrastructure addresses outside dynamic pools.
Local Access Works but Remote Access Fails
Check the host address, mask or prefix, and default gateway. The gateway must belong to the same local subnet. Test the gateway first, then inspect the gateway interface and routing table. An incorrect subnet mask can make a remote destination appear local or a local destination appear remote.
IPv6 Has Only a Link-Local Address
An IPv6 host with only a fe80:: address may be missing router advertisements, a global prefix, or required DHCPv6 service. Verify that IPv6 routing is enabled, the router interface has an appropriate prefix, router advertisements are not blocked, DHCPv6 settings match the advertised flags, and a valid IPv6 default route exists.
IPv4 Broadcast Does Not Cross a LAN
IPv4 routers normally do not forward broadcasts. Confirm that the source and intended recipients are in the same VLAN and broadcast domain. If communication must cross routed boundaries, use unicast, multicast where supported, or an application design that uses a relay.
Operational and Security Considerations
- Do not assign IPv4 network or broadcast addresses to ordinary hosts.
- Do not route private, loopback, link-local, or documentation ranges across the public Internet.
- Filter spoofed source addresses at network boundaries using appropriate ingress and egress controls.
- Remember that IPv4 broadcast traffic is constrained to a local broadcast domain and can consume considerable bandwidth.
- Use multicast only when the network infrastructure and applications support it and the traffic is required.
- Do not assume that a private address is automatically secure; apply firewall policy, authentication, and segmentation.
- Document static addresses and reservations to prevent conflicts.
Exam-Ready Summary
- IPv4 is 32 bits and normally uses dotted-decimal notation; IPv6 is 128 bits and uses hexadecimal colon-separated notation.
- CIDR identifies a network with a prefix length such as
/24or/64. - The default gateway forwards traffic from the local subnet toward remote networks.
- Unicast is one-to-one, broadcast is IPv4 one-to-all locally, multicast is one-to-many by group, and anycast selects one suitable instance.
- RFC 1918 private IPv4 ranges are
10.0.0.0/8,172.16.0.0/12, and192.168.0.0/16. 127.0.0.0/8is IPv4 loopback;169.254.0.0/16is IPv4 link-local;255.255.255.255is limited broadcast.- IPv6 global unicast commonly uses
2000::/3, unique local usesfc00::/7, link-local usesfe80::/10, and multicast usesff00::/8. - IPv6 uses multicast instead of broadcast, and
::1is loopback while::is unspecified. - DHCP automates IPv4 configuration; SLAAC and DHCPv6 provide IPv6 configuration choices.