Lessons · Network switches · the management interface
A switch does not have an IP address, a VLAN does
The management address lives on a virtual interface named after a VLAN, `interface vlan 1`, not on any physical port.
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 explains something that confuses everyone at the start: there is no port you can give an address to. The address belongs to a VLAN, and it is reachable from any port in that VLAN.
How to think about it
Pick the VLAN you manage the switch from, go into `interface vlan <n>`, and put the address there. That is the whole model.
Worked example
enableThe # prompt.
configure terminalInto configuration mode.
interface vlan 1Not a physical port: the switch's own presence in VLAN 1. The prompt becomes (config-if)# just the same.
ip address 172.20.4.7 255.255.252.0The switch is now a host in that VLAN, at that address. The mask is part of it: the switch will not take an address without one.
endOut.
show ip interface briefVlan1 has the address; every Gi port says unassigned, because a switch port never has one.
Your turn
Enter the virtual interface for VLAN 1.
interface 1
Console into a switch
The trap
Trying `interface gi0/1` and then `ip address`. A switch port has no IP configuration to set, and the command is not there.