4.5.2 Lab - Implement Inter-VLAN Routing - ILM
4.5.2 Lab - Implement Inter-VLAN Routing - ILM
Instructor Note: Red font color or gray highlights indicate text that appears in the instructor copy only.
Topology
Addressing Table
Device Interface IP Address Subnet Mask Default Gateway
R1
G0/0/1.20 192.168.20.1 255.255.255.0 N/A
R1
G0/0/1.30 192.168.30.1 255.255.255.0 N/A
R1
G0/0/1.1000 N/A N/A N/A
VLAN Table
VLAN Name Interface Assigned
S1: VLAN 10
10 Management S2: VLAN 10
20 Sales S1: F0/6
30 Operations S2: F0/18
S1: F0/2-4, F0/7-24, G0/1-2
999 Parking_Lot S2: F0/2-17, F0/19-24, G0/1-2
1000 Native N/A
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 1 of 20 www.netacad.com
Lab - Implement Inter-VLAN Routing
Objectives
Part 1: Build the Network and Configure Basic Device Settings
Part 2: Create VLANs and Assign Switch Ports
Part 3: Configure an 802.1Q Trunk between the Switches
Part 4: Configure Inter-VLAN Routing on the Router
Part 5: Verify Inter-VLAN Routing is working
Background / Scenario
Modern switches use virtual local-area networks (VLANs) to improve network performance by separating
large Layer 2 broadcast domains into smaller ones. VLANs can also be used as a security measure by
separating sensitive data traffic from the rest of the network. In general, VLANs make it easier to design a
network to support the goals of an organization. Communication between VLANs requires a device operating
at Layer 3 of the OSI model. Adding an inter-VLAN router allows the organization to segregate and separate
broadcast domains while simultaneously allowing them to communicate with each other.
VLAN trunks are used to span VLANs across multiple devices. Trunks allow the traffic from multiple VLANs to
travel over a single link, while keeping the VLAN identification and segmentation intact. A particular kind of
inter-VLAN routing, called “Router-on-a-Stick”, uses a trunk from the router to the switch to enable all VLANs
to pass to the router.
In this lab, you will create VLANs on both switches in the topology, assign VLANs to switch access ports,
verify that VLANs are working as expected, create VLAN trunks between the two switches and between S1
and R1, and configure Inter-VLAN routing on R1 to allow hosts in different VLANs to communicate, regardless
of which subnet the host resides.
Note: The routers used with CCNA hands-on labs are Cisco 4221 with Cisco IOS XE Release 16.9.4
(universalk9 image). The switches used in the labs are Cisco Catalyst 2960s with Cisco IOS Release 15.2(2)
(lanbasek9 image). Other routers, switches, and Cisco IOS versions can be used. Depending on the model
and Cisco IOS version, the commands available and the output produced might vary from what is shown in
the labs. Refer to the Router Interface Summary Table at the end of the lab for the correct interface identifiers.
Note: Ensure that the routers and switches have been erased and have no startup configurations. If you are
unsure contact your instructor.
Instructor Note: Refer to the Instructor Lab Manual for the procedures to initialize and reload devices.
Required Resources
1 Router (Cisco 4221 with Cisco IOS XE Release 16.9.4 universal image or comparable)
2 Switches (Cisco 2960 with Cisco IOS Release 15.2(2) lanbasek9 image or comparable)
2 PCs (Windows with a terminal emulation program, such as Tera Term)
Console cables to configure the Cisco IOS devices via the console ports
Ethernet cables as shown in the topology
Instructions
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 2 of 20 www.netacad.com
Lab - Implement Inter-VLAN Routing
router> enable
b. Enter configuration mode.
router# config terminal
c. Assign a device name to the router.
router(config)# hostname R1
d. Disable DNS lookup to prevent the router from attempting to translate incorrectly entered commands as
though they were host names.
R1(config)# no ip domain lookup
e. Assign class as the privileged EXEC encrypted password.
R1(config)# enable secret class
f. Assign cisco as the console password and enable login.
R1(config)# line console 0
R1(config-line)# password cisco
R1(config-line)# login
g. Assign cisco as the vty password and enable login.
R1(config)# line vty 0 4
R1(config-line)# password cisco
R1(config-line)# login
h. Encrypt the plaintext passwords.
R1(config)# service password-encryption
i. Create a banner that warns anyone accessing the device that unauthorized access is prohibited.
R1(config)# banner motd $ Authorized Users Only! $
j. Save the running configuration to the startup configuration file.
R1(config)# exit
R1# copy running-config startup-config
k. Set the clock on the router.
R1# clock set 15:30:00 27 Aug 2019
Close configuration window
switch(config)# hostname S2
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 3 of 20 www.netacad.com
Lab - Implement Inter-VLAN Routing
b. Disable DNS lookup to prevent the router from attempting to translate incorrectly entered commands as
though they were host names.
S1(config)# no ip domain-lookup
S2(config)# no ip domain-lookup
c. Assign class as the privileged EXEC encrypted password.
S1(config)# enable secret class
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 4 of 20 www.netacad.com
Lab - Implement Inter-VLAN Routing
S1(config)# vlan 10
S1(config-vlan)# name Management
S1(config-vlan)# vlan 20
S1(config-vlan)# name Sales
S1(config-vlan)# vlan 30
S1(config-vlan)# name Operations
S1(config-vlan)# vlan 999
S1(config-vlan)# name Parking_Lot
S1(config-vlan)# vlan 1000
S1(config-vlan)# name Native
S1(config-vlan)# exit
S2(config)# vlan 10
S2(config-vlan)# name Management
S2(config-vlan)# vlan 20
S2(config-vlan)# name Sales
S2(config-vlan)# vlan 30
S2(config-vlan)# name Operations
S2(config-vlan)# vlan 999
S2(config-vlan)# name Parking_Lot
S2(config-vlan)# vlan 1000
S2(config-vlan)# name Native
S2(config-vlan)# exit
b. Configure the management interface and default gateway on each switch using the IP address
information in the Addressing Table.
S1(config)# interface vlan 10
S1(config-if)# ip address 192.168.10.11 255.255.255.0
S1(config-if)# no shutdown
S1(config-if)# exit
S1(config)# ip default-gateway 192.168.10.1
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 5 of 20 www.netacad.com
Lab - Implement Inter-VLAN Routing
S2(config-if)# no shutdown
S2(config-if)# exit
S2(config)# ip default-gateway 192.168.10.1
c. Assign all unused ports on the switch to the Parking_Lot VLAN, configure them for static access mode,
and administratively deactivate them.
Note: The interface range command is helpful to accomplish this task with as few commands as
necessary.
S1(config)# interface range f0/2 - 4 , f0/7 - 24 , g0/1 - 2
S1(config-if-range)# switchport mode access
S1(config-if-range)# switchport access vlan 999
S1(config-if-range)# shutdown
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 6 of 20 www.netacad.com
Lab - Implement Inter-VLAN Routing
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 7 of 20 www.netacad.com
Lab - Implement Inter-VLAN Routing
S1 F0/5 will not be displayed if the GigabitEthernet 0/0/1 interface status on the router is down.
Close configuration window
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 8 of 20 www.netacad.com
Lab - Implement Inter-VLAN Routing
b. Configure sub-interfaces for each VLAN as specified in the IP addressing table. All sub-interfaces use
802.1Q encapsulation. Ensure the sub-interface for the native VLAN does not have an IP address
assigned. Include a description for each sub-interface.
R1(config)# interface g0/0/1.10
R1(config-subif)# description Management Network
R1(config-subif)# encapsulation dot1q 10
R1(config-subif)# ip address 192.168.10.1 255.255.255.0
R1(config-subif)# interface g0/0/1.20
R1(config-subif)# encapsulation dot1q 20
R1(config-subif)# description Sales Network
R1(config-subif)# ip address 192.168.20.1 255.255.255.0
R1(config-subif)# interface g0/0/1.30
R1(config-subif)# encapsulation dot1q 30
R1(config-subif)# description Operations Network
R1(config-subif)# ip address 192.168.30.1 255.255.255.0
R1(config-subif)# interface g0/0/1.1000
R1(config-subif)# encapsulation dot1q 1000 native
R1(config-subif)# description Native VLAN
c. Verify the sub-interfaces are operational
R1# show ip interface brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0/0 unassigned YES NVRAM down down
GigabitEthernet0/0/1 unassigned YES NVRAM up up
Gi0/0/1.10 192.168.10.1 YES manual up up
Gi0/0/1.20 192.168.20.1 YES manual up up
Gi0/0/1.30 192.168.30.1 YES manual up up
Gi0/0/1.1000 unassigned YES unset up up
GigabitEthernet0 unassigned YES NVRAM down down
Close configuration window
The tracert output should show two entries in the results. The first hop is R1’s G0/0/1.30 interface
address, which is the Gateway address for PC-B. The second hop is PC-A’s address.
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 9 of 20 www.netacad.com
Lab - Implement Inter-VLAN Routing
Note: To find out how the router is configured, look at the interfaces to identify the type of router and how
many interfaces the router has. There is no way to effectively list all the combinations of configurations for
each router class. This table includes identifiers for the possible combinations of Ethernet and Serial
interfaces in the device. The table does not include any other type of interface, even though a specific router
may contain one. An example of this might be an ISDN BRI interface. The string in parenthesis is the legal
abbreviation that can be used in Cisco IOS commands to represent the interface.
End of document
Switch S1
S1# show run
Building configuration...
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 10 of 20 www.netacad.com
Lab - Implement Inter-VLAN Routing
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 11 of 20 www.netacad.com
Lab - Implement Inter-VLAN Routing
!
interface FastEthernet0/9
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/10
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/11
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/12
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/13
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/14
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/15
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/16
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/17
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/18
switchport access vlan 999
switchport mode access
shutdown
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 12 of 20 www.netacad.com
Lab - Implement Inter-VLAN Routing
!
interface FastEthernet0/19
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/20
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/21
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/22
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/23
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/24
switchport access vlan 999
switchport mode access
shutdown
!
interface GigabitEthernet0/1
switchport access vlan 999
switchport mode access
shutdown
!
interface GigabitEthernet0/2
switchport access vlan 999
switchport mode access
shutdown
!
interface Vlan1
no ip address
shutdown
!
interface Vlan10
ip address 192.168.10.11 255.255.255.0
!
ip http server
ip http secure-server
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 13 of 20 www.netacad.com
Lab - Implement Inter-VLAN Routing
!
banner motd ^C Authorized Users Only! ^C
!
line con 0
password 7 110A1016141D
login
line vty 0 4
password 7 110A1016141D
login
line vty 5 15
login
!
end
Switch S2
S2# show run
Building configuration...
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 14 of 20 www.netacad.com
Lab - Implement Inter-VLAN Routing
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 15 of 20 www.netacad.com
Lab - Implement Inter-VLAN Routing
shutdown
!
interface FastEthernet0/12
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/13
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/14
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/15
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/16
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/17
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/18
switchport access vlan 30
switchport mode access
!
interface FastEthernet0/19
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/20
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/21
switchport access vlan 999
switchport mode access
shutdown
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 16 of 20 www.netacad.com
Lab - Implement Inter-VLAN Routing
!
interface FastEthernet0/22
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/23
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/24
switchport access vlan 999
switchport mode access
shutdown
!
interface GigabitEthernet0/1
switchport access vlan 999
switchport mode access
shutdown
!
interface GigabitEthernet0/2
switchport access vlan 999
switchport mode access
shutdown
!
interface Vlan1
no ip address
!
interface Vlan10
ip address 192.168.10.12 255.255.255.0
!
ip http server
ip http secure-server
!
banner motd ^C Authorized Users Only! ^C
!
line con 0
password 7 00071A150754
login
line vty 0 4
password 7 00071A150754
login
line vty 5 15
login
!
end
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 17 of 20 www.netacad.com
Lab - Implement Inter-VLAN Routing
Router R1
R1# show run
Building configuration...
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 18 of 20 www.netacad.com
Lab - Implement Inter-VLAN Routing
!
interface GigabitEthernet0/0/1
no ip address
negotiation auto
!
interface GigabitEthernet0/0/1.10
description Management Network
encapsulation dot1Q 10
ip address 192.168.10.1 255.255.255.0
!
interface GigabitEthernet0/0/1.20
description Sales network
encapsulation dot1Q 20
ip address 192.168.20.1 255.255.255.0
!
interface GigabitEthernet0/0/1.30
description Operations Network
encapsulation dot1Q 30
ip address 192.168.30.1 255.255.255.0
!
interface GigabitEthernet0/0/1.1000
description Native VLAN
encapsulation dot1Q 1000 native
!
interface Serial0/1/0
no ip address
shutdown
!
interface Serial0/1/1
no ip address
shutdown
!
interface GigabitEthernet0
vrf forwarding Mgmt-intf
no ip address
negotiation auto
!
ip forward-protocol nd
no ip http server
ip http secure-server
ip tftp source-interface GigabitEthernet0
!
control-plane
!
banner motd ^C Authorized Users Only! ^C
!
line con 0
password 7 070C285F4D06
login
transport input none
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 19 of 20 www.netacad.com
Lab - Implement Inter-VLAN Routing
stopbits 1
line aux 0
stopbits 1
line vty 0 4
password 7 104D000A0618
login
!
end
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 20 of 20 www.netacad.com