IP Addressing and Subnets
Understand IPv4, IPv6, CIDR notation, and how subnets divide networks.
IP Addressing and Subnets is a free Cyber Security Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cyber Security Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
What is an IP Address?
An IP address is a unique numerical label assigned to each device on a network, enabling routing of traffic between source and destination. IPv4 uses 32-bit addresses (e.g., 192.168.1.10); IPv6 uses 128-bit addresses.
IPv4 Address Structure
An IPv4 address has four octets separated by dots. Each octet is 0–255. Example: 10.0.0.1.
IP addresses have two parts: the network portion (identifies the network) and the host portion (identifies the device).
Subnetting Basics
A subnet mask determines which bits belong to the network vs. the host. In CIDR notation, /24 means the first 24 bits are the network prefix.
Example: 192.168.1.0/24 — network is 192.168.1, hosts are .1 to .254, broadcast is .255.
CIDR Notation
Common subnet sizes:
/24— 256 addresses, 254 usable hosts/16— 65,536 addresses, 65,534 usable hosts/8— 16.7 million addresses/30— 4 addresses, 2 usable (point-to-point links)
Private vs. Public IP Ranges
RFC 1918 defines private address ranges (not routable on the internet):
10.0.0.0/8172.16.0.0/12192.168.0.0/16
Public IPs are routable on the internet and must be unique globally.
NAT: Network Address Translation
NAT allows multiple devices on a private network to share a single public IP. The router replaces the private source IP with its public IP when sending packets out, and reverses this for responses.
NAT hides internal network topology from the internet.
Subnetting for Security
Subnetting is a key security tool:
- Place sensitive servers in isolated subnets
- Use VLANs to segment traffic at Layer 2
- Apply firewall rules between subnets to control east-west traffic
- Limit broadcast domains to reduce eavesdropping exposure
Finding Your IP Address
Common commands to find IP configuration:
- Linux/Mac:
ip addr showorifconfig - Windows:
ipconfig /all - Public IP:
curl ifconfig.me
ip addr show
curl ifconfig.meLoopback and Special Addresses
Special addresses:
127.0.0.1— loopback (localhost); traffic never leaves the machine0.0.0.0— all interfaces (used in routing/binding)255.255.255.255— broadcast to all hosts on local subnet
IPv6 Basics
IPv6 uses 128-bit addresses written in hexadecimal groups: 2001:0db8:85a3::8a2e:0370:7334. IPv6 eliminates the need for NAT (every device gets a unique public IP) and supports built-in IPsec.
Subnetting in Penetration Testing
During recon, attackers enumerate subnets to understand the network topology. A common technique:
nmap -sn 192.168.1.0/24This performs a ping sweep to discover live hosts — useful for mapping the attack surface.
nmap -sn 192.168.1.0/24Quick Check: IP Addressing
Which IP address range is defined by RFC 1918 as private (not routable on the internet)?
Lesson Recap
IP addresses uniquely identify devices on a network. Subnetting divides networks into segments using CIDR notation. Private RFC 1918 addresses are used internally; NAT allows them to share public IPs. Proper subnetting is foundational to network security segmentation.
Frequently asked questions
Is the “IP Addressing and Subnets” lesson free?
Yes — the full text of “IP Addressing and Subnets” is free to read here on the web, and the Cyber Security Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cyber Security Academy course, upgrade to CoddyKit PRO.
What will I learn in “IP Addressing and Subnets”?
Understand IPv4, IPv6, CIDR notation, and how subnets divide networks. You practise Cyber Security Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Cyber Security Academy?
No prior experience is required. Cyber Security Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “IP Addressing and Subnets” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Cyber Security Academy lesson?
Yes. Every Cyber Security Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- IP Addressing and Subnets
- TCP vs UDP: When Each Is Used
- DNS: How Domains Resolve to IPs
- HTTP and HTTPS Basics