INTER-VLAN ROUTING
Inter-VLAN routing is the process of forwarding network traffic from one VLAN to another VLAN using a router.
To Create a VLAN on a Switch
Configure VLAN on switch
Syntax:
Switch(config)#vlan <VLAN No.>
Switch(config-vlan)#name <name>
To assign a interface to VLAN
Switch(config)#interface <type> <No.>
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan <VLAN No.>
Switch(config-if)#exit
To configure a trunk link on interface connected to router
Switch(config)#interface <type> <No.>
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan all
Switch(config-if)#exit
To configure inter-VLAN routing on a router
Configuration required on the ethernet interface.
Syntax:
Router(config)#interface <type> <No.>
Router (config-if)#no shutdown
Router (config-if)#no ip address
Router (config-if )#exit
Configuration on Switch :-
Create VLAN on switch:
Configuration required on the ethernet interface.
Syntax:
Router(config)#interface <type> <No.>
Router (config-if)#no shutdown
Router (config-if)#no ip address
Router (config-if )#exit
To configure sub
interface on a router Configuration on sub interface of a Router:
Router(config)#interface <type> <Physical
int no.sub int no>
Router (config-if)#encapsulation dotlq <vlan no>
[native]
Router (config-if)#no ip address
Router (config-if)#exit
Configuration on Switch :-
Create VLAN on switch:
switch#configure terminal
switch(config)#vlan 10
switch(config-vlan)#name Admin
switch(config-vlan)#exit
switch(config)#vlan 20
switch(config-vlan)#name Accounts
switch(config-vlan)#exit
switch(config)#interface range fa0/2-4
switch(config-if-range)#switchport mode access
switch(config-if-range)#switchport access vlan 10
switch(config-if-range)#exit
switch(config)#interface range fa0/5-7
switch(config-if-range)#switchport mode access
switch (config-if-range)#s witch port access vlan 20
switch(config-if-range)#exit
switch(config)#interface fa0/1
switch(config-if)#switchport mode trunk
switch(config-if)#switchport trunk allowed vlan all
switch(config-if)#ctrl+z
To verify the output using following commands:
switch#show vlan
switch#show interface trunk
Configuration on Router :-
Router#configure terminal
Router(config)#interface fastethernet 0/0
Router(config-if)#no ip address
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface fastethernet 0/0.1
Router(config-if)#encapsulation dot1q 10
Router(config-if)#ip address 10.0.0.1 255.0.0.0
Router(config-if)#exit
Router(config)#interface fastethernet 0/0.2
Router(config-if)#encapsulation dot1q 20
Router(config-if)#ip address 11.0.0.1 255.0.0.0
Router(config-if)#exit
Switch1#sh interfaces trunk
Port Mode Encapsulation Status Native vlan
Fa0/1 on 802.1q trunking 1
Port Vlans allowed on trunk
Fa0/1 1-1005
Port Vlans allowed and active in management domain
Fa0/1 1,10,20
Port Vlans in spanning tree forwarding state and not pruned
Fa0/1 1,10,20
Kolkata#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
C 10.0.0.0/8 is directly connected, FastEthernet0/0.1
C 11.0.0.0/8 is directly connected, FastEthernet0/0.2
Router(config-if)#no ip address
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface fastethernet 0/0.1
Router(config-if)#encapsulation dot1q 10
Router(config-if)#ip address 10.0.0.1 255.0.0.0
Router(config-if)#exit
Router(config)#interface fastethernet 0/0.2
Router(config-if)#encapsulation dot1q 20
Router(config-if)#ip address 11.0.0.1 255.0.0.0
Router(config-if)#exit
Router(config)#no ip routing
Router(config)#ip routing
Router(config)#exit
To verify the output using following commands:
Router#show ip route
Router#show running-config
OUTPUT:
Switch1#show vlan
Switch1#sh interfaces trunk
Port Mode Encapsulation Status Native vlan
Fa0/1 on 802.1q trunking 1
Port Vlans allowed on trunk
Fa0/1 1-1005
Port Vlans allowed and active in management domain
Fa0/1 1,10,20
Port Vlans in spanning tree forwarding state and not pruned
Fa0/1 1,10,20
Kolkata#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
C 10.0.0.0/8 is directly connected, FastEthernet0/0.1
C 11.0.0.0/8 is directly connected, FastEthernet0/0.2
No comments:
Post a Comment