Skip to main content

Beginner-Friendly Topic

Take your time - it's perfectly normal to re-read this topic 2-3 times. Try the interactive code editor below to run code yourself. Use the Q&A section to check your understanding before moving on.You've got this!

Lesson 2 of 11

IP Addressing, Subnetting & Network Topology

IP addressing and subnetting determine how networks are structured. From a security perspective, proper network segmentation using subnets limits the blast radius of a breach and enables finer-grained firewall rules.

40 minBy Priygop Editorial TeamUpdated 2026Peer Reviewed & Verified

IPv4 Addressing Essentials

IPv4 Addressing Essentials
# IP address classes and their security implications

Private IP Ranges (RFC 1918 - not routable on internet):
  10.0.0.0/8          → Large enterprise networks (16M addresses)
  172.16.0.0/12       → Medium networks (1M addresses)
  192.168.0.0/16      → Home/small office networks (65K addresses)

Special Addresses:
  127.0.0.1           → Loopback (localhost) - attacks via SSRF target this
  169.254.x.x         → APIPA / link-local - cloud instance metadata endpoint
  0.0.0.0/0           → Default route - "all traffic", dangerous in firewall rules

Security Implication:
  169.254.169.254 is the AWS Instance Metadata Service (IMDS)
  SSRF attacks target this IP to steal cloud credentials:
  curl http://169.254.169.254/latest/meta-data/iam/security-credentials/

Subnetting for Security (Network Segmentation)

Subnetting for Security (Network Segmentation)
# Security-focused network segmentation with subnets

# Flat Network (DANGEROUS - attacker reaches everything after one breach)
192.168.1.0/24 - All servers, clients, printers, IoT devices on same subnet

# Segmented Network (BETTER - limits lateral movement)
10.0.1.0/24  → DMZ (public-facing: web servers, API gateways)
10.0.2.0/24  → Internal servers (databases, internal APIs)
10.0.3.0/24  → Employee workstations
10.0.4.0/24  → Management network (admin access only)
10.0.5.0/24  → IoT devices (isolated - printers, cameras)

# Firewall rules between segments:
ALLOW  DMZ       → Internal (port 5432 PostgreSQL only, from app server IPs)
DENY   DMZ       → Management network (no path from public zone to admin)
ALLOW  Internal  → Internet (HTTPS 443 only, through proxy)
DENY   IoT       → Any internal (IoT completely isolated)

Security Benefits of Proper Segmentation

  • Limits lateral movement: An attacker who compromises a web server in the DMZ cannot directly reach the database in the internal network - they must also breach the firewall between segments
  • Reduces blast radius: A ransomware infection in the employee workstation segment cannot directly encrypt database servers if segments are properly isolated
  • Enables granular monitoring: Traffic between segments can be centrally logged and analyzed - cross-segment traffic is inherently more suspicious
  • Compliance: PCI DSS requires cardholder data to be in an isolated network segment separated from other business systems

Common Mistakes

  • Using /8 or /16 subnets for internal networks without further segmentation inside - a breach of any host allows access to thousands of others
  • Allowing all traffic between segments by default and only blocking specific ports - use default-deny between all segments and allow only necessary traffic
  • Not isolating IoT devices - smart cameras, printers, and HVAC systems often run outdated firmware with unpatched vulnerabilities and should never share a network segment with sensitive systems

Tip

Tip

Practice IP Addressing Subnetting Network Topology in small, isolated examples before integrating into larger projects. Breaking concepts into small experiments builds genuine understanding faster than reading alone.

Diagram
Loading diagram…

The foundational security model: Confidentiality (privacy), Integrity (trust), and Availability (uptime).

Practice Task

Note

Practice Task - (1) Write a working example of IP Addressing Subnetting Network Topology from scratch without looking at notes. (2) Modify it to handle an edge case (empty input, null value, or error state). (3) Share your solution in the Priygop community for feedback.

Quick Quiz

Common Mistake

Warning

A common mistake with IP Addressing Subnetting Network Topology is skipping edge case testing - empty inputs, null values, and unexpected data types. Always validate boundary conditions to write robust, production-ready cybersecurity code.

Key Takeaways

  • IP addressing and subnetting determine how networks are structured.
  • Limits lateral movement: An attacker who compromises a web server in the DMZ cannot directly reach the database in the internal network - they must also breach the firewall between segments
  • Reduces blast radius: A ransomware infection in the employee workstation segment cannot directly encrypt database servers if segments are properly isolated
  • Enables granular monitoring: Traffic between segments can be centrally logged and analyzed - cross-segment traffic is inherently more suspicious

Hands-on Practice Tools for this Course

Test what you learn using these free in-browser developer utilities (no signup required).

All 40+ Tools

Topics in This Module

0/11 done