Module 2 · Networking Fundamentals · Lesson 5 of 75
IP addressing, subnets, NAT, DHCP and ARP
IPv4 and IPv6, CIDR and subnet masks, private ranges and NAT, how devices get an address, and how ARP links IP to MAC.
In this lesson · about 35 minutes
- Read CIDR notation and work out a subnet's size and range
- Recognise private and special IPv4 ranges
- Explain DHCP, NAT and ARP, and how ARP spoofing abuses trust
IPv4 and CIDR
An IPv4 address is 32 bits, written as four bytes: 192.168.10.37. CIDR notation adds a slash and the number of bits in the network part: 192.168.10.37/24 means the first 24 bits (192.168.10) are the network and the last 8 bits are for hosts.
| CIDR | Mask | Addresses | Usable hosts |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
The rule: addresses = 2(32 − prefix). Two are reserved in every subnet: the first is the network address and the last is the broadcast address. So 192.168.10.0/26 runs from .0 (network) to .63 (broadcast), with hosts .1 to .62.
Ranges worth knowing by heart
- Private (not routed on the internet):
10.0.0.0/8,172.16.0.0/12(172.16 to 172.31),192.168.0.0/16. - Loopback:
127.0.0.1, the machine talking to itself. - Link-local:
169.254.x.x. If a Windows PC shows this, it failed to get an address from DHCP. - Documentation ranges, used in examples (and in this course):
192.0.2.0/24,198.51.100.0/24,203.0.113.0/24.
IPv6 in one paragraph
IPv6 addresses are 128 bits, written in hex groups: 2001:db8:4f2a::17 (:: stands for a run of zero groups). There are so many that NAT is not needed. Security note: many networks quietly run IPv6 alongside IPv4, and firewalls or monitoring that only watch IPv4 leave a blind spot.
NAT, DHCP and ARP
- NAT (network address translation): your router swaps private addresses for its one public address on the way out, and keeps a table to send replies back. A side effect is that outsiders cannot start connections to your devices, but NAT is not a firewall.
- DHCP: a new device shouts "I need an address", and the DHCP server leases it an IP, mask, gateway and DNS server. A rogue DHCP server can hand out a fake gateway and redirect traffic.
- ARP: to send to
192.168.1.1on the local network, a device broadcasts "who has 192.168.1.1?" and the owner replies with its MAC. ARP has no authentication, so in ARP spoofing an attacker answers falsely ("that's me!") and sits in the middle of the conversation. Defences: dynamic ARP inspection on switches, and encryption so a man-in-the-middle sees only scrambled data.
Try it · watch it move
Slice a network into equal pieces
Drag the prefix length and watch the network split. For each setting, read off the network address, broadcast address and number of usable hosts.
The 256 addresses 192.168.10.0 – .255, one square each
N = network address (the name of the block) · B = broadcast ("everyone in this block") · click any square
The answer table
Whiteboard · watch and try
Working out a /27 by hand
Press Play. Then try the board's last problem yourself.
Tip: press Pause, then use the pen to work along on the board. Space plays and pauses; Ctrl+Z undoes your last mark.
Check your understanding0 of 4 correct
Quiz score: 0 of 4
Written by Noviq Academy in its own words. All labs are simulations: no real systems are touched, and every name, address, password and hash is made up. The offensive techniques taught here are for defending systems and for authorised testing only; never scan, access or test a system without the owner's written permission. Tool and product names belong to their owners, and command output may differ slightly from yours. Read-aloud uses your device's built-in voices.