In this lesson, we will learn to configure a multilayer switch (also called Layer 3 switch) to perform inter-VLAN routing, which was previously done using an actual router. Multilayer switches can forward frames based on MAC address information and can also forward IP packets based on IP destination. That is why they are also referred to as Layer 3 switches.

Multilayer Switches

A switch is a device that typically operates at layer 2 of the OSI model. It inspects frames and switches them between interfaces based on MAC addresses found in the Ethernet header. This type of device is referred to as just a switch or a Layer 2 switch. It does not look deeper than the Ethernet header and does not make any decisions based on information in the IP header. Routers on the other hand strip the Ethernet header of frames and look at the packet in the frame's payload. They make routing decisions based on the IP addresses found in the Layer 3 header and place a new Ethernet header before switching the frame out another interface. 

A multilayer switch can perform both functions explained above at incredibly fast speeds. They can switch frames as a regular switch and can perform IP routing as a router. So therefore they can perform functions at layer 2 of the OSI model as well as at layer 3. That is why they are called Multilayer Switches or Layer 3 switches.

If we look closer at the topology shown in figure 1, note that we have four clients in Vlan 10 and four servers in Vlan 20. If you remember that a Vlan is a separate broadcast domain and a different subnet. Therefore, for clients in VLAN 10 to able to communicate with the Servers in VLAN20, IP routing is required.

Layer 3 switching physical diagram
Figure 1. Layer 3 switching physical diagram

As you know from the previous two examples of Inter-VLAN routing, the router that is don't the inter-vlan routing has a routing interface in each broadcast domain. This routing interface has an IP address from the respective subnet and this IP is used by the nodes in the vlan as a Default Gateway. But in the case of a MultiLayer switch doing the inter-vlan routing, we do not have a router nor any routing interfaces. That is why Layer 3 switches use the concept of a virtual Vlan interface that connects the broadcast domain of a vlan to the routing process as shown in Figure 2.

Layer 3 Switch Virtual interfaces
Figure 2. Layer 3 Switch Virtual interfaces

A virtual interface is created using the following command:

L3Switch(config)#interface Vlan10

%LINK-5-CHANGED: Interface Vlan10, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up

 Once the interface is defined, we configure the IP parameters under the interface configuration mode. 

Layer 3 switching traffic path
Figure 3. Layer 3 switching traffic path

cxzczxcz

Physical diagram

In this lesson, we will learn to configure a multilayer switch (also called Layer 3 switch) to perform inter-VLAN routing, which was previously done using an actual router. Multilayer switches can forward frames based on MAC address information and can also forward IP packets based on IP destination. That is why they are also referred to as Layer 3 switches.

Shown in figure 1 is our physical topology. Note that there is no router present because the switch itself will perform the Inter-VLAN routing.

Layer 3 switching physical diagram
Figure 4. Layer 3 switching physical diagram

Configuring the switch

Let's first see all available interfaces on the switch. Note that the ports where we have connected devices are up/up, all other switch ports are down/down.

L3Switch#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol 
FastEthernet0/1        unassigned      YES unset  up                    up FastEthernet0/2        unassigned      YES unset  up                    up FastEthernet0/3        unassigned      YES unset  up                    up FastEthernet0/4        unassigned      YES unset  up                    up 
FastEthernet0/5        unassigned      YES unset  down                  down 
FastEthernet0/6        unassigned      YES unset  down                  down 
FastEthernet0/7        unassigned      YES unset  down                  down 
FastEthernet0/8        unassigned      YES unset  down                  down 
FastEthernet0/9        unassigned      YES unset  down                  down 
FastEthernet0/10       unassigned      YES unset  down                  down 
FastEthernet0/11       unassigned      YES unset  down                  down 
FastEthernet0/12       unassigned      YES unset  down                  down 
FastEthernet0/13       unassigned      YES unset  down                  down 
FastEthernet0/14       unassigned      YES unset  down                  down 
FastEthernet0/15       unassigned      YES unset  up                    up FastEthernet0/16       unassigned      YES unset  up                    up FastEthernet0/17       unassigned      YES unset  up                    up FastEthernet0/18       unassigned      YES unset  up                    up 
FastEthernet0/19       unassigned      YES unset  down                  down 
FastEthernet0/20       unassigned      YES unset  down                  down 
FastEthernet0/21       unassigned      YES unset  down                  down 
FastEthernet0/22       unassigned      YES unset  down                  down 
FastEthernet0/23       unassigned      YES unset  down                  down 
FastEthernet0/24       unassigned      YES unset  down                  down 
GigabitEthernet0/1     unassigned      YES unset  down                  down 
GigabitEthernet0/2     unassigned      YES unset  down                  down 
Vlan1                  unassigned      YES unset  administratively down down

Let's create two VLANs - VLAN10 (Clients) and VLAN20 (Servers) and assign the interfaces to the respective VLANs.

L3Switch(config)#vlan 10
L3Switch(config-vlan)#name CLIENTS
L3Switch(config-vlan)#exit
!
L3Switch(config)#vlan 20
L3Switch(config-vlan)#name SERVERS
L3Switch(config-vlan)#exit

dasdas

L3Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.

L3Switch(config)#int range fastEthernet 0/1 - 4
L3Switch(config-if-range)#switchport access vlan 10
L3Switch(config-if-range)#exit
L3Switch(config)#int range fastEthernet 0/15 - 18
L3Switch(config-if-range)#switchport access vlan 20
L3Switch(config-if-range)#end

L3
Switch#sh vlan brief
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                Fa0/13, Fa0/14, Fa0/19, Fa0/20
                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24
                                                Gig0/1, Gig0/2
10   CLIENTS                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/420   SERVERS                          active    Fa0/15, Fa0/16, Fa0/17, Fa0/18
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active    

Configuring the switch's ip routing functionality

dsdasda

L3Swtich#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.

L3Swtich(config)#interface Vlan10
%LINK-5-CHANGED: Interface Vlan10, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up
L3Swtich(config-if)#description CLIENTS
L3Swtich(config-if)#ip address 192.168.1.1 255.255.255.0
L3Swtich(config-if)#exit

L3Swtich(config)#interface Vlan20
%LINK-5-CHANGED: Interface Vlan20, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up
L3Swtich(config-if)#description SERVERS
L3Swtich(config-if)#ip address 10.1.0.1 255.255.255.0
L3Swtich(config-if)#end

gdgfdgd

Now the switch has routing interfaces in both VLANs and has both subnets in its routing table shown as Connected.

L3Switch# show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 1 subnets
C    10.1.0.0 is directly connected, Vlan20
C    192.168.1.0/24 is directly connected, Vlan10