Skip to main content

Inter-VLAN using L3 Switching on GNS3


Wow, I am not aware it's almost a month since my last post here. I've been busy with other stuffs, sending out applications, getting interviewed, etc. I'm counting down the days towards graduation and hopefully my CCNA exam. After that, I think I can really focus all my energy in finding that networking job.

I don't usually write a post unless I have an inspiration for it and for this post, I got the inspiration from the 8th nugget of CCNA Labs – Cisco for the Real World. I am going to setup Inter-VLAN not with router-on-a-stick but with Layer 3 switching.  This is the topology:




The switches in the topology are actually 3725 routers with a 16-port EtherSwitch module. This is how you emulate switches in GNS3. For the IOS, I am using c3725-advipservicesk9-mz.124-3 which I have been using in my labs. I changed the icon so that I can really feel that I am configuring switches and not routers.

There are 3 VLANS:  VLAN 10 on SW2, VLAN 20 on SW3 while VLAN 30 is the Management VLAN on all switches. SW1 is our Layer 3 switch while SW2 and SW3 are access layer switches. To create VLANS on our switches, we need to use vlan database mode which is the older way of creating VLANS. I actually didn’t know about vlan database until last week after reading on some chapters of Network Warrior.

Prepare the topology
VLAN 10 : 192.168.10.0/24
VLAN 20 : 192.168.20.0/24
VLAN 30 : 192.168.30.0/24

PC1
IP address : 192.168.10.2/24
Gateway : 192.168.10.1

PC2
IP address : 192.168.20.2/24
Gateway : 192.168.20.1

So to start let us now create the VLANS on each switch:

SW1#vlan database
SW1(vlan)#vlan 10
VLAN 10 added:
    Name: VLAN0010
SW1(vlan)#vlan 20
VLAN 20 added:
    Name: VLAN0020
SW1(vlan)#vlan 30 name Management
VLAN 30 added:
    Name: Management
SW1(vlan)#exit
APPLY completed.
Exiting....

SW2#vlan database
SW2(vlan)#vlan 10
VLAN 10 added:
    Name: VLAN0010
SW2(vlan)#vlan 30 name Management
VLAN 30 added:
    Name: Management
SW2(vlan)#exit
APPLY completed.
Exiting....

SW3#vlan database
SW3(vlan)#vlan 20
VLAN 20 added:
    Name: VLAN0020
SW3(vlan)#vlan 30 name Management
VLAN 30 added:
    Name: Management
SW3(vlan)#exit
APPLY completed.
Exiting....


For the port assignments, Fa1/0 to Fa1/4 will be configured as trunk ports on all switches. While Fa1/5 to Fa1/10 will be on VLAN 10 on SW2 and VLAN 20 on SW3. The remaining ports are left to their default switchport mode and VLAN.

Setting the trunk ports on SW1:
SW1(config)#int range fa1/0 - 4
SW1(config-if-range)#switchport mode trunk


Assigning Fa1/5 to Fa1/10 to VLAN 10 on SW2:
SW2(config)#int range fa1/5 - 10
SW2(config-if-range)#switchport mode access
SW2(config-if-range)#switchport access vlan 10


We need to configure the management interfaces which belongs to VLAN 30 on SW2 and SW3
SW2(config)#interface vlan 30
SW2(config-if)#ip address 192.168.30.2 255.255.255.0
SW2(config-if)#exit
SW2(config)#ip default-gateway 192.168.30.1
SW2(config)#no ip routing

SW3(config)#interface vlan 30
SW3(config-if)#ip address 192.168.30.3 255.255.255.0
SW3(config-if)#exit
SW3(config)#ip default-gateway 192.168.30.1
SW3(config)#no ip routing

The command ip default-gateway allows the switches to be reached by other subnets on another VLAN and no ip routing allows the default gateway to be used.

At this point, PC1 and PC2 cannot communicate with each other yet. For that to happen we need to configure virtual interfaces on the Layer 3 switch which is SW1.

SW1(config)#interface vlan 10
*Mar  1 00:16:54.123: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up
SW1(config-if)#ip add 192.168.10.1 255.255.255.0
SW1(config-if)#exit
SW1(config)#interface vlan 20
*Mar  1 00:17:07.523: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up
SW1(config-if)#ip add 192.168.20.1 255.255.255.0
SW1(config-if)#exit
SW1(config)#interface vlan 30
*Mar  1 00:18:09.587: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan30, changed state to up
SW1(config-if)#ip add 192.168.30.1 255.255.255.0


To check connectivity, let's ping PC2 from PC1:
VPCS[1]> ping 192.168.20.2
192.168.20.2 icmp_seq=1 timeout
192.168.20.2 icmp_seq=2 ttl=63 time=15.000 ms
192.168.20.2 icmp_seq=3 ttl=63 time=64.000 ms
192.168.20.2 icmp_seq=4 ttl=63 time=49.000 ms
192.168.20.2 icmp_seq=5 ttl=63 time=22.000 ms


Now the management interface of SW2:
VPCS[1]> ping 192.168.30.2
192.168.30.2 icmp_seq=1 timeout
192.168.30.2 icmp_seq=2 timeout
192.168.30.2 icmp_seq=3 ttl=254 time=34.000 ms
192.168.30.2 icmp_seq=4 ttl=254 time=33.000 ms
192.168.30.2 icmp_seq=5 ttl=254 time=29.000 ms


Comments