The Networking Picture Book
Internet R1 · NAT · OSPF SW1 · VLANs VLAN 10 · Staff VLAN 20 · Servers
PLATE 0 — The network you'll have built by the last page.
A picture book for grown-ups · with configs

How Networks Work, and How to Configure One

Eleven spreads. Each one has a picture, the theory, and the Cisco IOS commands you'd type into a real router or switch, or into Packet Tracer.

Say it like a pro

"It's a collapsed-core design: VLANs on an access switch, 802.1Q trunk to a router-on-a-stick, OSPF to the edge, PAT out to the ISP, and ACLs locking down the server VLAN."

Every word in that sentence gets its own page. Use the tabs or the ← → keys.

7 Application 6 Presentation 5 Session 4 Transport 3 Network 2 Data Link 1 Physical "All People Seem To Need Data Processing" FRAME · MAC src/dst · FCS PACKET · IP src/dst · TTL SEGMENT · ports 51000→443 DATA GET /index.html each layer wraps the one above
PLATE 1 — Envelopes inside envelopes. Routers read the blue one, switches the green one.
Chapter 1 · The layers

OSI and TCP/IP: who reads which label

Sending data means wrapping it in headers, one layer at a time (encapsulation). Each device only opens the envelope it cares about.

LayerUnitAddressDeviceExamples
7 AppdataURLhostHTTP, DNS, SSH
4 TransportsegmentportfirewallTCP, UDP
3 NetworkpacketIProuterIPv4, IPv6, ICMP
2 Data linkframeMACswitchEthernet, 802.1Q
1 Physicalbitsnonecable, hubCat6, fiber, Wi-Fi radio
TCP
reliable, ordered; 3-way handshake SYN → SYN-ACK → ACK
UDP
fire and forget; DNS, VoIP, streaming
ports
22 SSH · 53 DNS · 67/68 DHCP · 80 HTTP · 443 HTTPS · 3389 RDP
Say it like a pro

"That's a layer-2 problem: the IP config is fine, but the port's in the wrong VLAN."

192.168.10.77 /24 NETWORK · 192.168.10 HOST · 77 the street (24 bits) the house (8 bits) Cut the /24 into four /26 blocks .0/26hosts .1–.62bcast .63Staff .64/26.65–.126bcast .127Servers .128/26.129–.190bcast .191Guest .192/26.193–.254bcast .255spare mask 255.255.255.192 · block size 64 · 62 usable each usable = 2^(host bits) − 2
PLATE 2 — The mask decides where the street ends and the house number begins.
Chapter 2 · IP addressing & subnetting

Addresses, masks, and the magic number

An IPv4 address is 32 bits. The prefix (/24) says how many bits name the network. Hosts on the same network talk directly; anything else goes to the default gateway.

PrefixMaskBlockUsable
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/30255.255.255.25242 (router links)

Subnet in your head

  1. Block size = 256 − the interesting mask octet (256 − 192 = 64).
  2. Subnets start at multiples of the block: .0, .64, .128, .192.
  3. First usable = network + 1. Broadcast = next network − 1.
private
10.0.0.0/8 · 172.16.0.0/12 · 192.168.0.0/16
IPv6
128 bits, e.g. 2001:db8:10::1/64; no NAT needed
APIPA
169.254.x.x = DHCP failed
SW1G0/1 trunk 123 VLAN 10 Staff VLAN 20 Srv VLAN 30 Guest MAC address table VLAN MAC PORT 10 0050.7966.6801 Fa0/1 20 0060.2f4a.1102 Fa0/11 learned from source MACs
PLATE 3 — One box, several separate networks. VLANs can't see each other without a router.
Chapter 3 · Switching & VLANs (layer 2)

Carving one switch into private rooms

A switch learns which MAC lives on which port and forwards frames only there. A VLAN is a separate broadcast domain on the same hardware: one subnet per VLAN.

SW1 · create VLANs and assign access ports
Switch> enable
Switch# configure terminal
Switch(config)# hostname SW1
SW1(config)# vlan 10
SW1(config-vlan)# name STAFF
SW1(config-vlan)# vlan 20
SW1(config-vlan)# name SERVERS
SW1(config-vlan)# vlan 30
SW1(config-vlan)# name GUEST
SW1(config-vlan)# exit
SW1(config)# interface range fa0/1 - 10
SW1(config-if-range)# switchport mode access
SW1(config-if-range)# switchport access vlan 10
SW1(config-if-range)# spanning-tree portfast
SW1(config-if-range)# interface range fa0/11 - 15
SW1(config-if-range)# switchport mode access
SW1(config-if-range)# switchport access vlan 20
SW1(config-if-range)# end
SW1# show vlan brief
SW1# show mac address-table
STP
Spanning Tree blocks redundant links so frames don't loop forever
PortFast
skip STP wait on ports with end devices only
R1 G0/0.10 → 192.168.10.1 G0/0.20 → 192.168.20.1 G0/0.30 → 192.168.30.1 tag 10 tag 20 802.1Q trunkone cable,many VLANs SW1 G0/1 .10.11 gw .10.1.30.11 gw .30.1
PLATE 4 — The "router on a stick": tags on the wire, one gateway per VLAN.
Chapter 4 · Trunking & inter-VLAN routing

One cable, many VLANs, and a router to join them

A trunk carries every VLAN, stamping each frame with an 802.1Q tag. To let VLANs talk, a router gets one subinterface per VLAN, which becomes that VLAN's default gateway.

SW1 · uplink to router
SW1(config)# interface g0/1
SW1(config-if)# switchport mode trunk
SW1(config-if)# switchport trunk allowed vlan 10,20,30,99
SW1(config-if)# switchport trunk native vlan 99
SW1# show interfaces trunk
R1 · router-on-a-stick
R1(config)# interface g0/0
R1(config-if)# no shutdown
R1(config-if)# interface g0/0.10
R1(config-subif)# encapsulation dot1Q 10
R1(config-subif)# ip address 192.168.10.1 255.255.255.0
R1(config-subif)# interface g0/0.20
R1(config-subif)# encapsulation dot1Q 20
R1(config-subif)# ip address 192.168.20.1 255.255.255.0
R1(config-subif)# interface g0/0.30
R1(config-subif)# encapsulation dot1Q 30
R1(config-subif)# ip address 192.168.30.1 255.255.255.0
Alternative · layer-3 switch (SVIs)
MLS(config)# ip routing
MLS(config)# interface vlan 10
MLS(config-if)# ip address 192.168.10.1 255.255.255.0
R1 R2 R3 10.0.0.0/30 10.0.0.4/30 10.0.0.8/30 OSPF hello LAN 192.168.10.0/24 LAN 172.16.0.0/24 R1# show ip route C 192.168.10.0/24 directly connected, G0/0 O 172.16.0.0/24 [110/2] via 10.0.0.2, G0/1 S* 0.0.0.0/0 [1/0] via 203.0.113.1
PLATE 5 — Routers swap maps so each one knows the next hop to anywhere.
Chapter 5 · Routing (layer 3)

Getting packets between networks

A router looks up the destination IP in its routing table, picks the most specific match (longest prefix), and forwards to the next hop. Routes come from three places: connected, static, or a dynamic protocol.

Static + default route
R1(config)# ip route 172.16.0.0 255.255.255.0 10.0.0.2
R1(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1  ! to ISP
OSPF single area
R1(config)# router ospf 1
R1(config-router)# router-id 1.1.1.1
R1(config-router)# network 192.168.10.0 0.0.0.255 area 0
R1(config-router)# network 10.0.0.0 0.0.0.3 area 0
R1(config-router)# passive-interface g0/0
R1(config-router)# default-information originate
R1# show ip ospf neighbor
R1# show ip route ospf
AD
trust ranking: connected 0 · static 1 · eBGP 20 · EIGRP 90 · OSPF 110 · RIP 120
wildcard
inverse mask: /24 → 0.0.0.255, /30 → 0.0.0.3
BGP
the internet's routing protocol, between ISPs and big orgs
DHCP · DORA D iscover →← O fferR equest →← A ck .10.11 DNS · phone book www.shop.com A 93.184.216.34 mail.shop.com MX 10 mx1 port 53 · UDP NAT / PAT · one public IP for everyone .10.11:51000.10.12:51000.10.13:49222 inside → outside 203.0.113.5:1024 203.0.113.5:1025 203.0.113.5:1026
PLATE 6 — The badge desk, the phone book, and the receptionist.
Chapter 6 · Network services

DHCP hands out addresses, DNS names them, NAT shares one public IP

R1 · DHCP pool for VLAN 10
R1(config)# ip dhcp excluded-address 192.168.10.1 192.168.10.10
R1(config)# ip dhcp pool STAFF
R1(dhcp-config)# network 192.168.10.0 255.255.255.0
R1(dhcp-config)# default-router 192.168.10.1
R1(dhcp-config)# dns-server 192.168.20.10
R1# show ip dhcp binding
DHCP server on another subnet? relay it
R1(config)# interface g0/0.30
R1(config-subif)# ip helper-address 192.168.20.10
R1 · PAT (NAT overload) to the internet
R1(config)# access-list 1 permit 192.168.0.0 0.0.255.255
R1(config)# interface g0/0.10
R1(config-subif)# ip nat inside       ! repeat on .20 .30
R1(config)# interface g0/1
R1(config-if)# ip address 203.0.113.5 255.255.255.252
R1(config-if)# ip nat outside
R1(config)# ip nat inside source list 1 interface g0/1 overload
R1(config)# ip nat inside source static tcp 192.168.20.10 443 interface g0/1 443
R1# show ip nat translations

DNS itself usually runs on a server (Windows DNS, BIND, Pi-hole). In Packet Tracer: Server → Services → DNS, add an A record.

ACL 110 · top → bottom 10 permit tcp 10.0/24 → srv 443 20 permit udp any → srv 53 30 deny ip 30.0/24 → srv 40 permit ip any any (implicit deny any) guest port-security: max 1 MAC, sticky, violation shutdown SSH only · no telnet · AAA
PLATE 7 — First match wins, and anything not on the list is turned away.
Chapter 7 · Security & ACLs

Deciding who gets through

An ACL is an ordered list of permit/deny rules checked top-down; the first match wins and there's an invisible deny any at the end. Standard ACLs match source only (place near the destination). Extended ACLs match source, destination, protocol and port (place near the source).

R1 · protect the server VLAN
R1(config)# ip access-list extended TO-SERVERS
R1(config-ext-nacl)# permit tcp 192.168.10.0 0.0.0.255 host 192.168.20.10 eq 443
R1(config-ext-nacl)# permit udp any host 192.168.20.10 eq 53
R1(config-ext-nacl)# deny ip 192.168.30.0 0.0.0.255 192.168.20.0 0.0.0.255
R1(config-ext-nacl)# permit ip any any
R1(config)# interface g0/0.20
R1(config-subif)# ip access-group TO-SERVERS out
Device hardening · SSH instead of telnet
R1(config)# enable secret Str0ng!Secret
R1(config)# service password-encryption
R1(config)# ip domain-name corp.local
R1(config)# crypto key generate rsa modulus 2048
R1(config)# username admin privilege 15 secret Adm1n!Pass
R1(config)# line vty 0 4
R1(config-line)# transport input ssh
R1(config-line)# login local
R1(config)# banner motd #Authorized access only#
SW1 · port security + shut unused ports
SW1(config)# interface fa0/1
SW1(config-if)# switchport port-security
SW1(config-if)# switchport port-security maximum 1
SW1(config-if)# switchport port-security mac-address sticky
SW1(config-if)# switchport port-security violation shutdown
SW1(config)# interface range fa0/20 - 24
SW1(config-if-range)# switchport access vlan 999
SW1(config-if-range)# shutdown

The passwords here are examples; use your own.

AP1 SSID CORP → VLAN 10 · WPA3-Ent SSID GUEST → VLAN 30 · WPA2-PSK ch 1 / 6 / 11 (2.4 GHz) to avoid overlap HSRP · two routers, one gateway R1 active .2 R2 standby .3 VIP .10.1 EtherChannel · two cables act as one Po1 · LACP · 2 Gbps
PLATE 8 — No single cable or box should be able to take the office down.
Chapter 8 · Wireless & redundancy

Air, backups, and no single point of failure

Each SSID maps to a VLAN, so Wi-Fi users land in the same subnets as wired ones. Big sites use a WLC (wireless LAN controller) to manage many lightweight APs.

SW1 · port to an AP carrying several SSIDs
SW1(config)# interface fa0/24
SW1(config-if)# switchport mode trunk
SW1(config-if)# switchport trunk allowed vlan 10,30
R1 · HSRP gateway failover (R2 mirrors with priority 100)
R1(config)# interface g0/0.10
R1(config-subif)# ip address 192.168.10.2 255.255.255.0
R1(config-subif)# standby 10 ip 192.168.10.1
R1(config-subif)# standby 10 priority 110
R1(config-subif)# standby 10 preempt
R1# show standby brief
SW1 · EtherChannel with LACP
SW1(config)# interface range g0/1 - 2
SW1(config-if-range)# channel-group 1 mode active
SW1(config)# interface port-channel 1
SW1(config-if)# switchport mode trunk
SW1# show etherchannel summary
L1 lights? cable? up/up? L2 right VLAN? trunk? L3 IP, mask, gateway? routes both ways? ACL? L7 DNS? service running? ping 192.168.10.1 tracert 8.8.8.8 nslookup shop.com climb from the bottom
PLATE 9 — Bottom-up, one rung at a time. Most faults live on rungs 1–3.
Chapter 9 · Troubleshooting

Find the broken rung

  1. Physical. Link lights, right cable, interface not administratively down.
  2. Data link. Port in the right VLAN, trunk allows that VLAN, no err-disabled port.
  3. Network. Host IP, mask, gateway correct; ping the gateway first.
  4. Routing. Route to the destination and a route back. Check ACLs and NAT.
  5. Application. DNS resolves? Service listening on its port?
The commands you'll use every day
R1# show ip interface brief       ! up/up? IPs right?
R1# show running-config
R1# show ip route
R1# show access-lists              ! hit counters
R1# show cdp neighbors              ! who's plugged in
SW1# show interfaces status
SW1# show port-security interface fa0/1
R1# ping 192.168.20.10 source g0/0.10
R1# traceroute 8.8.8.8
R1# copy running-config startup-config   ! SAVE!

C:\> ipconfig /all
C:\> ipconfig /release && ipconfig /renew
C:\> arp -a
up/down
layer-1/2 issue: cable, speed/duplex, or encapsulation mismatch
admin down
you forgot no shutdown
169.254.x.x
host got no DHCP: check VLAN, pool, helper-address
PC .10.11 shop.com 1 2 3 4 1 DNS → IP; ARP for gateway MAC 2 SW1 tags frame VLAN 10 on trunk 3 R1: route lookup, ACL, NAT 192.168.10.11 → 203.0.113.5 4 firewall allows 443 out reply: reverse NAT → back to PC
PLATE 10 — One web request touches every chapter in this book.
Chapter 10 · How it all comes together

Build the cover network in Packet Tracer

  1. Plan the IP scheme: 192.168.10.0/24 Staff, .20 Servers, .30 Guest, 99 native, /30 to the ISP.
  2. Cable PCs → SW1 Fa0/x, SW1 G0/1 → R1 G0/0, R1 G0/1 → ISP.
  3. Switch: VLANs, access ports, trunk (Chapters 3–4).
  4. Router: subinterfaces, DHCP pools, default route or OSPF (4–6).
  5. Edge: PAT out, static NAT for the web server (6).
  6. Lock down: SSH, ACLs, port security, unused ports shut (7).
  7. Test: ipconfig on PCs, ping gateway, ping across VLANs, ping the ISP (9).
  8. Save on every device: copy run start. Document it.
Addressing plan
VLANNameSubnetGatewayDHCP range
10STAFF192.168.10.0/24.1.11–.254
20SERVERS192.168.20.0/24.1static
30GUEST192.168.30.0/24.1.11–.254
99NATIVEno IPnonenone
noneWAN203.0.113.4/30.6 ISPnone
The cheat sentence

"Switches sort by MAC inside VLANs, trunks carry the tags, routers move packets between subnets, DHCP and DNS make it automatic, NAT gets you online, ACLs keep it safe, and show commands tell you what broke."