Skip to main content

Days 7, 8: IPv4

CCNA 200-301 Study Guide: IPv4 and Core Router ConfigurationAddressing

1.0 IntroductionOverview

ThisIPv4 guideFundamentals

covers

IPv4 (Internet Protocol Version 4) is the primary Layer 3 fundamentals,protocol IPv4used addressing,in andmodern corenetworks. routerIt configuration. These topics align with the Network Fundamentals (20%) and IP Connectivity (25%) domains of the CCNA 200-301 exam.provides:

2.0 Layer 3 Fundamentals: The Role of the Router

The Network Layer (Layer 3) provides logical addressing and path determination across different network segments.

Key Characteristics of a Router

  • PathLogical Selection:addressing Usesvia a32-bit RoutingIP Table to determine the most efficient path for packets.addresses

  • BroadcastConnectivity Domainbetween Boundary:different Routersnetworks do(requires not forward broadcasts by default. Each interface is a separate broadcast domain.routers)

  • InterfacePath Defaultselection State:between Unlikesource switches,and Ciscodestination router interfaces are administratively down by default. They require the no shutdown command to function.hosts

3.0

Key DeconstructingDistinction from Layer 2:

    Layer 2 (Switches) expands networks using MAC addressing within the same LAN

    Layer 3 (Routers) separates and connects different networks using IP addressing

     


     

    IP Address Structure

    The IPv4 Address Format

    An IPv4 addressaddresses isconsist aof 32-bit32 logicalbits identifierdivided representedinto 4 octets (8 bits each), written in Dotted Decimal NotationNotation:

    (e.g.,

    192.168.1.1).254

    3.


    Each decimal number = 8-bit octet

    Each octet can range from 0 to 255


    Binary Representation:

    192        .    168        .    1 Structure         .    254

    11000000   .    10101000   .    00000001   .    11111110


    Network and Host Portions

      An IP address is split into two parts:

      1. Network Portion:Portion — Identifies the specificnetwork subnet.itself

      2. Host Portion:Portion — Identifies the specific device onwithin that subnet.network

      3.2

      Notation: BinaryCIDR Foundations(Classless Inter-Domain Routing)

      The octetslash (8notation bits)/X servesindicates ashow many bits are the fundamentalnetwork buildingportion:

      block

      192.168.1.254/24

      of


      IPv4

      / addressing.24 = The first 24 bits are the NETWORK portion

      The remaining 8 bits are the HOST portion


      NETWORK: 192.168.1   (first 3 octets)

      HOST:    .254        (last octet)


      All devices on the same network must have the same network portion but different host portions:

      192.168.1.100   ← Same network (192.168.1)

      192.168.1.105   ← Same network (192.168.1)

      192.168.1.205   ← Same network (192.168.1)


      Network Boundaries

      Routers separate networks. When a router is placed between two networks:

      Network 1: 192.168.1.0/24

      Router Interface 1 (G0/0): 192.168.1.254


      Router Interface 2 (G0/1): 192.168.2.254

      Network 2: 192.168.2.0/24


      Each router interface gets a unique IP address on the network it connects to.

      Broadcasts do not cross routers: When a broadcast packet hits a router, it stops. Broadcasts stay within the local LAN.

       


       

      Number Systems for IP Addressing

      Converting Binary to Decimal

      Each bit position within an octet corresponds torepresents a specific power of 2:

      Bit positions:  128  64  32  16  8  4  2  1

      Example:        1    0   0   1   1  1  1  1  = 10011111


      Calculation:

      1 × 128 = 128

      0 × 64  = 0

      0 × 32  = 0

      1 × 16  = 16

      1 × 8   = 8

      1 × 4   = 4

      1 × 2   = 2

      1 × 1   = 1


      Sum: 128 + 16 + 8 + 4 + 2 + 1 = 159


      Another Example: 01110110

      64 + 32 + 16 + 4 + 2 = 118


      Converting Decimal to Binary

      Method 1: Subtraction ($2^n$),Left decreasingto Right)

      Convert 221 to binary:

      221 - 128 = 93  ✓ → write 1 in 128 position

      93  - 64  = 29  ✓ → write 1 in 64 position

      29  - 32  = X   ✗ → write 0 in 32 position

      29  - 16  = 13  ✓ → write 1 in 16 position

      13  - 8   = 5   ✓ → write 1 in 8 position

      5   - 4   = 1   ✓ → write 1 in 4 position

      1   - 2   = X   ✗ → write 0 in 2 position

      1   - 1   = 0   ✓ → write 1 in 1 position


      Result: 11011101


      Method 2: Subtraction from left255

      Convert 207 to right.binary:

      Positional255 Values- Table207 = 48


      Now find where 48 appears in binary positions:

      48 = 32 + 16


      So the 0's are in positions 32 and 16

      The 1's are everywhere else


      Result: 11001111


      Convert Binary IP to Decimal

      Binary: 10011010.01001110.01101111.00100000


      Octet 1: 128 + 16 + 8 + 2 = 154

      Octet 2: 64 + 8 + 4 + 2 = 78

      Octet 3: 64 + 32 + 8 + 4 + 2 + 1 = 111

      Octet 4: 32


      IPv4 Address: 154.78.111.32


       


       

      IPv4 Address Classes

      IPv4 addresses are divided into 5 classes based on the first octet:

      Bit Position

      7

      6

      5

      4

      3

      2

      1

      0

      Power of 2

      2^7

      2^6

      2^5

      2^4

      2^3

      2^2

      2^1

      2^0

      Decimal Value

      128

      64

      32

      16

      8

      4

      2

      1

      TL;DR: An octet represents values from 0 to 255. To calculate a decimal value, sum the decimal weights of every bit set to "1".

      Examples:

        192 in binary: 11000000 ($128 + 64$)

        255 in binary: 11111111 (All bits on)

        4.0 IPv4 Address Classification (Classful System)

        While modern networks use CIDR (Classless), understanding the original classes is essential for the exam.

        Class

        RangeFirst (1stBit Octet)Pattern

        DefaultFirst MaskOctet Range

        HostsNetwork per NetworkBits

        UseHost CaseBits

        CIDR

        A

        1 – 1260xxxxxxx

        255.0.0.00–126 (/8)127 = loopback)

        16,777,2148

        Very24

        Large Networks

        /8

        B

        12810xxxxxx

        –

        128–191

        255.255.0.0 (/16)16

        65,53416

        Medium/Large Networks/16

        C

        192110xxxxx

        –

        192–223

        255.255.255.0 (/24)24

        2548

        Small Networks/24

        D

        2241110xxxx

        –

        224–239

        N/AMulticast (reserved)

        N/A—

        Multicast—

        E

        2401111xxxx

        –

        240–255

        N/AExperimental (reserved)

        N/A—

        Experimental—

        5.0

        For PrivateCCNA, vs.focus Publicon AddressingClasses (RFCA, 1918)

        Private addresses are used internallyB, and are not routable on the public internet.C.

        5.Class A (0–126)

        Example: 10.0.0.0/8

        Range:   10.0.0.1 RFCto 191810.255.255.254

        Private

        Hosts:   Ranges2^24 - 2 = 16,777,214


        Network portion: First octet only

        Host portion: Last 3 octets


        • ClassVery A:large 10.0.0.0 – 10.255.255.255networks

        • Rarely used in modern networks (reserved for special use)

        Class B:B (128–191)

        Example: 172.16.0.00/16

        –

        Range:   172.31.16.0.1 to 172.16.255.255254

        Hosts:   2^16 - 2 = 65,534


        Network portion: First 2 octets

        Host portion: Last 2 octets


          Medium-sized networks

          ClassCommon C:in 192.168.0.0larger – 192.168.255.255enterprises

          5.Class C (192–223)

          Example: 192.168.1.0/24

          Range:   192.168.1.1 to 192.168.1.254

          Hosts:   2^8 - 2 Special= Reserved254

          Ranges


          Network portion: First 3 octets

          Host portion: Last octet


          • Loopback:Smaller 127.0.0.1 (Tests the local TCP/IP stack).networks

          • APIPA:Most 169.254.0.0/16common (Self-assignedin whensmall DHCPto fails).medium businesses

          6.

          Special Addresses: Loopback (Class A)

          127.0.0.0 Essentialto 127.255.255.255 — Reserved for loopback testing

          127.0.0.1 is the standard loopback address


          Used to test the network stack (OSI & TCP/IP model) on a local device

          Does not go to the network; stays on the local machine

          Useful for testing TCP/IP implementation without actual network traffic


           


           

          Subnet Masks and Network CalculationsAddresses

          6.1Subnet ReservedMask Addresses in a Subnet(Netmask)

            A

            subnet

            Networkmask Address:identifies The first address (all hostwhich bits are 0).the Identifiesnetwork portion and which are the subnet.host portion:

              1's in the binary netmask = network bits

              Broadcast0's Address:in Thethe lastbinary addressnetmask (all= host bits

              are 1)

              Standard Class Netmasks:

              Class

              CIDR

              Dotted Decimal

              Binary

              A

              /8

              255.0.0.0

              11111111.00000000.00000000.00000000

              B

              /16

              255.255.0.0

              11111111.11111111.00000000.00000000

              C

              /24

              255.255.255.0

              11111111.11111111.11111111.00000000

              Example: Identifying Network and Host with Mask

              IP Address:    192.168.1.100

              Netmask (/24): 255.255.255.0


              Match the 1's in the netmask:

              Network:       192.168.1.0

              Host portion:  .100

              Used


               


               

              Network Addresses and Broadcast Addresses

              Network Address (First Address)

              When the host portion is all 0's, it's the network address — the identifier of the network itself.

              192.168.1.0/24 = NETWORK ADDRESS (not assigned to communicateany withhost)


              Broadcast Address (Last Address)

              When the host portion is all 1's, it's the broadcast address — used to send data to all hosts on the subnet.

              6.2 Calculating Usable Hosts

              To find the number of usable host IPs:network.

              $$2^h192.168.1.255/24 -= 2$$BROADCAST ADDRESS (not assigned to any host)

              (Where $h$ is the number of host bits. The $-2$ accounts for the Network and Broadcast addresses.)

              7.0 Core Cisco IOS Router Configuration

              7.1 Basic Configuration Workflow


              Router>Destination enableIP:                                        # Enter Privileged EXEC mode

              Router# configure terminal                            # Enter Global Configuration mode

              Router(config)# interface GigabitEthernet0/0/0        # Enter Interface mode

              Router(config-if)# ip address 192.168.1.1 255.255.255.0 # Assign IP/Mask255

              Router(config-if)#Destination descriptionMAC: Link to LAN-SWITCH-01   # Optional Label

              Router(config-if)# no shutdown                         # Enable the interface

              Router(config-if)# end                                 # Exit to Privileged EXEC

              Router# copy running-config startup-config            # Save to NVRAMFFFF.FFFF.FFFF


              7.First and Last Usable Addresses

              Because network and broadcast addresses are reserved, the usable host range is:

              Network Address:       192.168.1.0   ← Not usable

              First Usable Address:  192.168.1.1   ← Usable

              ...

              Last Usable Address:   192.168.1.254 ← Usable

              Broadcast Address:     192.168.1.255 ← Not usable


               


               

              Calculating Maximum Hosts per Network

              Formula: 2^N - 2

              Where N = number of host bits

              (The "-2" accounts for the network address and broadcast address)

              Class A Example

              10.0.0.0/8

              Host bits: 24 (since /8 network bits)

              Maximum hosts: 2^24 - 2 CLI= Shortcuts16,777,216 - 2 = 16,777,214


              Class B Example

              172.16.0.0/16

              Host bits: 16

              Maximum hosts: 2^16 - 2 = 65,536 - 2 = 65,534


              Class C Example

              192.168.1.0/24

              Host bits: 8

              Maximum hosts: 2^8 - 2 = 256 - 2 = 254


               


               

              IPv4 Header (Layer 3)

              Header Overview

              The IPv4 header contains many more fields than the Ethernet header:

              Minimum Header Length: 20 bytes Maximum Header Length: 60 bytes

              Key Header Fields

              Source IP Address (32 bits)

              • do:IP Executeaddress EXECof commandsthe fromsender/originating configdevice

                modes

              Destination IP Address (e.g.,32 dobits)

              show
              ip int

              IP brief).address of the intended receiver/destination

              Total Length (16 bits)

                Indicates the total length of the packet (header + data)

                no:Measured Negatesin a commandbytes (e.g.,not 4-byte increments like IHL)

                Minimum: 20 bytes (header only, no shutdowndata)

                to enable, no

                Maximum: ip65,535 addressbytes to(2^16 remove).- 1)

                8.0

                Header VerificationChecksum (16 bits)

                  Calculated checksum for error detection

                  Routers calculate this and Troubleshootingdrop the packet if checksums don't match

                  Only checks the IPv4 header, not the encapsulated data

                  The encapsulated protocol (TCP/UDP) handles data error checking

                  Time To Live (TTL) (8 bits)

                    Prevents packets from circulating indefinitely

                    Decremented by 1 at each router

                    When TTL reaches 0, the packet is dropped

                    Default value: typically 64 or 255

                    Version (4 bits)

                      IP version: 4 for IPv4, 6 for IPv6

                       


                       

                      Cisco Router Interface Configuration

                      Viewing Interface Status

                      Router# show ip interface brief


                      Output columns:

                      CommandColumn

                      PurposeMeaning

                      show ip interface briefInterface

                      ConcisePhysical summaryport of IP, statusname (Up/Down),Gi0/0, andFa0/1, Protocol.etc.)

                      showIP interfacesAddress

                      DetailedAssigned stats,IP error countersaddress (CRC,or Collisions), and Layer 1/2 health.unassigned)

                      show running-configMethod

                      ViewHow the currentIP activewas configassigned in(manual, RAM.DHCP, etc.)

                      pingStatus (L1)

                      TestsPhysical end-to-endlayer Layerstatus 3(up/down/administratively connectivity.down)

                      Protocol (L2)

                      Data link layer status (up/down)

                      9.0

                      Status Key Takeaways for the ExamMeanings:

                      • Binary:up You— mustInterface beis able to convert between decimal and binary quickly.operational

                      • Defaultdown Off:— AlwaysInterface rememberhas a problem or no shutdown for routers.cable

                      • Volatileadministratively Memory:down Configurations— inInterface RAMhas been disabled with shutdown command

                      Default Behavior:

                        Router interfaces are lostadministratively ondown reboot;by always copy run start.DEFAULT

                        Subnetting:Switch Neverinterfaces assignare theNOT Networkadministratively ordown Broadcastby addresses to a host.default

                        Entering Interface Configuration Mode

                        Router# configure terminal

                        Router(config)# interface gigabitethernet 0/0


                        Shorthand can be used: g0/0, fa0/0, etc.

                        Assigning an IP Address

                        Router(config-if)# ip address 10.255.255.254 255.0.0.0


                        Format: ip address <IP> <netmask>

                        Enabling the Interface

                        Router(config-if)# no shutdown


                        This removes the "administratively down" status.

                        Expected output:

                        Interface GigabitEthernet0/0 changed state to up

                        Line protocol on Interface GigabitEthernet0/0, changed state to up


                        Verifying Configuration

                        From interface configuration mode, use do to execute privileged commands:

                        Router(config-if)# do show ip interface brief


                        This confirms the interface is up and the IP address is assigned correctly.

                        Detailed Interface Information

                        Router# show interfaces gigabitethernet 0/0


                        Shows extensive Layer 1, Layer 2, and Layer 3 information:

                          MAC address (BIA)

                          IP address

                          Interface encapsulation

                          MTU size

                          Error statistics

                          And much more

                          Router# show interfaces description


                          Displays descriptions assigned to each interface (if any).

                           


                           

                          Summary: Common IPv4 Classes at a Glance

                          Feature

                          Class A

                          Class B

                          Class C

                          First Octet

                          0–126

                          128–191

                          192–223

                          CIDR

                          /8

                          /16

                          /24

                          Netmask

                          255.0.0.0

                          255.255.0.0

                          255.255.255.0

                          Networks

                          126

                          16,384

                          2,097,152

                          Hosts per Network

                          16,777,214

                          65,534

                          254

                          Example Network

                          10.0.0.0

                          172.16.0.0

                          192.168.1.0

                          First Usable Host

                          10.0.0.1

                          172.16.0.1

                          192.168.1.1

                          Last Usable Host

                          10.255.255.254

                          172.16.255.254

                          192.168.1.254

                          Broadcast Address

                          10.255.255.255

                          172.16.255.255

                          192.168.1.255

                           


                           

                          Quick Conversion Reference

                          Common Decimal to Binary for Octets:

                          Decimal

                          Binary

                          Decimal

                          Binary

                          0

                          00000000

                          128

                          10000000

                          1

                          00000001

                          192

                          11000000

                          127

                          01111111

                          224

                          11100000

                          255

                          11111111

                          254

                          11111110

                           


                           

                          Key Takeaways for CCNA

                          ✅ IPv4 addresses are 32-bit logical addresses, split into network and host portions

                          ✅ The CIDR notation (/8, /16, /24) indicates the network portion length

                          ✅ Routers separate networks; switches expand networks within the same LAN

                          ✅ IPv4 Classes A, B, C differ in network size (more hosts = more network bits needed)

                          ✅ Network addresses (all host bits = 0) and broadcast addresses (all host bits = 1) are reserved and not usable

                          ✅ Usable host range = 2^(host bits) - 2

                          ✅ Router interfaces must be enabled with no shutdown (administratively down by default)

                          ✅ Subnet masks use 1's for network bits and 0's for host bits

                          ✅ Binary-to-decimal conversion is crucial for subnetting (coming next!)

                          ✅ Broadcasts don't cross routers — they stay within the local LAN

                          ✅ Verify interface configuration with show ip interface brief and show interfaces <interface>