Configure and verify IPv4 addressing and subnetting

📘 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:

  1. Network portion – identifies the network (like a LAN or subnet)
  2. 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:

CIDRSubnet MaskNetwork BitsHost Bits# of Hosts
/8255.0.0.082416,777,214
/16255.255.0.0161665,534
/24255.255.255.0248254
/30255.255.255.2523022 (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.

ClassRange (First Octet)Default Mask# of Networks# of Hosts per NetworkUsage
A1 – 126255.0.0.0 (/8)12816,777,214Very large networks
B128 – 191255.255.0.0 (/16)16,38465,534Medium networks
C192 – 223255.255.255.0 (/24)2,097,152254Small networks
D224 – 239Multicasting
E240 – 255Experimental

7. Types of IPv4 Addresses

TypeDescription
Network addressIdentifies the network itself (host bits = 0)
Host addressAssigned to individual devices
Broadcast addressUsed to send data to all devices in the same network (host bits = 1)
Private IPUsed inside private networks (not routable on the internet)
Public IPUsed 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.

  1. Find how many bits to borrow:
    • Formula: 2ⁿ ≥ number of required subnets
    • 2² = 4 → borrow 2 bits
  2. New subnet mask:
    • /24 + 2 = /26
    • Mask: 255.255.255.192
  3. Each subnet size:
    • Host bits = 6 → 2⁶ – 2 = 62 hosts per subnet
  4. 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:

CommandPurpose
show ip interface briefDisplays interface status and IP addresses
show running-configDisplays configured IP settings
ping <destination>Tests network connectivity
traceroute <destination>Shows the path packets take through the network
show interfacesShows detailed interface statistics

11. Common IPv4 Addressing Errors

ErrorCauseResult
Wrong subnet maskIncorrect network or broadcast calculationDevices can’t communicate properly
Duplicate IP addressTwo hosts share the same IPIP conflict (connectivity issues)
Missing default gatewayHost can’t reach outside its networkNo internet or external communication
Interface shutdownAdmin disabled interfaceLink is down
Incorrect cable or VLANLayer 1 or 2 issueIP 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

FormulaPurpose
2ⁿ = number of subnetsn = bits borrowed
2ʰ – 2 = number of hosts per subneth = host bits
Increment = 256 – value of last subnet mask octethelps 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


1 thought on “Configure and verify IPv4 addressing and subnetting”

Leave a Reply

Your email address will not be published. Required fields are marked *

Buy Me a Coffee