๐ŸŒ Subnetting

Networking 101: what the /24 means, how to split a network, and what really happens when a mask is wrong.

Video: Subnetting (Networking video)
Prefer to watch? This short video runs this page's main commands on five real Linux hosts and an FRR router in ContainerLab, with on-screen captions and a synthetic voiceover (an AI voice trained on the author's own recording). Click to play, or watch it on YouTube.
Networking 101: Subnetting

What you will learn:
   what an address and a mask (or prefix, the /24) really say, in binary
   how to read ipcalc: network, first and last host, broadcast, number of hosts
   how to split one /24 into four /26 subnets
   why two hosts on the SAME switch stop talking when they are in different subnets
   what a router (the default gateway) does about it, and why it then sent ICMP redirects
   a wrong mask that half works: one ping succeeds, the next one fails
   the gateway Linux refuses, the broadcast address ping refuses
   VLSM: right-sized subnets for 100, 50 and 20 hosts plus two router links, and /30 against /31
   the cheat table of /24 to /32, and a first look at IPv6 /64s

Every command and every line of output on this page was run for real on 2026-11-22. The lab is built with ContainerLab from one small file you can copy: a switch (a Linux bridge), five Ubuntu 24.04 hosts and one router running FRRouting (FRR) 10.7.1, the same router software as the Routing series. Where Cisco IOS types something differently, the Cisco command is shown next to it (Cisco lines are standard IOS syntax for reference; they were not run here).

The lab: one switch, five hosts, a router

Four hosts, h1 to h4, plug into one switch, sw1. The router r1 has one port on the same switch and a second port with one server, h5, behind it:

        h1    h2    h3    h4
         |     |     |     |
       +-------------------------+
       |          sw1            |-------- r1 (eth1) ---- r1 (eth2) -------- h5
       +-------------------------+

The whole lab is this file. ContainerLab starts the containers and wires the cables (virtual ethernet pairs):
name: net101
mgmt:                       # own management network (the default 172.20.20.0/24 clashed with another network here)
  network: clab-tc
  ipv4-subnet: 172.31.250.0/24
  ipv6-subnet: 3fff:172:31:250::/64
topology:
  defaults:
    exec:
      - sh -c 'ip route del default || true'     # no way out except what we build
  nodes:
    sw1:
      kind: linux
      image: alpine:3.21
      exec:
        - ip link add br0 type bridge
        - ip link set br0 up
        - sh -c 'for i in 1 2 3 4 5; do ip link set eth$i master br0; ip link set eth$i up; done'
    h1: {kind: linux, image: net101-host:24.04}
    h2: {kind: linux, image: net101-host:24.04}
    h3: {kind: linux, image: net101-host:24.04}
    h4: {kind: linux, image: net101-host:24.04}
    h5: {kind: linux, image: net101-host:24.04}
    r1:
      kind: linux
      image: quay.io/frrouting/frr:10.7.1
      exec:
        - sh -c 'ip route del default || true'
        - touch /etc/frr/vtysh.conf
  links:
    - endpoints: ["h1:eth1", "sw1:eth1"]
    - endpoints: ["h2:eth1", "sw1:eth2"]
    - endpoints: ["h3:eth1", "sw1:eth3"]
    - endpoints: ["h4:eth1", "sw1:eth4"]
    - endpoints: ["r1:eth1", "sw1:eth5"]
    - endpoints: ["r1:eth2", "h5:eth1"]

$ containerlab deploy -t net101.clab.yml

net101-host:24.04 is plain ubuntu:24.04 plus iproute2, iputils-ping, ipcalc, tcpdump, traceroute and python3-minimal. Every node also gets an eth0 on ContainerLab's management network (172.31.250.0/24 here); we only use eth1 and eth2. At the start the hosts have no address on eth1, only an automatic IPv6 link-local one:
h1$ ip -br addr show eth1
eth1@if587       UP             fe80::a8c1:abff:fe0f:2f70/64

Step 1: one network, a /24

Give the four hosts addresses in 10.10.0.0/24:
h1$ ip addr add 10.10.0.10/24 dev eth1
h2$ ip addr add 10.10.0.20/24 dev eth1
h3$ ip addr add 10.10.0.30/24 dev eth1
h4$ ip addr add 10.10.0.40/24 dev eth1

h1$ ping -c2 -W1 10.10.0.30
64 bytes from 10.10.0.30: icmp_seq=1 ttl=64 time=0.149 ms
64 bytes from 10.10.0.30: icmp_seq=2 ttl=64 time=0.075 ms
2 packets transmitted, 2 received, 0% packet loss, time 1047ms

How did h1 know it could reach h3 directly? Adding the address with /24 also added a route: "the whole 10.10.0.0/24 is right here on eth1". So h1 asked on the wire (ARP: who has 10.10.0.30?) and h3 answered with its MAC address:
h1$ ip route
10.10.0.0/24 dev eth1 proto kernel scope link src 10.10.0.10
h1$ ip neigh show dev eth1
10.10.0.30 lladdr aa:c1:ab:ee:4f:8d REACHABLE

ttl=64 is the starting value on Linux: no router was in the way. That is the whole job of the mask: it tells a host which addresses are "on my wire, ask for them directly" and which are "somewhere else, hand them to a router".
Cisco IOS writes the mask out in full: ip address 10.10.0.10 255.255.255.0.

Step 2: read the mask with ipcalc

An IPv4 address is 32 bits. The /24 says the first 24 bits are the network part; the other 8 bits number the hosts. ipcalc shows it in binary, with a space where the network part ends:
h1$ ipcalc 10.10.0.30/24
Address:   10.10.0.30           00001010.00001010.00000000. 00011110
Netmask:   255.255.255.0 = 24   11111111.11111111.11111111. 00000000
Wildcard:  0.0.0.255            00000000.00000000.00000000. 11111111
=>
Network:   10.10.0.0/24         00001010.00001010.00000000. 00000000
HostMin:   10.10.0.1            00001010.00001010.00000000. 00000001
HostMax:   10.10.0.254          00001010.00001010.00000000. 11111110
Broadcast: 10.10.0.255          00001010.00001010.00000000. 11111111
Hosts/Net: 254                   Class A, Private Internet

Read it like this:
   Netmask: 24 ones and then zeros. 255.255.255.0 and /24 are the same thing written two ways.
   Network: all host bits 0. That is the name of the subnet, not a host.
   Broadcast: all host bits 1. A packet to it goes to everyone on the subnet.
   HostMin to HostMax: everything in between can be a host. 2^8 = 256 addresses, minus network and broadcast = 254.
   Wildcard: the mask upside down. Cisco ACLs and OSPF network statements use it.
("Class A" is history: before 1993 the first number decided the size. Today the prefix length does. 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are the private ranges, free to use inside any network.)

Step 3: split the /24 into four /26

Borrow two host bits for the network part: /24 becomes /26. Two bits make four subnets, and each keeps 6 host bits: 64 addresses, 62 hosts. ipcalc lists them:
h1$ ipcalc 10.10.0.0/24 /26
Subnets after transition from /24 to /26

Netmask:   255.255.255.192 = 26 11111111.11111111.11111111.11 000000

 1.
Network:   10.10.0.0/26         00001010.00001010.00000000.00 000000
HostMin:   10.10.0.1            00001010.00001010.00000000.00 000001
HostMax:   10.10.0.62           00001010.00001010.00000000.00 111110
Broadcast: 10.10.0.63           00001010.00001010.00000000.00 111111

 2.
Network:   10.10.0.64/26        00001010.00001010.00000000.01 000000
HostMin:   10.10.0.65 ... HostMax: 10.10.0.126   Broadcast: 10.10.0.127

 3.
Network:   10.10.0.128/26       00001010.00001010.00000000.10 000000
HostMin:   10.10.0.129 ... HostMax: 10.10.0.190  Broadcast: 10.10.0.191

 4.
Network:   10.10.0.192/26       00001010.00001010.00000000.11 000000
HostMin:   10.10.0.193 ... HostMax: 10.10.0.254  Broadcast: 10.10.0.255

Subnets:   4
Hosts:     248
(subnets 2 to 4 shortened here; ipcalc prints each one in full.)

The trick to do it in your head: the block size is 256 minus the last mask number. 256 - 192 = 64, so the subnets start at 0, 64, 128 and 192. Each one ends one before the next starts, and that last address is its broadcast.
Four subnets of 62 hosts give 248 usable addresses, not 254: every subnet spends two on its network and broadcast addresses.

Step 4: same switch, different subnets

Now put h1 and h2 in the first /26, and h3 and h4 in the second. Nothing changes on the switch or the cables:
h1$ ip addr flush dev eth1; ip addr add 10.10.0.10/26 dev eth1
h2$ ip addr flush dev eth1; ip addr add 10.10.0.20/26 dev eth1
h3$ ip addr flush dev eth1; ip addr add 10.10.0.70/26 dev eth1
h4$ ip addr flush dev eth1; ip addr add 10.10.0.80/26 dev eth1

h1$ ip route
10.10.0.0/26 dev eth1 proto kernel scope link src 10.10.0.10
h1$ ping -c2 -W1 10.10.0.20
2 packets transmitted, 2 received, 0% packet loss, time 1008ms
h1$ ping -c2 -W1 10.10.0.70
ping: connect: Network is unreachable

h3 is still on the same switch, one cable away. But 10.10.0.70 is outside h1's 10.10.0.0/26, and h1 has no route for anything else, so it does not even try: no packet leaves h1. The subnet, not the cable, decides who a host talks to directly.

Step 5: a router joins the two subnets

A router with an address in each subnet can pass traffic between them. r1 gets the first host address of both /26s, on its one port into the switch:
r1# configure terminal
r1(config)# interface eth1
r1(config-if)# ip address 10.10.0.1/26
r1(config-if)# ip address 10.10.0.65/26
r1(config-if)# end
r1# show ip route connected
C>* 10.10.0.0/26 is directly connected, eth1, weight 1, 00:00:01
C>* 10.10.0.64/26 is directly connected, eth1, weight 1, 00:00:01
Cisco IOS needs the word secondary for a second address on one interface: ip address 10.10.0.65 255.255.255.192 secondary.

Each host gets its own subnet's router address as its default gateway, "send everything not local here":
h1$ ip route add default via 10.10.0.1
h2$ ip route add default via 10.10.0.1
h3$ ip route add default via 10.10.0.65
h4$ ip route add default via 10.10.0.65

h1$ ping -c3 -W1 10.10.0.70
64 bytes from 10.10.0.70: icmp_seq=1 ttl=63 time=0.197 ms
From 10.10.0.1 icmp_seq=2 Redirect Host(New nexthop: 10.10.0.70)
64 bytes from 10.10.0.70: icmp_seq=2 ttl=63 time=0.163 ms
2 packets transmitted, 2 received, +1 errors, 0% packet loss, time 1007ms

It works: ttl=63 means one router was in the way. But r1 also sent an ICMP redirect, "you could reach 10.10.0.70 directly, it is on the same wire as you". Routers do that when a packet leaves through the same port it came in on. h1 ignores the advice (10.10.0.70 is not in its subnet), so it is only noise here, and ping counts it as an error.

Step 6: turn the redirects off

Two subnets on one wire is a lab shortcut. On Linux the switch for redirects is a sysctl:
r1$ sysctl -w net.ipv4.conf.all.send_redirects=0 net.ipv4.conf.eth1.send_redirects=0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.eth1.send_redirects = 0

h1$ ping -c3 -W1 10.10.0.70
64 bytes from 10.10.0.70: icmp_seq=1 ttl=63 time=0.109 ms
64 bytes from 10.10.0.70: icmp_seq=2 ttl=63 time=0.100 ms
64 bytes from 10.10.0.70: icmp_seq=3 ttl=63 time=0.129 ms
3 packets transmitted, 3 received, 0% packet loss, time 2044ms
h1$ traceroute -n -w1 -q1 10.10.0.70
 1  10.10.0.1  0.834 ms
 2  10.10.0.70  0.736 ms

And look at h1's ARP table: for h3 it only knows the router's MAC address. Traffic to another subnet goes to the gateway's MAC, even when the other host is one switch port away:
h1$ ip neigh show dev eth1
10.10.0.1 lladdr aa:c1:ab:9d:d8:2e REACHABLE
10.10.0.20 lladdr aa:c1:ab:2a:06:1b REACHABLE

Cisco IOS: no ip redirects on the interface. A sysctl -w is lost on restart; put it in /etc/sysctl.d/ to keep it.
In a real network each subnet gets its own VLAN, so the switch keeps them apart too. That is the next lesson.

Step 7: a subnet behind the router

The third /26 goes on r1's second port, with the server h5:
r1# configure terminal
r1(config)# interface eth2
r1(config-if)# ip address 10.10.0.129/26
r1(config-if)# end
h5$ ip addr add 10.10.0.130/26 dev eth1; ip route add default via 10.10.0.129

h1$ ping -c2 -W1 10.10.0.130
64 bytes from 10.10.0.130: icmp_seq=1 ttl=63 time=0.118 ms
64 bytes from 10.10.0.130: icmp_seq=2 ttl=63 time=0.127 ms
h1$ traceroute -n -w1 -q1 10.10.0.130
 1  10.10.0.1  0.079 ms
 2  10.10.0.130  0.039 ms

Mistake 1: a mask that is too big

A classic: h2 gets /24 instead of /26. Everything else stays right:
h2$ ip addr flush dev eth1; ip addr add 10.10.0.20/24 dev eth1; ip route add default via 10.10.0.1
h2$ ip route
default via 10.10.0.1 dev eth1
10.10.0.0/24 dev eth1 proto kernel scope link src 10.10.0.20

h2$ ping -c2 -W1 10.10.0.70
64 bytes from 10.10.0.70: icmp_seq=1 ttl=63 time=0.161 ms
64 bytes from 10.10.0.70: icmp_seq=2 ttl=63 time=0.111 ms
2 packets transmitted, 2 received, 0% packet loss, time 1006ms

h2$ ping -c4 10.10.0.130
From 10.10.0.20 icmp_seq=1 Destination Host Unreachable
From 10.10.0.20 icmp_seq=2 Destination Host Unreachable
4 packets transmitted, 0 received, +2 errors, 100% packet loss, time 3066ms

h2$ ip neigh show dev eth1
10.10.0.70 lladdr aa:c1:ab:44:f1:0a REACHABLE
10.10.0.1 lladdr aa:c1:ab:9d:d8:2e STALE
10.10.0.130 FAILED

The first ping "works", which is what makes this mistake so sneaky. With a /24, h2 thinks 10.10.0.70 is local and ARPs for it directly. h3 is on the same switch and answers, so h2's pings go straight to h3. But h3 has the right /26 mask, so its replies go back through r1. The clue is ttl=63 on a "direct" neighbour: the two directions take different paths.
The second ping fails for real. h2 thinks 10.10.0.130 is local too, so it asks on the wire "who has 10.10.0.130?". h5 is behind the router and never hears it: FAILED, and "Destination Host Unreachable" comes from h2 itself, not from any router.
Put the right mask back and it works:
h2$ ip addr flush dev eth1; ip addr add 10.10.0.20/26 dev eth1; ip route add default via 10.10.0.1
h2$ ping -c2 -W1 10.10.0.130
64 bytes from 10.10.0.130: icmp_seq=1 ttl=63 time=0.135 ms
64 bytes from 10.10.0.130: icmp_seq=2 ttl=63 time=0.118 ms

Mistake 2: a gateway outside the subnet

h4 is in 10.10.0.64/26 but someone gives it the other subnet's gateway:
h4$ ip route del default; ip route add default via 10.10.0.1
Error: Nexthop has invalid gateway.
h4$ ip route add default via 10.10.0.65; ip route
default via 10.10.0.65 dev eth1
10.10.0.64/26 dev eth1 proto kernel scope link src 10.10.0.80

Linux refuses: a gateway has to be reachable directly, so it must be inside one of the host's own subnets.

Network and broadcast addresses

The last address of h1's subnet is its broadcast. ping notices and refuses unless you mean it:
h1$ ping -c2 -W1 10.10.0.63
ping: Do you want to ping broadcast? Then -b. If not, check your local firewall rules
h1$ ipcalc 10.10.0.10/26 | grep -E 'Network|Broadcast'
Network:   10.10.0.0/26         00001010.00001010.00000000.00 000000
Broadcast: 10.10.0.63           00001010.00001010.00000000.00 111111
Never give a host the network or broadcast address of its subnet: 10.10.0.0 and 10.10.0.63 here, but 10.10.0.64 is a perfectly normal host address in a /24.

VLSM: right-sized subnets

Real networks are not all the same size. VLSM (variable length subnet masks) gives each one only what it needs. Say one /24 must hold LANs of 100, 50 and 20 hosts and two router-to-router links. ipcalc -s does the planning, biggest first:
h1$ ipcalc 10.10.0.0/24 -s 100 50 20 2 2
1. Requested size: 100 hosts
Network:   10.10.0.0/25         HostMin: 10.10.0.1    HostMax: 10.10.0.126  Broadcast: 10.10.0.127  Hosts/Net: 126
2. Requested size: 50 hosts
Network:   10.10.0.128/26       HostMin: 10.10.0.129  HostMax: 10.10.0.190  Broadcast: 10.10.0.191  Hosts/Net: 62
3. Requested size: 20 hosts
Network:   10.10.0.192/27       HostMin: 10.10.0.193  HostMax: 10.10.0.222  Broadcast: 10.10.0.223  Hosts/Net: 30
4. Requested size: 2 hosts
Network:   10.10.0.224/30       HostMin: 10.10.0.225  HostMax: 10.10.0.226  Broadcast: 10.10.0.227  Hosts/Net: 2
5. Requested size: 2 hosts
Network:   10.10.0.228/30       HostMin: 10.10.0.229  HostMax: 10.10.0.230  Broadcast: 10.10.0.231  Hosts/Net: 2

Needed size:  232 addresses.
Used network: 10.10.0.0/24
Unused:
10.10.0.232/29
10.10.0.240/28
(each subnet is printed in full by ipcalc, with the binary columns; shortened here to one line.)
Biggest first matters: a /25 must start on a multiple of 128, a /26 on a multiple of 64, and so on. Placing the big ones first means every subnet lands on its boundary with no holes. The leftover /29 and /28 are free for later.
A link between two routers needs exactly two addresses. A /30 has four: network, two hosts, broadcast. A /31 has two and no network or broadcast at all (RFC 3021, made for point-to-point links):
h1$ ipcalc 10.10.0.224/30
Network:   10.10.0.224/30       00001010.00001010.00000000.111000 00
HostMin:   10.10.0.225          00001010.00001010.00000000.111000 01
HostMax:   10.10.0.226          00001010.00001010.00000000.111000 10
Broadcast: 10.10.0.227          00001010.00001010.00000000.111000 11
Hosts/Net: 2                     Class A, Private Internet

h1$ ipcalc 10.10.0.224/31
Network:   10.10.0.224/31       00001010.00001010.00000000.1110000 0
HostMin:   10.10.0.224          00001010.00001010.00000000.1110000 0
HostMax:   10.10.0.225          00001010.00001010.00000000.1110000 1
Hosts/Net: 2                     Class A, Private Internet, PtP Link RFC 3021
We tried a /31 on r1's second port: r1 (FRR) took 10.10.0.224/31, h5 (Linux) took 10.10.0.225/31, and they pinged each other:
h5$ ping -c2 -W1 10.10.0.224
64 bytes from 10.10.0.224: icmp_seq=1 ttl=64 time=0.097 ms
64 bytes from 10.10.0.224: icmp_seq=2 ttl=64 time=0.087 ms
Cisco IOS accepts /31 on point-to-point links too (with a warning on Ethernet). /30 is still common because every device understands it.

The cheat table

Python's ipaddress module printed the sizes from /24 to /32 (in a /31 and /32 every address is usable):
h1$ python3 -c 'import ipaddress as i
for p in range(24,33):
  n=i.ip_network(f"10.10.0.0/{p}"); print(f"/{p:<3}{str(n.netmask):17}{n.num_addresses:>4} addresses {max(n.num_addresses-2,0) if p<31 else n.num_addresses:>4} hosts")'
/24 255.255.255.0     256 addresses  254 hosts
/25 255.255.255.128   128 addresses  126 hosts
/26 255.255.255.192    64 addresses   62 hosts
/27 255.255.255.224    32 addresses   30 hosts
/28 255.255.255.240    16 addresses   14 hosts
/29 255.255.255.248     8 addresses    6 hosts
/30 255.255.255.252     4 addresses    2 hosts
/31 255.255.255.254     2 addresses    2 hosts
/32 255.255.255.255     1 addresses    1 hosts
The pattern: each step down halves the subnet. Addresses = 2 to the power of (32 - prefix). Hosts = addresses - 2. Block size = 256 - last mask number. Above /24 the same rules apply to the third number (a /23 is 512 addresses, 10.10.0.0 to 10.10.1.255).

IPv6 in one minute

IPv6 addresses are 128 bits, and the rule is simpler: a LAN is always a /64. A site usually gets a /48 and hands out /64s from it:
h1$ python3 -c 'import ipaddress as i
n=i.ip_network("2001:db8:10::/48"); s=list(n.subnets(new_prefix=64)); print(len(s), "x /64:", s[0], s[1], "...", s[-1]); print(i.ip_network("2001:db8:10:1::/64").num_addresses)'
65536 x /64: 2001:db8:10::/64 2001:db8:10:1::/64 ... 2001:db8:10:ffff::/64
18446744073709551616
65,536 LANs, each with 18 quintillion addresses: nobody counts hosts in IPv6. You just number the subnets (the fourth group, :0: to :ffff:). There is no broadcast address in IPv6 either. (2001:db8::/32 is the range reserved for documentation.)

Save it

The host addresses above were typed with ip and vanish on a restart (on a real Ubuntu host they go in netplan). The router keeps its configuration with write memory:
r1# write memory
Note: this version of vtysh never writes vtysh.conf
Building Configuration...
Configuration saved to /etc/frr//mgmtd.conf
Configuration saved to /etc/frr/zebra.conf
Configuration saved to /etc/frr/staticd.conf

r1$ grep -v ^! /etc/frr/mgmtd.conf
frr version 10.7.1_git
frr defaults traditional
hostname r1
interface eth1
 ip address 10.10.0.1/26
 ip address 10.10.0.65/26
exit
interface eth2
 ip address 10.10.0.129/26
exit
New in FRR 10: the interface addresses are kept in mgmtd.conf, not zebra.conf (which only has the hostname here). Cisco IOS: copy running-config startup-config.

Build the same lab yourself

You need Docker and ContainerLab (one command from containerlab.dev). Build the host image:
FROM ubuntu:24.04
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends iproute2 iputils-ping ipcalc tcpdump traceroute python3-minimal && rm -rf /var/lib/apt/lists/*
CMD ["sleep","infinity"]
$ docker build -t net101-host:24.04 .
$ containerlab deploy -t net101.clab.yml
$ docker exec -it clab-net101-h1 bash          (a shell on h1)
$ docker exec -it clab-net101-r1 vtysh         (the router's Cisco-like shell)
$ containerlab destroy -t net101.clab.yml      (remove everything)
If deploy fails with a network overlap, change the mgmt ipv4-subnet to a range that is free on your machine. Without docker build you can use any image with ip and ping; ipcalc is also easy to run on your own Linux desktop (apt install ipcalc).

Cheat sheet: Linux, FRR and Cisco IOS

Task                          Linux host / FRR                               Cisco IOS
address on an interface       ip addr add 10.10.0.10/26 dev eth1             ip address 10.10.0.10 255.255.255.192
second address                ip address 10.10.0.65/26 (FRR, again)          ip address 10.10.0.65 255.255.255.192 secondary
show addresses                ip -br addr / show interface brief             show ip interface brief
connected routes              ip route / show ip route connected             show ip route connected
default gateway (host)        ip route add default via 10.10.0.1             ip default-gateway 10.10.0.1 (switch)
neighbor (ARP) table          ip neigh                                       show arp
stop ICMP redirects           sysctl net.ipv4.conf.eth1.send_redirects=0     no ip redirects
plan subnets                  ipcalc 10.10.0.0/24 /26, ipcalc NET -s 100 50   (no built-in tool)
save                          write memory                                   copy running-config startup-config
(Cisco column: standard IOS syntax, for reference; not run in this lab.)

Common problems

ping: connect: Network is unreachable: the host has no route for that address; it is outside the host's subnet and there is no default gateway.
Destination Host Unreachable from your own address: the host thinks the target is local and nobody answers its ARP. Often a mask that is too big.
Pings work one way, or with ttl=63 to a "neighbour": the two hosts disagree about the mask. Compare ip route on both.
Error: Nexthop has invalid gateway: the gateway is not inside any subnet of the host. Check the mask and the gateway's address.
Redirect Host messages: the router sends traffic back out of the port it came in on, usually two subnets on one wire. Use VLANs, or turn redirects off.
Do you want to ping broadcast? You pinged the broadcast address of the subnet: the last one in the block.

What's next

Next in Networking 101: VLANs, so each subnet gets its own broadcast domain on the switch, then ARP and the MAC table, on the way to a CCNA study series.
Already know subnetting? The Routing series moves packets between these networks: Routing 1: Static Routes, Routing 2: OSPF, Routing 3: BGP.