As discussed, in the previous post the inter VLAN routing can be configured in three different ways: Basic configuration (Old Method), Router on a sick and VLAN Routing on a Layer 3 Switch. Click here to know the difference between them. In this post, we are going to do the basic inter VLAN routing configuration in packet tracer and at the end, I will also share you the configuration file.
How to configure basic inter VLAN Routing
We are going to configure Inter VLAN according to the diagram given below.
Let’s configure VLAN on a switch first:
(Note: The text in black is the command used to configure inter vlan, text in blue indicates the output and text in green indicate the uses of the command.)
Switch>en (enable privilege mode)
Switch#conf t (entering configuration mode)
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10 (Creating VLAN 10)
Switch(config-vlan)#name production (Assigning name to VLAN)
Switch(config-vlan)#vlan 20 (Creating VLAN 20)
Switch(config-vlan)#name sales (Assigning name to VLAN)
Switch(config-vlan)#exit
Switch(config)#int range f0/1 , f0/3 (Selecting port 1 and port 3 of a switch)
Switch(config-if-range)#switchport access vlan 10 (Assigning port 1 and 3 to VLAN 10)
Switch(config-if-range)#switchport mode access (Enabling switch port)
Switch(config-if-range)#exit
Switch(config)#int range f0/2 , f0/4 (Selecting port 2 and port 4 of a switch)
Switch(config-if-range)#switchport access vlan 20 (Assigning port 2 and 4 to VLAN 20)
Switch(config-if-range)#switchport mode access (Enabling switch port)
Switch(config-if-range)#exit
Switch(config)#do copy run start (Save switch configuration)
Destination filename [startup-config]?
Building configuration…
[OK]
Switch(config)#
Inter VLAN Routing configuration on a Router
Router>en (Enabling privilege mode)
Router#conf t (Entering configuration mode)
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int f0/0 (Selecting port f0/0)
Router(config-if)#no shutdown (Enabling the port)
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#ip address 10.0.0.1 255.0.0.0 (Assigning IP Address to the port f0/0)
Router(config-if)#exit
Router(config)#int f0/1 (Selecting port f0/1)
Router(config-if)#no shutdown (Enabling the port)
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Router(config-if)#ip address 20.0.0.1 255.0.0.0 (Assigning IP Address to the port f0/1)
Router(config-if)#exit
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#wr (Save Router configuration)
Building configuration…
[OK]
Router#show run (Show Router Configuration)
Building configuration…
Current configuration : 563 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
ip cef
no ipv6 cef
!
!
spanning-tree mode pvst
!
!
interface FastEthernet0/0
ip address 10.0.0.1 255.0.0.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 20.0.0.1 255.0.0.0
duplex auto
speed auto
Download the packet tracer configuration file on inter VLAN.