cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
677
Views
15
Helpful
3
Replies

2 switches and 2 connections

mota21966
Level 1
Level 1

i have 2 switches connected with 2 links.

i want to set 1 connection to vlan 10

and the other one to vlan 20 and fallback for vlan 10 in case the first connection fails

how do i do that?

1 Accepted Solution

Accepted Solutions

Asemmoqbel
Level 1
Level 1

Hi,

 

You can do that by playing with Spanning Tree Protocol which blocks links to prevents loops from happening.

 

What you will do as following

First:  configure both links on both switches as trunk and add to them Vlan 10 and 20 with this command: "" switchport trunk allowed vlan 10,20 ""

 

Second: now STP is running and I will assume bridge pritority for both SW are same so SW that has lowest mac value will be elected. the elected root SW for both vlans will have all ports up and forwarded.

 

Third: There will be STP instance for each vlan. the Non-root SW will have one port blocked and now you will modify STP cost per interface to meet your requirement.

 

Fourth: at Non-root SW, choose one of the port and apply this command to the interface: "" spanning-tree vlan 10 cost 3 ""

and in the other one apply this:  spanning-tree vlan 20 cost 3

 

Now you will have one link primary for vlan 10 and it will fallback to the other link if the primary fails.

Ans also you will have one link primary for vlan 20 and it will fallback to the other link if primary fails.

 

To confirm your configurations, here is the commands you can check the output "" show spanning-tree vlan 10 "" and "" show spanning-tree vlan 20 ""

you should see one port blocked for vlan 10 and same port forwarded for vlan 10 and also same with vlan 20.

 

Important note: if you have vlan 1 configured and you need it traverse between switches, add it also to the ports.

 

I hope this clear to you.

 

Please rate if it helps you.

 

Best regards

Asem 

View solution in original post

3 Replies 3

Asemmoqbel
Level 1
Level 1

Hi,

 

You can do that by playing with Spanning Tree Protocol which blocks links to prevents loops from happening.

 

What you will do as following

First:  configure both links on both switches as trunk and add to them Vlan 10 and 20 with this command: "" switchport trunk allowed vlan 10,20 ""

 

Second: now STP is running and I will assume bridge pritority for both SW are same so SW that has lowest mac value will be elected. the elected root SW for both vlans will have all ports up and forwarded.

 

Third: There will be STP instance for each vlan. the Non-root SW will have one port blocked and now you will modify STP cost per interface to meet your requirement.

 

Fourth: at Non-root SW, choose one of the port and apply this command to the interface: "" spanning-tree vlan 10 cost 3 ""

and in the other one apply this:  spanning-tree vlan 20 cost 3

 

Now you will have one link primary for vlan 10 and it will fallback to the other link if the primary fails.

Ans also you will have one link primary for vlan 20 and it will fallback to the other link if primary fails.

 

To confirm your configurations, here is the commands you can check the output "" show spanning-tree vlan 10 "" and "" show spanning-tree vlan 20 ""

you should see one port blocked for vlan 10 and same port forwarded for vlan 10 and also same with vlan 20.

 

Important note: if you have vlan 1 configured and you need it traverse between switches, add it also to the ports.

 

I hope this clear to you.

 

Please rate if it helps you.

 

Best regards

Asem 

thank you,

i ended up using

 

spanning-tree vlan 10 priority 4096
spanning-tree vlan 20 priority 0

 

on switch 1 and

 

spanning-tree vlan 10 priority 0
spanning-tree vlan 20 priority 4096

on switch 2

 

 

 

That's great and you are welcome.

 

Best regards

Asem

Review Cisco Networking for a $25 gift card