InterVLAN Routing
- VLANs divide the network in to smaller broadcast domains but also prohibit communication between domains. To enable communication, we use InterVLAN Routing.
- In InterVLAN routing, use two or more VLAN connectivity.
- InterVLAN routing also called Router on Stick Method.
Figure: InterVLAN Routing |
Switch Configuration
Step 1: Create two VLANs in switch and name it.1st VLAN
Switch#configure terminal
Switch(config)#vlan 20
Switch(config-vlan)# name HR
Switch(config-vlan)# exit
2nd VLAN
Switch#configure terminal
Switch(config)#vlan 30
Switch(config-vlan)#name Sales
Switch(config-vlan)#exit
Step 2: Assign Port with separate VLAN
For VLAN 20
Switch(config)#interface e0/1
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
For VLAN 30
Switch(config)#interface e0/2
Switch(config-if)#switchport access vlan 30
Switch(config-if)#exit
Step 3: Trunk the Port
Switch(config)#interface e0/0
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
Switch(config-if)#exit
Router Configuration
Step 1: Router port which are connected with switch trunk port.
Router#configure terminal
Router(config)#interface e0/0
Router(config-if)#no shut
Router(config-if)#Exit
Step 2: Create sub-interface for VLAN 20
Router(config)#interface e0/0.1
Router(config-subint)#encapsulation dot1q 20
Router(config-subint)#ip address 10.0.0.1 255.255.255.0
Router(config-subint)#no shut
Router(config-subint)#exit
Create sub-interface for VLAN 30
Router(config)#interface e0/0.2
Router(config-subint)#encapsulation dot1q 30
Router(config-subint)#ip address 20.0.0.1 255.255.255.0
Router(config-subint)#no shut
Router(config-subint)#exit
PC Configuration
PC 1
IP address : 10.0.0.2
Subnet : 255.255.255.0
Gateway : 10.0.0.1
PC 2
IP address : 20.0.0.2
Subnet : 255.255.255.0
Gateway : 20.0.0.2
Output:
- Now ping and check the connectivity between PC 1 and 2.
- Also check successful InterVLAN routing.
- Check the communication between VLAN20 and VLAN 30
PC1 to PC2
Ping 20.0.0.2
PC2 to PC 1
Ping 10.0.0.2
Comments
Post a Comment