Menu
Coddy logo textTech

Cables

Lesson 2 of 35 in Coddy's LAN Labs course.

Two hosts in the same room cannot talk until something connects them. On a LAN that something is usually a switch: a box with many ports that forwards traffic between the devices plugged into it.

netlab add switch NAME adds one, and netlab link A B runs a cable between two devices. netlab names the ends for you: a host has a single interface, eth0; a switch hands out port1, port2, and so on in the order you plug things in.

netlab show now lists, for every device, what it is cabled to.

challenge icon

Challenge

Beginner

The lab already has pc1 and pc2. Add a switch named sw1, cable both hosts to it (pc1 first), and show the lab.

Expected output:

Added switch sw1
Linked pc1 (eth0) <-> sw1 (port1)
Linked pc2 (eth0) <-> sw1 (port2)
NODE  TYPE    LINKS
pc1   host    sw1
pc2   host    sw1
sw1   switch  pc1, pc2

Try it yourself

Terminal

All lessons in LAN Labs

Practice on your own: Terminal playground