Back
Lab 01Hands-on Lab
Implement Inter-VLAN Routing
Routing & VLANs
Goal
Route between VLANs using router-on-a-stick (subinterfaces) on R1, with switches S1/S2 trunked and PCs in VLAN 10, 20, 30.
VLAN802.1QTrunkSubinterfacesRouting
1
Implement Inter-VLAN Routing
Route between VLANs using router-on-a-stick (subinterfaces) on R1, with switches S1/S2 trunked and PCs in VLAN 10, 20, 30.
R1#
enable
configure terminal
hostname R1
no ip domain-lookup
enable secret class
line console 0
password cisco
login
exit
line vty 0 4
password cisco
login
exit
banner motd # Authorized access only #Routing & VLANs
2
Basic Device Settings
Apply the same baseline settings on R1, S1 and S2 before building the network.
R1#
vlan 10
name VLAN10
vlan 20
name VLAN20
vlan 30
name VLAN30
!
interface fastEthernet 0/6 ! PC-A
switchport mode access
switchport access vlan 10
interface fastEthernet 0/11 ! PC-B
switchport mode access
switchport access vlan 20
interface fastEthernet 0/18 ! PC-C
switchport mode access
switchport access vlan 303
IMPORTANT: Use the exact addressing table in YOUR lab window. The addresses below are the standard SRWE values, shown as a template only.
Create VLANs
R1#
! on S1 — trunk toward R1
interface g0/1
switchport mode trunk
switchport trunk allowed vlan 10,20,30
!
! on S1 and S2 — switch-to-switch trunk
interface g0/2
switchport mode trunk
switchport trunk allowed vlan 10,20,30
! on S2, G0/1 is the trunk toward S14
Create the VLANs on both S1 and S2, then assign the access ports according to your lab's port plan.
Trunking
R1#
interface g0/0/1
no shutdown
interface g0/0/1.10
encapsulation dot1Q 10
ip address 172.16.10.1 255.255.255.0
interface g0/0/1.20
encapsulation dot1Q 20
ip address 172.16.20.1 255.255.255.0
interface g0/0/1.30
encapsulation dot1Q 30
ip address 172.16.30.1 255.255.255.0Configure the R1↔S1 and S1↔S2 links as trunks, allowing only the VLANs you route.
5
Subinterfaces on R1
Create one subinterface per VLAN with matching encapsulation, and keep the physical interface in no shutdown.
R1#
show vlan brief ! VLANs exist + ports assigned
show interfaces trunk ! trunks up, allowed VLANs correct
show ip interface brief ! subinterfaces up/up with IPs
show interfaces g0/0/1.10 ! encapsulation correct