Lessons · Network switches · building one out
Building a switch out from nothing
A switch going into service needs a name, its VLANs, its ports assigned, its uplink trunked, an address to manage it, and a save. In that order.
Hone is a place to practise programming. This is one of its lessons, written out in full and free to read without an account.
What it is for
It is the job. Every other lesson here is one piece of it, and doing them in a fixed order is what stops you finding, at the end, that the VLAN you assigned did not exist.
How to think about it
Name, VLANs, ports, uplink, management, save. Each step depends on the one before it, which is why the order is not a preference.
Worked example
enableThe # prompt.
configure terminalInto configuration mode.
hostname WAREHOUSE-1Name first, so every later line says which box you are on.
vlan 15The VLANs, before any port is put in one.
name PICKERSNamed.
exitOut.
interface gi0/2Then the ports.
switchport mode accessAccess.
switchport access vlan 15In the VLAN that now really exists.
exitOut.
interface gi0/1Then the uplink.
description Uplink to CORELabelled.
switchport mode trunkTrunked.
exitOut.
interface vlan 1Then management.
ip address 10.90.1.4 255.255.255.0An address to reach it on.
exitOut of the interface.
ip default-gateway 10.90.1.1And a way to answer from another subnet.
endOut.
write memoryLast, and never optional: everything above is in memory until this runs.
Your turn
Save the whole build so a power cut does not undo it.
write
Console into a switch
The trap
Assigning ports before creating the VLANs. The switch creates them for you, with names like VLAN0015, and the network you end up with is not the one on the plan.