Ticker

6/recent/ticker-posts

Configuring inter VLAN Routing using Cisco Packet tracer

 Topology


  • Inter VLAN Routing is used to make the devices in different VLANs to communicate with each other. Here we are configuring inter VLAN routing using an L2 switch and a router. In a scenario where an L3 switch is being used, we can straight away configure routing without a router.
PC-01
IP: 192.168.10.1/24
GW: 192.168.10.10
VLAN: 10

PC-01
IP: 192.168.20.1/24
GW: 192.168.20.20
VLAN: 20

Create two vlans (vlan 10,20) on the access switch.

Switch(config)#vlan 10

Switch(config-vlan)#name test01


Switch(config)#vlan 20

Switch(config-vlan)#name test02


Assign the switch ports connected to the PCs to the respective VLANs 


Switch(config)#int fas0/1

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 10


Switch(config)#interface fas0/2

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 20


Configure the port connecting to the router as trunk and allow the two VLANs


Switch(config)#int fas0/3

Switch(config-if)#switchport mode trunk 

Switch(config-if)#switchport trunk allowed vlan add 10

Switch(config-if)#switchport trunk allowed vlan add 20


Create two sub-interfaces on router for the two VLANs and configure the Gateway IP addresses.


For Vlan 10 

fa0/1.10

IP:192.168.10.10/24


Router(config)#int fas0/1

Router(config-if)#no shutdown 

Router(config)#int fas0/1.10

Router(config-subif)#encapsulation dot1Q 10 (10 in this commands is the VLAN id 10)

Router(config-subif)#ip address 192.168.10.10 255.255.255.0


For Vlan 20 

fa0/1.20

IP:192.168.20.10/24


Router(config)#int fas0/1.20

Router(config-subif)#encapsulation dot1Q 20

Router(config-subif)#ip address 192.168.20.10 255.255.255.0

Make sure the PCs are communicating with the relevant Gateways.



Check whether Both the PCs are communicating with each other. If the ping is successful, then we have configured inter VLAN routing successfully. 






Post a Comment

0 Comments