Build the idea first, then use the next activity to check it.
Hosts, switches and routers
The three devices you will meet in every lab, and the one decision each of them makes.
What you will be able to do
- Say what decision a switch makes and what decision a router makes
- Explain why a switch cannot move traffic between two networks
- Check whether an interface is up before suspecting anything else
Before this: You should know what a network is and why devices need addresses - see "What is a network?".
Why it matters: Most beginner troubleshooting goes wrong by suspecting the complicated device first. Knowing which device is even capable of the decision you are missing tells you where to look.
Three kinds of device show up in almost every network. Each one makes exactly one kind of decision, and knowing which is which turns troubleshooting from guessing into elimination.
The host
A host is an endpoint - a laptop, a server, a phone. It originates traffic and receives it, but it does not forward traffic for anyone else. A host makes one decision about every packet it sends: is the destination on my own network, or not? If it is, send it directly. If it is not, send it to the gateway.
The switch
A switch connects devices that are on the same network. It looks at the hardware address on each frame and forwards it out the port where that device lives. It is fast, and it is deliberately simple: a switch does not know or care about IP addresses or networks.
The router
A router connects different networks to each other. For every packet it receives, it looks at the destination address, consults its routing table, and forwards the packet toward the next device on the path. A router is the only one of the three that knows about more than one network at a time.
| Device | The decision it makes | What it looks at |
|---|---|---|
| Host | Is this destination local, or do I hand it to my gateway? | Its own address and subnet mask |
| Switch | Which port is this hardware address on? | The frame's MAC address |
| Router | Which network is this destination in, and who is next? | Its routing table |
Before you suspect anything, check the link
An interface that is administratively down carries no traffic at all, no matter how correct everything else is. It is the cheapest thing to check and one of the most common faults, so check it first. On the Linux-based routers these labs run, one command shows you every interface and its state.
ip -brief link show
# eth0 UP 52:54:00:11:22:33 <BROADCAST,MULTICAST,UP,LOWER_UP>
# eth1 DOWN 52:54:00:11:22:34 <BROADCAST,MULTICAST>
An interface reading DOWN when it should be carrying traffic is your fault, and you have found it in one command. Bringing it back up is one more.
ip link set eth1 up
Terminology
- Interface
- A single network connection on a device. A router has several; a laptop usually has one or two.
- Gateway
- The router a host sends traffic to when the destination is not on its own network.
- Administratively down
- An interface that is switched off in configuration rather than broken - it carries no traffic until someone brings it up.
Key takeaways
- A host decides local or not-local; a switch decides which port; a router decides which network.
- A switch cannot connect two different IP networks - only a router can.
- Check interface state first, because a down interface defeats every other correct setting.
- `ip -brief link show` tells you the state of every interface in one line each.
Ready to keep going?
Create a free account to save your progress and take the knowledge check.
