cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5865
Views
0
Helpful
16
Replies

Inter VLAN Routing - Cisco

paramjots
Level 1
Level 1

I am trying to establish inter vlan connectivity between two 3850 switches. I setup a test environment in my private lab as follows

Switch 1

VLAN 116 10.1.16.254 (PC1 on this nertwork - 10.1.16.1)

VLAN 131 10.1.31.254 (PC2 on this network - 10.1.31.1)

Switch 2

VLAN 132 10.1.32.254 (PC3 on this network - 10.1.32.1)

VLAN 230 10.2.30.254 (PC4 on this network - 10.2.30.1)

PC's are pinging each other in the same switch as I enabled "ip routing" command on the switch. But I am not able ping from Switch 1 PCs to Switch 2 PCs.

I also tried enabling trunk mode on both the switches but no success. Could anybody help me in this.

I am not sure this is right place to post this question.

1 Accepted Solution

Accepted Solutions

Joseph W. Doherty
Hall of Fame
Hall of Fame

There are a few of ways to accomplish that.

One way, would be to define a routed port on each 3850 and configure it as a p2p link between the two switches.  Then you could static route or run a routing protocol between them.

e.g. (static routing, g1<>g1)

sw1

int g1
 no switchport
 ip address 192.168.1.1 255.255.255.252

ip route 10.1.32.0 255.255.255.0 192.168.1.2 !assuming /24
ip route 10.2.30.0 255.255.255.0 192.168.1.2 !assuming /24


sw2

int g1
 no switchport
 ip address 192.168.1.2 255.255.255.252

ip route 10.1.16.0 255.255.255.0 192.168.1.1 !assuming /24
ip route 10.1.31.0 255.255.255.0 192.168.1.1 !assuming /24

View solution in original post

16 Replies 16

Dennis Mink
VIP Alumni
VIP Alumni

there is no common subnet between the two switches, so you cant route between them.

add a vlan 100 between the two, and assign a subnet to that vlan 100 and stick each swith in that vlan and add static routes from one switch to the other, and vice versa.

do a sh ip route on each switch to see if the can "see" eachothers subnets

cheers

Please remember to rate useful posts, by clicking on the stars below.

johnd2310
Level 8
Level 8

Hi,

 You also need to enable  routing between the two switches so that each switch knows about the networks on the other switch. Create another vlan which is available on both switches and configure static routing or enable dynamic routing e.g.

Switch 1
VLAN 116 10.1.16.254 (PC1 on this nertwork - 10.1.16.1)
VLAN 131 10.1.31.254 (PC2 on this network - 10.1.31.1)
VLAN 100 10.1.1.1 255.255.255.0
ip route 10.1.32.0 255.255.255.0 10.1.1.2
ip route 10.2.30.0 255.255.255.0 10.1.1.2

Switch 2
VLAN 100 10.1.1.2 255.255.255.0
VLAN 132 10.1.32.254 (PC3 on this network - 10.1.32.1)
VLAN 230 10.2.30.254 (PC4 on this network - 10.2.30.1)
ip route 10.1.16.0 255.255.255.0 10.1.1.1
ip route 10.1.31.0 255.255.255.0 10.1.1.1

In this example vlan 100 is common to both switches and  trunked between the switches. This example uses static routing but you could do the same by enabling dynamic routing between the switches.

Thanks

John

**Please rate posts you find helpful**

Actually I tried RIP also but it didn't work out. You can check from the screenshot of Switch 2 IP Route. I did same in Switch 1 also. Then I created the VLAN and still cant able to ping. Please refer to the screen shots where I am making mistake in routing.

Hi,

Have you created vlan 100 i.e.

vlan 100

 name test

 

is interface vlan 100 up

Thanks

John

**Please rate posts you find helpful**

Yes it is up. I ran no shut after assigning IP to vlan 100. I did sh ip route and still it showing C paths. Is there a need to assign a port to vlan 100 and make that port trunk to each other with dot1q encapsulation ?

Ping results: Destination is unreachable.

There is no reason to make the ports between the 2 switches trunk, just stick it in vlan 100, what subnet are you using for vlan 100, and what IP in that subnet did you put on each switch and can you ping from one to the other?

Please remember to rate useful posts, by clicking on the stars below.

I created vlan 100 and assigned IP 10.1.1.1 and add port g0/1 by issuing switchport access vlan 100 in int g0/1. Same in switch 2 vlan 100 with IP 10.1.1.2 and added g0/2. Now I am getting message CDP-4 NATIVE VLAN MISMATCH discovered on gigabit Ethernet 0/1 (1), with switch gigabit Ethernet 0/2 (100)

Hello

I would suggest utilize a first hop routing protocol such like HRSP , below basic connectivity CFG

SW1
ip routing
vlan 116,131,132,230

interface Vlan116
 ip address 10.1.16.252 255.255.255.0
 standby 116 ip 10.1.16.254
 standby 116 priority 120   <------------------------Primary for Sw1
 standby 116 preempt

interface Vlan131
ip address 10.1.31.252 255.255.255.0
standby 131 ip 10.1.31.254
standby 131 preempt
standby 131 priority 120 <------------------------Primary for Sw1

interface Vlan132
ip address 10.1.32.252 255.255.255.0
standby 132 ip 10.1.32.254
standby 132 preempt

interface Vlan230
ip address 10.2.30.252 255.255.255.0
standby 230 ip 10.2.30.254
standby 230 preempt

int x/x
description Trunk to Sw2
switchport mode trunk
switchport nonegotiate



SW2

ip routing
vlan 116,131,132,230

interface Vlan116
 ip address 10.1.16.253 255.255.255.0
 standby 116 ip 10.1.16.254
 standby 116 preempt

interface Vlan131
 ip address 10.1.31.253 255.255.255.0
 standby 131 ip 10.1.31.254
 standby 131 preempt

interface Vlan132
 ip address 10.1.32.253 255.255.255.0
 standby 132 ip 10.1.32.254
 standby 132 priority 120 <------------------------Primary for Sw2
 standby 132 preempt

interface Vlan230
 ip address 10.2.30.253 255.255.255.0
 standby 230 ip 10.2.30.254
 standby 230 priority 120 <------------------------Primary for Sw2
 standby 230 preempt

int x/x
description Trunk to Sw1

switchport mode trunk
switchport nonegotiate


res
Paul


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

According this configuration I have to change the IP address of the vlans ?

hello

yes that is correct as the DG will be now a virtual address assigned to the hrsp of L3 SVI's for resiliency 

res

paul


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Thanks. My original cofiguration have 5 VLANs (116, 131, 132, 230 & 235) on switch 1. And 7 VLANs (330, 430, 530, 630, 730, 830 & 930) on Switch 2 with ports assigned to those VLANs in both switches and configured as Switchport Mode Access.

But I didn't get, on which vlan I have to write "preempt"

Priority 120 goes to the primary vlan's of the switches. Please bare with me I am new to Cisco. Could you please tell. Thanks

And I am not using any router in the environment. Trying to ping switch to switch VLAN.

Hi tried your configuration in Packet tracer with 3560 Switches by creating 116, 131 vlan on switch 1 and 132, 230 on switch 2 with some ports assigned to both the vlans. And enabled Ip Routing. One PC is connected to each vlan in both the switches.

After this I followed your config in both the switches.

Still I cant ping from the PC of SW 2 to SW 1 and vice versa. Ping works within the switch vlan.

I dont know it is really doable in switches or not ? Please advise.

Thanks

Joseph W. Doherty
Hall of Fame
Hall of Fame

There are a few of ways to accomplish that.

One way, would be to define a routed port on each 3850 and configure it as a p2p link between the two switches.  Then you could static route or run a routing protocol between them.

e.g. (static routing, g1<>g1)

sw1

int g1
 no switchport
 ip address 192.168.1.1 255.255.255.252

ip route 10.1.32.0 255.255.255.0 192.168.1.2 !assuming /24
ip route 10.2.30.0 255.255.255.0 192.168.1.2 !assuming /24


sw2

int g1
 no switchport
 ip address 192.168.1.2 255.255.255.252

ip route 10.1.16.0 255.255.255.0 192.168.1.1 !assuming /24
ip route 10.1.31.0 255.255.255.0 192.168.1.1 !assuming /24