Cisco integrated configuration (four)

MSTP + HSRP mode

 

To achieve the alternate routing, redundancy:

VLAN10,20 traffic on CO-SW1 is in the active state, the CO-SW2 is in standby state,

 VLAN30,40 traffic on CO-SW1 as standby state, the CO-SW2 is in the active state;

Avoiding loops using MSTP (Multiple Spanning Tree Protocol):

Based on the root flow VLAN10,20 CO-SW1, SW2-on for the second root CO.'S, that is, avoid loops, f0 switch1 the F0 / 2 and switch2 / 2, the block state,

Based on the root flow VLAN30,40 CO-SW2, CO-SW1 is on th root, that is, avoid loops, the Switch1 f0 / 1 and switch2 of f0 / 1, the block state,

 

Configuration is as follows:

Co-SW1:

Switch>enable

Switch#configure t

Switch(config)#vlan 10

Switch(config-vlan)#vlan 20

Switch(config-vlan)#vlan 30

Switch(config-vlan)#vlan 40

Switch(config-vlan)#exit

Switch(config)#interface range f0/1-2

Switch(config-if-range)# no shutdown

Switch(config-if-range)#switchport trunk encapsulation dot1q

Switch(config-if-range)#switchport mode trunk

Switch(config-if)# exit

# Set the polymerization

Switch(config)#inter range f0/3 -4

Switch(config-if-range)#channel-group 1 mode on

Switch(config-if-range)#exit

Switch(config)#interface port-channel 1

Switch(config-if)#switchport trunk encapsulation dot1q

Switch(config-if)#switchport mode trunk

Switch(config-if)#exit

 

# MSTP configuration vlan10,20 the main root, vlan30,40 for the second root

switch(config)#spanning-tree mode mstp

switch(config)#spanning-tree mst configuration

switch(config-mst)# name Cisco

switch(config-mst)#revision 1

switch(config-mst)#interface 1 vlan 10,20

switch(config-mst)#interface 2 vlan 30,40

switch(config)#spanning-tree mst 1 root primary

switch(configt)#spanning-tree mst 2 root secondary

 

# Configure HSRP

switch(config)#interface vlan 10

switch(config)#ip address 192.168.10.2 255.255.255.0

switch(config-if)#standby 1 ip 192.168.20.254

switch(config-if)#standby 1 priority 120

switch(config-if)#standby 1 preempt

 

switch(config)#interface vlan 20

switch(config)#ip address 192.168.20.2 255.255.255.0

switch(config-if)#standby 2 ip 192.168.20.254

switch(config-if)#standby 2 priority 120

switch(config-if)#standby 2 preempt

 

switch(config)#interface vlan 30

switch(config)#ip address 192.168.30.1 255.255.255.0

switch(config-if)#standby 3 ip 192.168.30.254

switch(config-if)#standby 3 preempt

 

switch(config)#interface vlan 40

switch(config)#ip address 192.168.40.1 255.255.255.0

switch(config-if)#standby 4 ip 192.168.40.254

switch(config-if)#standby 4 preempt

 

Co-SW2:

Switch>enable

Switch#configure t

Switch(config)#vlan 10

Switch(config-vlan)#vlan 20

Switch(config-vlan)#vlan 30

Switch(config-vlan)#vlan 40

Switch(config-vlan)#exit

Switch(config)#interface range f0/1-2

Switch(config-if-range)# no shutdown

Switch(config-if-range)#switchport trunk encapsulation dot1q

Switch(config-if-range)#switchport mode trunk

Switch(config-if)# exit

# Set the polymerization

Switch(config)#inter range f0/3 -4

Switch(config-if-range)#channel-group 1 mode on

Switch(config-if-range)#exit

Switch(config)#interface port-channel 1

Switch(config-if)#switchport trunk encapsulation dot1q

Switch(config-if)#switchport mode trunk

Switch(config-if)#exit

#MSTP configured vlan10,20 as a secondary root, vlan30,40 main root

switch(config)#spanning-tree mode mstp

switch(config)#spanning-tree mst configuration

switch(config-mst)# name Cisco

switch(config-mst)#revision 1

switch(config-mst)#interface 1 vlan 10,20

switch(config-mst)#interface 2 vlan 30,40

switch(config)#spanning-tree mst 1 root secondary

switch(configt)#spanning-tree mst 2 root primary

 

 # Configure HSRP

switch(config)#interface vlan 10

switch(config)#ip address 192.168.10.1 255.255.255.0

switch(config-if)#standby 1 ip 192.168.20.254

switch(config-if)#standby 1 preempt

 

switch(config)#interface vlan 20

switch(config)#ip address 192.168.20.1 255.255.255.0

switch(config-if)#standby 2 ip 192.168.20.254

switch(config-if)#standby 2 preempt

 

switch(config)#interface vlan 30

switch(config)#ip address 192.168.30.2 255.255.255.0

switch(config-if)#standby 3 ip 192.168.30.254

switch(config-if)#standby 3 priority 120

switch(config-if)#standby 3 preempt

 

switch(config)#interface vlan 40

switch(config)#ip address 192.168.40.2 255.255.255.0

switch(config-if)#standby 4 ip 192.168.40.254

switch(config-if)#standby 4 priority 120

switch(config-if)#standby 4 preempt

 

Switch1:

Switch#configure t

Switch(config)#vlan 10

Switch(config-vlan)#vlan 20

Switch(config-vlan)#vlan 30

Switch(config-vlan)#vlan 40

Switch(config-vlan)#exit

Switch(config)#interface range f0/1-2

Switch(config-if-range)# no shutdown

Switch(config-if-range)#switchport trunk encapsulation dot1q

Switch(config-if-range)#switchport mode trunk

Switch(config-if)# exit

#MSTP configuration vlan10,20, vlan30,40 default

switch(config)#spanning-tree mode mstp

switch(config)#spanning-tree mst configuration

switch(config-mst)# name Cisco

switch(config-mst)#revision 1

switch(config-mst)#interface 1 vlan 10,20

switch(config-mst)#interface 2 vlan 30,40

switch(config-mst)#exit

 

Switch2:

Switch#configure t

Switch(config)#vlan 10

Switch(config-vlan)#vlan 20

Switch(config-vlan)#vlan 30

Switch(config-vlan)#vlan 40

Switch(config-vlan)#exit

Switch(config)#interface range f0/1-2

Switch(config-if-range)# no shutdown

Switch(config-if-range)#switchport trunk encapsulation dot1q

Switch(config-if-range)#switchport mode trunk

Switch(config-if)# exit

#MSTP configuration vlan10,20, vlan30,40 default

switch(config)#spanning-tree mode mstp

switch(config)#spanning-tree mst configuration

switch(config-mst)# name Cisco

switch(config-mst)#revision 1

switch(config-mst)#interface 1 vlan 10,20

switch(config-mst)#interface 2 vlan 30,40

switch(config-mst)#exit

 

 

Reference Address: http://www.ccietea.com/

Guess you like

Origin www.cnblogs.com/BackingStar/p/12543481.html