📘 CCNA 200-301 v1.1
1.6 Configure and Verify IPv4 Addressing and Subnetting
1. What Is IPv4?
IPv4 (Internet Protocol version 4) is a network layer protocol (Layer 3 of the OSI model) that provides logical addressing for devices on a network.
It allows devices to send and receive packets across interconnected networks (LANs, WANs, and the internet).
Each IPv4 address identifies a device’s location in a network — just like a unique ID for communication between devices.
2. IPv4 Address Structure
An IPv4 address is 32 bits long, divided into 4 octets (8 bits each).
Example:
192.168.10.25
In binary:
11000000.10101000.00001010.00011001
Each octet ranges from 0 to 255 (since 8 bits = 2⁸ = 256 possible values).
3. IPv4 Address Components
IPv4 addresses have two parts:
- Network portion – identifies the network (like a LAN or subnet)
- Host portion – identifies a specific device (host) inside that network
The subnet mask determines which part is network and which is host.
4. Subnet Mask
A subnet mask separates the network bits from the host bits in an IPv4 address.
Example:
IP address: 192.168.10.25
Subnet mask: 255.255.255.0
In binary:
IP: 11000000.10101000.00001010.00011001
Mask: 11111111.11111111.11111111.00000000
- The 1s in the subnet mask mark the network part
- The 0s mark the host part
Here, /24 (24 bits for the network) means the first 24 bits are network bits, and the last 8 bits are host bits.
5. CIDR Notation (Classless Inter-Domain Routing)
CIDR notation uses a slash ( / ) followed by the number of network bits.
Examples:
| CIDR | Subnet Mask | Network Bits | Host Bits | # of Hosts |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 8 | 24 | 16,777,214 |
| /16 | 255.255.0.0 | 16 | 16 | 65,534 |
| /24 | 255.255.255.0 | 24 | 8 | 254 |
| /30 | 255.255.255.252 | 30 | 2 | 2 (used for point-to-point links) |
Formula to calculate hosts:
2^number_of_host_bits - 2
(The “-2” removes network address and broadcast address.)
6. IPv4 Address Classes (for reference)
IPv4 addresses were historically grouped into classes, but now CIDR is preferred. Still, you must know the classes for the CCNA exam.
| Class | Range (First Octet) | Default Mask | # of Networks | # of Hosts per Network | Usage |
|---|---|---|---|---|---|
| A | 1 – 126 | 255.0.0.0 (/8) | 128 | 16,777,214 | Very large networks |
| B | 128 – 191 | 255.255.0.0 (/16) | 16,384 | 65,534 | Medium networks |
| C | 192 – 223 | 255.255.255.0 (/24) | 2,097,152 | 254 | Small networks |
| D | 224 – 239 | — | — | — | Multicasting |
| E | 240 – 255 | — | — | — | Experimental |
7. Types of IPv4 Addresses
| Type | Description |
|---|---|
| Network address | Identifies the network itself (host bits = 0) |
| Host address | Assigned to individual devices |
| Broadcast address | Used to send data to all devices in the same network (host bits = 1) |
| Private IP | Used inside private networks (not routable on the internet) |
| Public IP | Used on the internet (globally unique) |
Private IP ranges:
- Class A: 10.0.0.0 – 10.255.255.255
- Class B: 172.16.0.0 – 172.31.255.255
- Class C: 192.168.0.0 – 192.168.255.255
8. Subnetting
Subnetting means dividing one large network into smaller, logical sub-networks (subnets).
Each subnet functions as its own smaller network.
Why subnet?
- Better use of IP addresses
- Improves network performance
- Reduces broadcast traffic
- Enhances security and management
Subnetting Example
You have a 192.168.10.0/24 network.
You want 4 subnets.
- Find how many bits to borrow:
- Formula: 2ⁿ ≥ number of required subnets
- 2² = 4 → borrow 2 bits
- New subnet mask:
- /24 + 2 = /26
- Mask: 255.255.255.192
- Each subnet size:
- Host bits = 6 → 2⁶ – 2 = 62 hosts per subnet
- Subnets created:
- 192.168.10.0/26 → 192.168.10.0 – 192.168.10.63
- 192.168.10.64/26 → 192.168.10.64 – 192.168.10.127
- 192.168.10.128/26 → 192.168.10.128 – 192.168.10.191
- 192.168.10.192/26 → 192.168.10.192 – 192.168.10.255
9. Configuring IPv4 on Cisco Devices
On a Router (interface configuration mode)
Router> enable
Router# configure terminal
Router(config)# interface gigabitEthernet 0/0
Router(config-if)# ip address 192.168.10.1 255.255.255.0
Router(config-if)# no shutdown
Router(config-if)# exit
Router# show ip interface brief
On a Switch (SVI configuration) – for management access
Switch> enable
Switch# configure terminal
Switch(config)# interface vlan 1
Switch(config-if)# ip address 192.168.10.2 255.255.255.0
Switch(config-if)# no shutdown
Switch(config)# ip default-gateway 192.168.10.1
Switch# show ip interface brief
10. Verifying IPv4 Configuration
Common Commands:
| Command | Purpose |
|---|---|
show ip interface brief | Displays interface status and IP addresses |
show running-config | Displays configured IP settings |
ping <destination> | Tests network connectivity |
traceroute <destination> | Shows the path packets take through the network |
show interfaces | Shows detailed interface statistics |
11. Common IPv4 Addressing Errors
| Error | Cause | Result |
|---|---|---|
| Wrong subnet mask | Incorrect network or broadcast calculation | Devices can’t communicate properly |
| Duplicate IP address | Two hosts share the same IP | IP conflict (connectivity issues) |
| Missing default gateway | Host can’t reach outside its network | No internet or external communication |
| Interface shutdown | Admin disabled interface | Link is down |
| Incorrect cable or VLAN | Layer 1 or 2 issue | IP settings correct but still no connection |
12. Key Points to Remember for CCNA
✅ IPv4 address = 32 bits
✅ Subnet mask determines network vs. host bits
✅ Use CIDR notation (e.g., /24)
✅ Subnetting divides networks for efficiency and security
✅ show and ping commands verify configuration
✅ Know private IP ranges
✅ Know how to calculate:
- Number of subnets
- Number of hosts per subnet
- Subnet address and broadcast address
13. Quick Subnet Calculation Formulas
| Formula | Purpose |
|---|---|
| 2ⁿ = number of subnets | n = bits borrowed |
| 2ʰ – 2 = number of hosts per subnet | h = host bits |
| Increment = 256 – value of last subnet mask octet | helps find subnet boundaries |
✅ In Summary:
Configuring and verifying IPv4 addressing and subnetting means:
Ensuring devices can communicate correctly within and across networks.
Assigning correct IP addresses and subnet masks to devices
Dividing large networks into smaller subnets
Verifying configuration using Cisco commands

Good work