Inter-VLAN Routing on IOS L2 switches GNS3

Posted: April 26, 2016 in CISCO

How to configure IOS on GNS3:http://letusexplain.blogspot.rs/2015/07/cisco-iou-l2-l3-lab-with-gns3-switching.html

 

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

Untitled.png

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

ISP:

 

interface Loopback0
ip address 200.200.200.1 255.255.255.0
!
interface Serial1/0
ip address 192.168.1.2 255.255.255.252
ip route 172.16.0.0 255.255.0.0 192.168.1.1

 

GATEWAY

Created subinterface for VLAN 1,100 and 200

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

 

SW1:

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 0.0.0.0 0.0.0.0 172.16.1.1 !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:

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 0.0.0.0 0.0.0.0 172.16.1.1

PC1 Default gateway is 172.16.100.1 and for PC2 172.16.200.1

 

 

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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