Layer 2 Switches
These are standard switches that are only able to operate on the Data Link Layer.
Management IP
Layer 2 switches don’t perform packet routing and don’t build a routing table. That creates a problem if we want to configure a Layer 2 switch using Telnet or SSH. Thankfully, there’s a workaround!
We can assign an IP address to a SVI to allow remote connections to the switch’s CLI. SVIs are more commonly used with Layer 3/Multilayer Switches, so read up on them below if you need to.
(config)#interface vlan1
(config-if)#ip address ip-address netmask
(config-if)#no shutdown
(config-if)#exit
- Simply configure an IP address on the SVI as you would on a multilayer switch, and enable the interface if necessary.
(config)#ip default-gateway ip-address
- Configure a default gateway. Depending on the configuration of VLANs, the switch may not be able to communicate with the device trying to configure it without one.
Layer 3/Multilayer Switches
Switches with some IP routing capability. You can sort of think of these as a router with many more interfaces, although they aren’t quite as graceful at IP routing as a dedicated router… You’ll see what I mean when you try configuring one.
The primary reason for multilayer switches is to route traffic between multiple VLANs within a network, without having to use a separate router in a Router-on-a-Stick configuration.
IP Routing
Allows a multilayer switch to route layer 3 traffic through appropriately configured interfaces like a router would.
- enable IP routing with
ip routing
in global configuration - configure interfaces with
no switchport
to use as routed ports (only need this for trunk ports)
SVIs
SVI = Switch Virtual Interface
Use these in a layer 3/multilayer switch to route multiple VLANs through a single trunk port
- Ensure that all necessary VLANs exist on the switch
- check with
show vlan brief
- Create new VLAN(s) with
vlan (vlan-number)
if necessary
- check with
- select the first VLAN as an interface
int (vlan-id)
- assign the VLAN an IP address, typically the last usable in the subnet:
ip address (ip-address)
- repeat for all VLANs