Lessons · Network switches · making it reachable
The four things that make a switch reachable
An address on a VLAN interface, a default gateway, a port in that VLAN that is up, and a saved configuration. Miss any one and it is a console-only box.
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
'I configured the IP and I still cannot ping it' is almost always one of the other three, and going through them in order is faster than guessing.
How to think about it
Address, gateway, path, save. Check them in that order every time, because each one is meaningless without the one before it.
Worked example
enableThe # prompt.
configure terminalInto configuration mode.
hostname IDF4Name it first, so you know which box you are on.
interface vlan 1One: the management interface.
ip address 10.20.0.9 255.255.255.0An address on the management network.
exitOut of the interface.
ip default-gateway 10.20.0.1Two: replies from other subnets have a way home.
interface gi0/1Three: a port in that VLAN, for the cable to the rest of the network.
switchport mode accessAccess.
switchport access vlan 1In the management VLAN.
no shutdownAnd up.
endOut.
show ip interface briefVlan1 has the address and Gi0/1 is not administratively down. That is the path.
write memoryFour. Without this the whole thing is gone at the next power cut.
Your turn
Make sure the port is not administratively down.
no
Console into a switch
The trap
Configuring all of it on a switch whose only cable is in a different VLAN. The address is correct, the gateway is correct, and there is still no path to either.