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.

CIDRMaskAddressesUsable hosts
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/16255.255.0.065,53665,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.1 on 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.

Cut 192.168.10.0/24 into

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

Prefix/26Mask255.255.255.192Addresses per piece64Usable for devices62
.0/26hosts .1–.62bc .63
.64/26hosts .65–.126bc .127
.128/26hosts .129–.190bc .191
.192/26hosts .193–.254bc .255
192.168.10.130 is in piece 3: 192.168.10.128/26. It's a normal host address: a device can use it. Each time you double the pieces, each piece halves: think of cutting a pizza.

Whiteboard · watch and try

Working out a /27 by hand

Press Play. Then try the board's last problem yourself.

4 steps
Press Play and the tutor will talk you through it while writing on the board. Pause any time to write on the board 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

Question 1

1.How many usable hosts are in a /28?

Question 2

2.Which address is private?

Question 3

3.A PC shows 169.254.33.7. What most likely happened?

Question 4

4.What makes ARP spoofing possible?

Quiz score: 0 of 4

Tip: answer every quiz question correctly first.

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.