Hone

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

enable
The # prompt.
configure terminal
Into configuration mode.
interface vlan 1
Not 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.0
The 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.
end
Out.
show ip interface brief
Vlan1 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

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.

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