Intervlan is the process of communication between different VLANs.
In this lesson, we will study different methods of intervlan.
- Traditional method
- ROAS (router on a stick)
- SVI (Switch Virtual Interface) method
Traditional Method of Intervlan
This traditional method of intervlan is very simple and easy to understand.
In above topology I created two VLANs, vlan 10 and vlan 20. There are two links between router and switch- one for each vlan.
Objective: PCs of vlan 10 communicate with vlan 20 PCs.
Configuration
Let’s start with router R1.
First we will configure router interfaces and then DHCP pool.
R1 configuration
en
conf t
hostname R1
int fa0/0
ip address 192.168.1.1 255.255.255.0
no sh
int fa0/1
ip address 192.168.2.1 255.255.255.0
no sh
ip dhcp pool A
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
ip dhcp pool B
network 192.168.2.0 255.255.255.0
default-router 192.168.2.1
Switch Configuration
In switch, first we will configure vlans and then assign ports to Vlan.
en
conf t
hostname S1
vlan 10
name sales
vlan 20
name accounts
int range fa0/1-3
swicthport access vlan 10
int range fa0/4-6
switchport access vlan 20
Result
This lab is successful, as you can see above in image, Vlan 10 PC (192.168.1.2) got ping reply form vlan 20 PC (192.168.2.3).
Drawbacks of traditional method
In this method, number of links between router and switch = number of vlan. Like in above diagram, there are 2 vlans, so it requires 2 links. If number of vlan will increase, number of links also increase.
Router have limited ports we can’t add more links.
Router on a stick (ROAS)
ROAS is better than traditional approach, it uses 1 physical link between gateway and switch (doesn’t matter how many Vlans).
This is similar to traditional approach only difference is, instead of using multiple physical links, here we use logical interface (subinterfaces of physical link) between gateway and switch. So, this method only need 1 router port.
This method is called as router on stick, because in this method only 1 physical link is used between gateway and switch, if this link goes down, then whole network goes down.
Switch Configuration
1.Create Vlans
2.Assign ports to Vlan
3.Configure Fa0/5 as a trunk port
en
conf t
hostname S1
vlan 10
name sales
vlan 20
name accounts
int range fa0/1-2
switchport access vlan 10
int range fa0/3-4
switchport access vlan 20
int fa0/5
switchport mode trunk
Router Configuration
1.Configure subinterface, assign ip address to them.
In topology, you can see fa0/0 is physical interface, no need to assign IP address to fa0/0, only give no shutdown command to enable the interface.
Create 2 subinterfaces named as int fa0/0.10 and int fa0/0.20 and assign ip address.
2.Configure dhcp pools.
Note: encapsulation dot1q <vlan number> command is mandatory, otherwise subinterface will not work.
enable
conf t
hostname R1
int fa0/0
no sh
int fa0/0.10
encapsulation dot1q 10
ip add 192.168.1.1 255.255.255.0
int fa0/0.20
encapsulation dot1q 20
ip add 192.168.2.1 255.255.255.0
ip dhcp pool A
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
ip dhcp pool B
network 192.168.2.0 255.255.255.0
default-router 192.168.2.1
Result
By using Multi-layer switch/SVI method
Switch Configuration
- Create Vlan 10 and 20.
- Assign ports to Vlan.
- Configure Fa0/5 and 6 as trunk port
enable
config t
hostname S1
vlan 10
name sales
vlan 20
name accounts
int range fa0/1-2
switchport access vlan 10
int range fa0/3-4
swicthport access vlan 20
int range fa0/5-6
swicthport mode trunk
Multi-layer switch configuration
- Create Vlan 10 and Vlan 20.
- Create SVI (switch virtual interface), one for each Vlan
- Configure DHCP pools
- give ip routing —-to enable routing on multi-layer switch.
How to create SVI?
interface vlan <vlan number>
ip address <ip address><subnet mask>
no shutdown
en
conf t
hostname S2
vlan 10
name sales
vlan 20
name accounts
interface vlan 10
ip add 192.168.1.1 255.255.255.0
no sh
interface vlan 20
ip add 192.168.2.1 255.255.255.0
no sh
ip dhcp pool A
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
ip dhcp pool B
network 192.168.2.0 255.255.255.0
no sh
ip routing