Inter-VLAN Routing on IOS L2 switches GNS3

Posted: April 26, 2016 in CISCO

How to configure IOS on GNS3:


Inter-VLAN routing is used to route packets between different VLANs.In this example i used Router-on-a-Stick (virtual or logical interfaces-subinterfaces,are used to attach the router to each VLAN


GATEWAY’s f0/0 interface is used to create subintefaces (logical interface) for VLAN’s 1,100 and 200



interface Loopback0
ip address
interface Serial1/0
ip address
ip route



Created subinterface for VLAN 1,100 and 200

interface FastEthernet0/0.1
description management vlan 1
encapsulation dot1Q 1 native
ip address
interface FastEthernet0/0.100
description  vlan 100
encapsulation dot1Q 100
ip address !Default gateway for VLAN 100 hosts
interface FastEthernet0/0.200
description  vlan 100
encapsulation dot1Q 200
ip address !Default gateway for VLAN 200 hosts



Intefaces E0/0,E0/1 and EO/2 are trunk ports (carry all VLAN’s traffic)

But interfaces E0/1 and E0/2 are aggreggated into one logical interface to provide higher aggregated bandwidth, load balancing, and link redundancy (Channel-group1)

interface Ethernet0/0
switchport trunk encapsulation dot1q
switchport mode trunk
SW1(config)#int range e0/1 - 2
SW1(config-if-range)#switchport trunk encapsulation dot1q
SW1(config-if-range)#switchport mode trunk
SW1(config-if-range)#channel-group 1 mode desirable
SW1(config)#vtp domain cisco
SW1(config)#int vlan 100
SW1(config)#int vlan 200
SW1(config)#int e0/3
SW1(config-if)#switchport access vlan 100 !assign vlan 100 to port e0/3
SW1(config-if)#switchport mode access
SW1(config)#ip route !default route via GATEWAY f0/0.1 subinterface

desirable means try and negotiate with the other side (SW2), and if he agrees, then enable the channel


SW2(config)#int range e0/1 - 2
SW2(config-if-range)#switchport trunk encapsulation dot1q
SW2(config-if-range)#switchport mode trunk
SW2(config-if-range)#channel-group 1 mode desirable
SW2(config)#vtp mode client  ! setting SW2 as VTP client ensures that VLAN's 
SW2(config)#vtp domain cisco !100 and 200 are propagated to SW1 from SW2
SW2(config)#int vlan 200
SW2(config)#int e0/3
SW2(config-if)#switchport access vlan 200 !assign vlan 200 to port e0/3
SW2(config-if)#switchport mode access
SW2(config)#ip route

PC1 Default gateway is and for PC2




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s