One of the questions I've received is how to configure a layer 3 switch in GNS3. For
this demonstration.
I'm gonna use an IOS V layer 2 switch the IOS V Layer 2 supports both Layer 2 as well as Layer
3 switching what I'll also do is use two routers as PCs in the topology these devices take a while to boot
up.
So I'll start them and open up console's to them.
As you can see in the output here we've got IOS V booting on the three devices.
What I'll do now is connect the routers to the switch.
So at the moment we've got two routers connected to this layer 3switch, the routers in this example are
acting as PCs. So I'm simply gonna use them to demonstrate VLANs and layer 3 configuration on this
layer 3 switch.
The focus of this video will be the configuration of VLANs on the switch and the configuration of
inter VLAN routing.
In other words, getting the switch to act as a layer 3 device so the switch is booted up show IP interface
brief.
There are various interfaces available on the switch.
Show VLAN brief shows us that only the default VLAN exist on the switch.
So what I'll do is give the switch a name switch 1 and then I'll create two VLANs on the switch.
So show VLAN brief we've got VLAN 1, VLAN 2 and VLAN 3 configured on the switch
at the moment.
The routers are booted so I'll bypass the initial config on those two routers acting as our PCs in the topology.
Now notice show interface gigabit 00 switch port.
This port is in VLAN 1 that's the default.
The same is true for the second port.
What we'll do however is configure gigabit 00 to be in VLAN 2 and gigabit
01 will be put into VLAN 3. So now show interface gigabit 00 switch port
shows us that gigabit 00 is in VLAN 2 and gigabit 01 is in VLAN 3. Show IP route on the switch
shows us that IP routing is enabled.
If I disable IP routing and use the command show IP route notice the output is very different to when
IP routing is enabled.
Now in these IOS V layer 2 switches IP routing is enabled by default but it's often not enabled
on real physical switches. So to enable inter VLAN routing or layer 3 functionality we need to have
the IP routing command enabled on the switch. Show IP interface brief shows us the physical interfaces
to enable inter VLAN routing between the VLANs we need to configure IP addresses in the relevant
VLANs on what are called switch virtual interfaces or SVIs. So on both VLAN 2
and VLAN 3 we need to configure IP addresses in the relevant subnet.
So show IP interface brief we can see that an IP address is configured in VLAN 2 and on VLAN
3 I need to no shut those SVIs.
So now show IP interface brief we can see that those two SVIs or Layer 3 interfaces for the VLANs
are configured and the SVIs are up.
That's how you configure a switch for inter VLAN routing and layer 3 functionality.
So on the router acting as a PC, I can no shut the interface and give it an IP address in the VLAN such
as the following.
I'll disable IP routing on the router and configure an IP default gateway of 10.1.2.254.
So show IP route on the router shows us that IP routing is disabled. Can we ping the default gateway?
Yes, we can. On this side we'll do something similar.
So CONFT host router 2, interface could give 00, no shut IP address 10 131 255 255 255 0
no IP routing to disable routing and make this act like a PC IP default gateway 10 13 254 ping
10 13 254, so router 2 can ping it's default gateway.
So what we should be able to do now is ping router 2 from router 1 which we can and to prove that, I'll do a de-bug
IP ICMP on the side and ping the router from router 2 and you can see that the pings arrived
echo reply was sent.
So now if we disable IP routing on the layer 3 switch what will happen is the pings no longer work
because the switch is no longer acting as a layer 3 switch, layer 3 capability has been disabled
on the switch. Enable IP routing and routing takes place and pings can be sent from one router to the
other.
So router 2 can ping router 1 and router 1 can ping router 2.
So that was a simple example of how to enable inter VLAN routing on a switch.
In other words make it act as a layer 3 switch.
I hope you enjoyed this video if it's been of benefit to you
Please like it, please subscribe to my Youtube channel
I wish you all the very best.