Hone

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

enable
The # prompt.
configure terminal
Into configuration mode.
hostname WAREHOUSE-1
Name first, so every later line says which box you are on.
vlan 15
The VLANs, before any port is put in one.
name PICKERS
Named.
exit
Out.
interface gi0/2
Then the ports.
switchport mode access
Access.
switchport access vlan 15
In the VLAN that now really exists.
exit
Out.
interface gi0/1
Then the uplink.
description Uplink to CORE
Labelled.
switchport mode trunk
Trunked.
exit
Out.
interface vlan 1
Then management.
ip address 10.90.1.4 255.255.255.0
An address to reach it on.
exit
Out of the interface.
ip default-gateway 10.90.1.1
And a way to answer from another subnet.
end
Out.
write memory
Last, 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 

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.

Practise building one out on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.