Inter-VLAN Routing
Inter-VLAN Routing is process of transferring data/ packet from one vlan to other vlan with the help of router.VLAN divides the broadcast domains so that performance of network increase. When user in one vlan needs to communicate with the user in other vlan that traffic must be routed between vlans, and this process of routing is known as Inter-VLAN Routing. On catalyst switches Inter-VLAN Routing is accomplished by creating Layer 3 interfaces which are know has Switch Virtual Interface (SVI).
Hosts in same vlan can communicate with each other without any routing device but if hosts from different vlans wants to communicate then routing device is required in that network.
For the process of Inter-VLAN Routing router must have to support ISL or 802.1Q trunking on its interfaces (FastEthernet or GigabitEthernet). Router interfaces are divided into sub virtual interfaces for each VLAN.
Configurations
Scenario
VLAN divides the broadcast domains so that performance of network increase. When user in one vlan needs to communicate with the user in other vlan that traffic must be routed between vlans, and this process of routing is known as Inter-VLAN Routing. On catalyst switches Inter-VLAN Routing is accomplished by creating Layer 3 interfaces which are know has Switch Virtual Interface (SVI).
In the above diagram, we have to create two new VLAN's named Admin and Management. After that we will equally assign the ports to the VLAN's of the switch.
Devices used in this lab are
1941 Router
6 PC's (2 PC's for each VLAN)
2960-24TT Switch
Switch
Switch>enableSwitch#configure terminal
Switch(config)#hostname TestSwitch
TestSwitch(config)#enable password cisco (Plain Text Password)
TestSwitch(config)#enable secret class (Encrypted Password)
TestSwitch(config)#username TestSwitch secret cisco
TestSwitch(config)#ip domain-name cisco.com
TestSwitch(config)#crypto key generate rsa
(Set key between 360 - 2048)
TestSwitch(config)#line console 0
TestSwitch(config-line)#password cisco
TestSwitch(config-line)#login
TestSwitch(config-line)#exit
TestSwitch(config)#line vty 0 15
TestSwitch(config-line)#transport input ssh
TestSwitch(config-line)#login local
TestSwitch(config-line)#exit
!Creating VLANs
TestSwitch(config)#vlan 2
TestSwitch(config-vlan)#name Admin
TestSwitch(config-vlan)#exit
TestSwitch(config)#vlan 3
TestSwitch(config-vlan)#name Management
TestSwitch(config-vlan)#exit
!Assigning ports to VLANs
TestSwitch(config)#interface range fastEthernet 0/9-16
TestSwitch(config-if-range)#switchport mode access
TestSwitch(config-if-range)#switchport access vlan 2
TestSwitch(config-if-range)#exit
TestSwitch(config)#interface range fastEthernet 0/17-24
TestSwitch(config-if-range)#switchport mode access
TestSwitch(config-if-range)#switchport access vlan 3
TestSwitch(config-if-range)#exit
!Assigning IP Address to VLANs
TestSwitch(config)#interface vlan 1
TestSwitch(config-if)#ip address 192.168.1.254 255.255.255.0
TestSwitch(config-if)#no shutdown
TestSwitch(config-if)#exit
TestSwitch(config)#interface vlan 2
TestSwitch(config-if)#ip address 192.168.2.254 255.255.255.0
TestSwitch(config-if)#no shutdown
TestSwitch(config-if)#exit
TestSwitch(config)#interface vlan 3
TestSwitch(config-if)#ip address 192.168.3.254 255.255.255.0
TestSwitch(config-if)#no shutdown
TestSwitch(config-if)#exit
!Trunk the port towards the Router
TestSwitch(config)#interface gigabitEthernet 0/0
TestSwitch(config-if)#switchport mode trunk
TestSwitch(config-if)#exit
TestSwitch(config)#exit
TestSwitch#copy running-config startup-config
Router
Router>enableRouter#configure terminal
Router(config)#hostname TestRouter
TestRouter(config)#enable password cisco (Plain Text Password)
TestRouter(config)#enable secret class (Enycrpted Password)
TestRouter(config)#username TestRouter secret csico
TestRouter(config)#ip domain-name cisco.com
TestRouter(config)#crypto key generate rsa
(Set key between 360 - 2048)
TestRouter(config)#line console 0
TestRouter(config-line)#password cisco
TestRouter(config-line)#login
TestRouter(config-line)#exit
TestRouter(config)#line vty 0 4
TestRouter(config-line)#transport input ssh
TestRouter(config-line)#login local
TestRouter(config-line)#exit
!Creating Logical Interfaces for each vlan
TestRouter(config)#interface gigabitEthernet 0/0.1
TestRouter(config-subif)#encapsulation dot1Q 1
TestRouter(config-subif)#ip address 192.168.1.1 255.255.255.0
TestRouter(config-subif)#exit
TestRouter(config)#interface gigabitEthernet 0/0.2
TestRouter(config-subif)#encapsulation dot1Q 2
TestRouter(config-subif)#ip address 192.168.2.1 255.255.255.0
TestRouter(config-subif)#exit
TestRouter(config)#interface gigabitEthernet 0/0.3
TestRouter(config-subif)#encapsulation dot1Q 3
TestRouter(config-subif)#ip address 192.168.3.1 255.255.255.0
TestRouter(config-subif)#exit
TestRouter(config)#interface gigabitEthernet 0/0
TestRouter(config-if)#no shutdown
TestRouter(config-if)#exit
TestRouter(config)#exit
TestRouter#copy running-config startup-config
No comments:
Post a Comment