Inter vlan Routing does not work

Answered Question
Jul 10th, 2012

Dear boss

I have cisco 3845 router  and 4507 & 2960 switch.  I have 4 Vlans on 4507  and connected to router on  four ports. Its working fine.

Now i want to create another vlan ( vlan 15 ) that trunk with vlan 20 and router port f0/0/1. i.e router F 0/0/1 ports belongs only two vlan(15,20) and need to intervlan routing. My conf. given below. but it is not working.

Switch conf:

interface GigabitEthernet3/1

description ## to router##

switchport trunk encapsulation dot1q

switchport trunk allowed vlan 15-21

switchport mode trunk

interface Vlan15

ip address 192.168.3.250 255.255.255.0

!

interface Vlan20

ip address 192.168.0.250 255.255.255.0

interface GigabitEthernet3/2

description ## To local lan-15 ##

switchport acc vlan 15

interface GigabitEthernet3/3

description  ## To Local lan-20 ##

switch port acc vlan 20

ip route 0.0.0.0 0.0.0.0 192.168.0.252

Router conf:

interface FastEthernet0/0/1

ip address 192.168.0.252 255.255.255.0

ip flow ingress

ip flow egress

ip nat outside

ip virtual-reassembly

duplex auto

speed auto

ntp broadcast

standby 4 ip 192.168.0.254

standby 4 priority 140

standby 4 preempt

standby 4 track GigabitEthernet0/1

standby 4 track FastEthernet0/0/0

standby 4 track GigabitEthernet0/0

!

interface FastEthernet0/0/1.2

encapsulation dot1Q 15

ip address 192.168.3.252 255.255.255.0

How can i do intervlan routing as ping from vlan 15 to 20.

shahid

I have this problem too.
0 votes
Correct Answer by Sandeep Choudhary about 1 year 9 months ago

HI Shahid,

I am agree with Paolo.

you have to configure subinterfaces for encapsulation.

see the example:If you are configuring on Router


Create sub-interfaces, set 802.1Q trunking protocol and ip address on each sub-interface

Router(config)#interface f0/0
Router(config-if)#no shutdown

(Note: The main interface f0/0 doesn’t need an IP address but it must be turned on)

Router(config)#interface f0/0.0
Router(config-subif)#encapsulation dot1q 15
Router(config-subif)#ip address 192.168.15.1 255.255.255.0
Router(config-subif)#interface f0/0.1
Router(config-subif)#encapsulation dot11 20
Router(config-subif)#ip address 192.168.20.1 255.255.255.0

(Note: In the “encapsulation dot1q 15″ command, 15 is the VLAN ID this interface operates in)

Configure VLAN

Switch(config)#vlan 15
Switch(config-vlan)#name SALES
Switch(config-vlan)#vlan 20
Switch(config-vlan)#name TECH

Set ports to access mode & assign ports to VLAN

Switch(config)#interface range fa0/1
Switch(config-if)#no shutdown
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 15
Switch(config-if)#interface range fa0/3
Switch(config-if)#no shutdown
Switch(config-if)#switchport mode access
Switch(config-if)# switchport access vlan 20

see the example:If you are configuring on layer 3 switch:

ip routing
!
interface FastEthernet0/1
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/3
switchport access vlan 20
switchport mode access

interface Vlan15
ip address 192.168.15.1 255.255.255.0
!
interface Vlan20
ip address 192.168.20.1 255.255.255.0

And on hosts just assign IP addresses and default gateways (to the corresponding interface VLANs) -> hosts in different VLANs can communicate.

Regards

Please rate if it helps

Correct Answer by Paolo Bevilacqua about 1 year 9 months ago

Configure some router subinterface for encapsulation dot1Q 20

Anyway since you have a layer3 switch, it is better to configure inter-vlan routing there and not on the router.

  • 1
  • 2
  • 3
  • 4
  • 5
Average Rating: 5 (2 ratings)
Correct Answer
Paolo Bevilacqua Tue, 07/10/2012 - 13:05

Configure some router subinterface for encapsulation dot1Q 20

Anyway since you have a layer3 switch, it is better to configure inter-vlan routing there and not on the router.

Correct Answer
Sandeep Choudhary Tue, 07/10/2012 - 13:17

HI Shahid,

I am agree with Paolo.

you have to configure subinterfaces for encapsulation.

see the example:If you are configuring on Router


Create sub-interfaces, set 802.1Q trunking protocol and ip address on each sub-interface

Router(config)#interface f0/0
Router(config-if)#no shutdown

(Note: The main interface f0/0 doesn’t need an IP address but it must be turned on)

Router(config)#interface f0/0.0
Router(config-subif)#encapsulation dot1q 15
Router(config-subif)#ip address 192.168.15.1 255.255.255.0
Router(config-subif)#interface f0/0.1
Router(config-subif)#encapsulation dot11 20
Router(config-subif)#ip address 192.168.20.1 255.255.255.0

(Note: In the “encapsulation dot1q 15″ command, 15 is the VLAN ID this interface operates in)

Configure VLAN

Switch(config)#vlan 15
Switch(config-vlan)#name SALES
Switch(config-vlan)#vlan 20
Switch(config-vlan)#name TECH

Set ports to access mode & assign ports to VLAN

Switch(config)#interface range fa0/1
Switch(config-if)#no shutdown
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 15
Switch(config-if)#interface range fa0/3
Switch(config-if)#no shutdown
Switch(config-if)#switchport mode access
Switch(config-if)# switchport access vlan 20

see the example:If you are configuring on layer 3 switch:

ip routing
!
interface FastEthernet0/1
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/3
switchport access vlan 20
switchport mode access

interface Vlan15
ip address 192.168.15.1 255.255.255.0
!
interface Vlan20
ip address 192.168.20.1 255.255.255.0

And on hosts just assign IP addresses and default gateways (to the corresponding interface VLANs) -> hosts in different VLANs can communicate.

Regards

Please rate if it helps

shahid_duet Tue, 07/10/2012 - 13:38

Mr. Sandeep

Thank you very much for such clear concept with example.

shahid

soroushm Tue, 07/10/2012 - 13:12

Hi Shahid,

Agree with Paolo, from ur post i have this impression that u r mostly using Gigabit switched interfaces, doing intervlan routing on a "Router on a stick" fashion with Fastethernet interfaces could seriously slow down ur network. use the Layer 3 Capability.

Hope it Helps,

Soroush.

Actions

Login or Register to take actions

This Discussion

Posted July 10, 2012 at 12:39 PM
Stats:
Replies:4 Avg. Rating:5
Views:885 Votes:0
Shares:0

Related Content

Discussions Leaderboard