TTR Networks

Beginner · Switching basics: layer 2, VLANs and IP addressing · section 2 of 7

IP addresses and gateways

✓ Lab-tested 17 October 2026 on VyOS 2026.10.16-0024-rolling, Debian 12 (Linux bridge)

An IP address with a prefix length, like 10.10.0.11/24, contains two pieces of information:

  • The network: the first 24 bits, 10.10.0. Every host on this network has an address starting 10.10.0, and the network itself is written 10.10.0.0/24.
  • The host: the remaining 8 bits, .11 here. A /24 has 256 addresses: .0 is the network address, .255 is the broadcast address, and .1 to .254 are for hosts.
PrefixAddressesUsable hostsTypical use
/24256254An office LAN or VLAN
/3042A point-to-point link between two routers
/3122A point-to-point link (RFC 3021)
/3211A single address, such as a loopback

The plan for this lab uses private address space (RFC 1918), one /24 per group of devices:

NetworkDevicesGateway
10.10.0.0/24pc1 (.11), pc2 (.12)10.10.0.1 (R1)
10.20.0.0/24pc3 (.13)10.20.0.1 (R1)

Every host makes one decision for every packet: is the destination on my own network? If yes, it uses ARP to find the destination's MAC address and sends the frame directly. If no, it sends the frame to its default gateway, the router. That decision is a route lookup, and you can try it below with pc1's real routing table.

pc1's routing table (real output)
root@pc1:~# ip route
default via 10.10.0.1 dev eth0
10.10.0.0/24 dev eth0 proto kernel scope link src 10.10.0.11
  • Line 2: Anything not local goes to the gateway, R1's VLAN 10 address.
  • Line 3: 10.10.0.0/24 is directly on eth0: no gateway needed.

Interactive: Route lookup on pc1 pc1's real routing table. Look up pc2 (same subnet: direct), pc3 (another subnet: via the gateway), then delete the default route and try again. (needs JavaScript)

Check your understanding

How many usable host addresses does a /24 network have?

  • 254
  • 256
  • 24
  • 255