How To Configure Inter-Vlan Routing in Cisco Router

Cisco Routing Network Administrator

 

Configure Inter-Vlan Routing in Cisco Router
vlan divide broadcast domain. when need one vlan communicate to other vlan that time traffic must be routed between them. this called inter-vlan routing.
Step 1
Configure sub interface in Router.
IOU1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
IOU1(config)#int e0/0
IOU1(config-if)#int e0/0.10
IOU1(config-subif)#en
IOU1(config-subif)#encapsulation do
IOU1(config-subif)#encapsulation dot1Q 10
IOU1(config-subif)#ip add
IOU1(config-subif)#ip address 192.168.10.1 255.255.255.0
IOU1(config-subif)#no sh
IOU1(config-subif)#int e0/0.20
IOU1(config-subif)#encapsulation dot1Q 20
IOU1(config-subif)#ip address 192.168.20.1 255.255.255.0
IOU1(config-subif)#no sh
IOU1(config-subif)#hostna
IOU1(config-subif)#hostname R1
Step 2
Configure trunk in Switch for allow vlan
IOU1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
IOU1(config)#int e1/0
IOU1(config-if)#no sh
IOU1(config-if)#sw
IOU1(config-if)#switchport mo
IOU1(config-if)#switchport mode tr
IOU1(config-if)#switchport mode trunk
Command rejected: An interface whose trunk encapsulation is “Auto” can not be configured to “trunk” mode.
IOU1(config-if)#sw
IOU1(config-if)#switchport tr
IOU1(config-if)#switchport trunk en
IOU1(config-if)#switchport trunk encapsulation do
IOU1(config-if)#switchport trunk encapsulation dot1q
IOU1(config-if)#sw
IOU1(config-if)#switchport mo
IOU1(config-if)#switchport mode
*Mar 29 11:41:54.052: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet1/0, changed state to down
IOU1(config-if)#switchport mode tr
IOU1(config-if)#switchport mode trunk
IOU1(config-if)#sw
IOU1(config-if)#switchport tr
IOU1(config-if)#switchport trunk all
IOU1(config-if)#switchport trunk allowed vl
IOU1(config-if)#switchport trunk allowed vlan
*Mar 29 11:42:00.507: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet1/0, changed state to up
IOU1(config-if)#switchport trunk allowed vlan 10
IOU1(config-if)#switchport trunk allowed vlan ad
IOU1(config-if)#switchport trunk allowed vlan add 20
Verify trunk
IOU1#show interfaces trunk
Port Mode Encapsulation Status Native vlan
Et1/0 on 802.1q trunking 1
Port Vlans allowed on trunk
Et1/0 10,20
Port Vlans allowed and active in management domain
Et1/0 10,20
Port Vlans in spanning tree forwarding state and not pruned
Et1/0 10,20
Check connectivity using ping from sales PC to MKT PC
PC1> ping 192.168.10.1
84 bytes from 192.168.10.1 icmp_seq=1 ttl=255 time=6.105 ms
84 bytes from 192.168.10.1 icmp_seq=2 ttl=255 time=7.732 ms
84 bytes from 192.168.10.1 icmp_seq=3 ttl=255 time=3.082 ms
84 bytes from 192.168.10.1 icmp_seq=4 ttl=255 time=5.075 ms
84 bytes from 192.168.10.1 icmp_seq=5 ttl=255 time=2.966 ms
PC1> ping 192.168.20.2
84 bytes from 192.168.20.2 icmp_seq=1 ttl=63 time=16.393 ms
84 bytes from 192.168.20.2 icmp_seq=2 ttl=63 time=11.805 ms
84 bytes from 192.168.20.2 icmp_seq=3 ttl=63 time=7.195 ms
84 bytes from 192.168.20.2 icmp_seq=4 ttl=63 time=26.514 ms
84 bytes from 192.168.20.2 icmp_seq=5 ttl=63 time=5.467 ms

Leave a Reply

Your email address will not be published. Required fields are marked *