Lab Inter-VLAN Routing
Lab Inter-VLAN Routing
VLAN Configuration
Topology Diagram
Addressing Table
Device (hostname) Interface IP Address Subnet Mask Default Gateway
S1 VLAN 90 192.168.90.11 255.255.255.0 192.168.90.1
S2 VLAN 90 192.168.90.12 255.255.255.0 192.168.90.1
R1 Fa0/0 See Sub-Interface Configuration Table N/A
PC1 NIC 192.168.10.21 255.255.255.0 192.168.10.1
PC2 NIC 192.168.20.22 255.255.255.0 192.168.20.1
PC3 NIC 192.168.30.23 255.255.255.0 192.168.30.1
1
Learning Objectives
Upon completion of this lab, you will be able to:
➢ Cable a network according to the topology diagram
➢ Erase the startup configuration and reload a switch to the default state
➢ Perform basic configuration tasks on a switch and router
➢ Configure VLAN Trunking Protocol (VTP) on all switches
➢ Enable trunking on inter-switch connections
➢ Verify trunk configuration
➢ Create VLANs on the VTP server, and distribute this VLAN information to switches in the
network
➢ Assign switch ports to the VLANs
➢ Configure a router to support 802.1q trunking on a Fast Ethernet interface
➢ Configure a router with sub-interfaces corresponding to the configured VLANs
➢ Save the VLAN configuration
Step 2: Clear any existing configurations on the switches, and initialize all ports in the shutdown
state
If necessary, refer to the first lab (Task 2), for the procedure to clear switch configurations. It is a good
practice to disable any unused ports on the switches by putting them in shutdown. Disable all ports on
the switches (all three of them):
Switch#config term
Switch(config)#interface range fa0/1-24
Switch(config-if-range)#shutdown
Switch(config-if-range)#exit
Switch(config)#interface range gi0/1-2
Switch(config-if-range)#shutdown
2
Switch#configure terminal
Switch(config)#interface range fa0/1-24
Switch(config-if-range)#shutdown
Switch(config-if-range)#exit
Switch(config)#hostname S2 [S1]
S2(config)#no ip domain-lookup
S2(config-line)#password cisco
S2(config-line)#login
S2(config-line)#exit
S2(config)#line vty 0 15
S2(config-line)#password telnet
S2(config-line)#login
S2(config-line)#exit
Step 2: Re-enable the user ports (only ports that are connected to PCs).
S1(config)#interface range fa0/1-2
S1(config-if-range)#switchport mode access
S1(config-if-range)#no shutdown
S1(config-if-range)#end
%SYS-5-CONFIG_I: Configured from console by console
S1#
S2(config)#interface fa0/2
S2(config-if-range)#switchport mode access
S2(config-if-range)#no shutdown
S2(config-if-range)#end
%SYS-5-CONFIG_I: Configured from console by console
S2#
Task 3: Configure and Activate Ethernet Interfaces
Step 1: Configure the PCs using the IP addresses given in the table.
3
S1#configure terminal
S1(config)#vtp mode server
Device mode already VTP SERVER.
S1(config)#vtp domain ciscovtp.com
Changing VTP domain name from NULL to VTP-Lab
S1(config)#vtp password vtp1234
Setting device VLAN database password to VTP-Pass
S1(config)#end
%SYS-5-CONFIG_I: Configured from console by console
S1#
S2#configure terminal
S2(config)#vtp mode client
Setting device to VTP CLIENT mode
S2(config)#vtp domain ciscovtp.com
Changing VTP domain name from NULL to VTP-Lab
S2(config)#vtp password vtp1234
Setting device VLAN database password to VTP-Pass
S2(config)#end
%SYS-5-CONFIG_I: Configured from console by console
S2#
S2#configure terminal
S2(config)#interface fa0/3
S2(config-if-range)#switchport mode trunk
S2(config-if-range)#no shutdown
S2(config-if-range)#end
%SYS-5-CONFIG_I: Configured from console by console
S2#
4
Configure these on the VTP server (i.e. S1).
S1#configure terminal
S1(config)#vlan 90
S1(config-vlan)#name Management
S1(config-vlan)#exit
S1(config)#vlan 10
S1(config-vlan)#name Staff
S1(config-vlan)#exit
S1(config)#vlan 20
S1(config-vlan)#name Students
S1(config-vlan)#exit
S1(config)#vlan 30
S1(config-vlan)#name Guest
S1(config-vlan)#end
%SYS-5-CONFIG_I: Configured from console by console
S1#
Verify that the VLANs have been created on S1 with the show vlan brief command. Additionally, make
sure that the server is distributed them to client switches
S1#show vlan brief
5
Step 4: Assign switch ports to VLANs on S1 and S2.
Refer to the port assignment on the topology on page 1. Ports are assigned to VLANs in interface
configuration mode, using the switchport access vlan vlan-id command.
S1(config)#interface fa0/1
S1(config-if)#switchport access vlan 30
S1(config-if)#exit
S1(config)#interface fa0/2
S1(config-if)#switchport access vlan 10
S1(config-if)#end
S1#copy running-config startup-config
Destination filename [startup-config]? [enter]
Building configuration...
[OK]
S2(config)#interface fa0/2
S2(config-if-range)#switchport access vlan 20
S2(config-if-range)#end
S2#copy running-config startup-config
Destination filename [startup-config]? [enter]
Building configuration...
[OK]
Step 6: Configure the native VLAN for the trunking ports on all switches and verify that the
switches can communicate.
Is any of the above ping attempts successful? No! Because these hosts are in different subnets and in
different VLANs, therefore they cannot communicate without a Layer 3 device (like router or layer-3
switch) which is/are used to route traffic between different subnetworks and/or VLANs.
You can also ping the management VLAN IP address of the switches. None of them will work for you,
because they are in separate VLAN and subnetwork from the hosts. So, if any host tries to manage the
switch, then routing is mandatory. The next task we are going to do is configuration of Inter-VLAN
routing, which allows communication between hosts/devices found in different VLANs.
Router>enable
Router#
7
Step 2: Create a basic configuration on the router.
➢ Configure the router with hostname R1.
➢ Disable DNS lookup.
➢ Configure an EXEC mode password of class.
➢ Configure a password of cisco for console connections.
➢ Configure a password of telnet for vty connections.
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#enable secret class
R1(config)#line console 0
R1(config-line)#password cisco
R1(config-line)#login
R1(config-line)#exit
R1(config)#line vty 0 15
R1(config-line)#password telnet
R1(config-line)#login
R1(config-line)#exit
R1(config)#
8
R1(config)#interface fastethernet 0/0.30
R1(config-subif)#encapsulation dot1q 30
R1(config-subif)#ip address 192.168.30.1 255.255.255.0
R1(config-subif)#exit
Are the pings successful? If not, troubleshoot your configuration. Check to make sure the default
gateways have been set on all PCs and all switches.
9
Summary of the Configurations
Basic configurations
Switch#configure terminal
Switch(config)#interface range fa0/1-24
Switch(config-if-range)#shutdown
Switch(config-if-range)#exit
Switch(config)#hostname S2 [S1]
S2(config)#no ip domain-lookup
S2(config-line)#password cisco
S2(config-line)#login
S2(config-line)#exit
S2(config)#line vty 0 15
S2(config-line)#password telnet
S2(config-line)#login
S2(config-line)#exit
S2(config)#interface fa0/2
S2(config-if-range)#switchport mode access [S1-f0/1,f0/2]
S2(config-if-range)#no shutdown
S2(config-if-range)#exit
Configure VTP
S1#configure terminal
S1(config)#vtp mode server
Device mode already VTP SERVER.
S1(config)#vtp domain ciscovtp.com
Changing VTP domain name from NULL to VTP-Lab
S1(config)#vtp password vtp1234
Setting device VLAN database password to VTP-Pass
S1(config)#end
%SYS-5-CONFIG_I: Configured from console by console
S1#
10
Configure Trunking and Native VLAN
S1#configure terminal
S1(config)#interface range fa0/3,fa0/5
S1(config-if-range)#switchport mode trunk
S1(config-if-range)#switchport trunk native vlan 90
S1(config-if-range)#no shutdown
S1(config-if-range)#end
%SYS-5-CONFIG_I: Configured from console by console
S1#
S2#configure terminal
S2(config)#interface fa0/3
S2(config-if-range)#switchport mode trunk
S2(config-if-range)#switchport trunk native vlan 90
S2(config-if-range)#no shutdown
S2(config-if-range)#end
%SYS-5-CONFIG_I: Configured from console by console
S2#
11
S2#show vlan brief
VLAN Name Status Ports
---- ------- ------ ---------------------------------------
1 default active Fa0/1, Fa0/2, Fa0/4, Fa0/5, Fa0/6
Fa0/7, Fa0/8, Fa0/9, Fa0/10, Fa0/11
Fa0/12, Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20, Fa0/21
Fa0/22, Fa0/23, Fa0/24, Gi0/1, Gi0/2
10 Staff active
20 Students active
30 Guest active
90 Management active
<!-- Outputs omitted !>
Assign switch ports to VLANs
S1(config)#interface fa0/1
S1(config-if)#switchport access vlan 30
S1(config-if)#exit
S1(config)#interface fa0/2
S1(config-if)#switchport access vlan 10
S1(config-if)#end
S1#copy running-config startup-config
Destination filename [startup-config]? [enter]
Building configuration...
[OK]
S2(config)#interface fa0/2
S2(config-if-range)#switchport access vlan 20
S2(config-if-range)#end
S2#copy running-config startup-config
Destination filename [startup-config]? [enter]
Building configuration...
[OK]
S2(config)#interface vlan 90
S2(config-if)#ip address 192.168.90.12 255.255.255.0
S2(config-if)#no shutdown
S2(config-if)#exit
S2(config)#ip default-gateway 192.168.90.1
S2(config)#interface fa0/3 12
S2(config-if-range)#switchport trunk native vlan 90
S2(config-if-range)#no shutdown
S2(config-if-range)#end
Basic Configuration on the Router
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#enable secret class
R1(config)#line console 0
R1(config-line)#password cisco
R1(config-line)#login
R1(config-line)#exit
R1(config)#line vty 0 15
R1(config-line)#password telnet
R1(config-line)#login
R1(config-line)#exit
R1(config)#
13