HSRP Hot Standby Routing Protocol, STP Spanning Tree Protocol

【HSRP Hot Standby Routing Protocol, STP Spanning Tree Protocol】 1. What is HSRP
? What is the working principle? Communication can be restored quickly and transparently, thus providing redundancy for IP networks. By using the same virtual IP address and virtual MAC address, two or more routers on the LAN segment can serve as a virtual router to provide external services. HSRP enables cisco routers in a group to monitor each other's running status. ——HSRP Hot Backup Routing Protocol—— HSRP group members: active (transmitting data first), backup (monitoring active routers, and taking over when the active routers are unavailable), virtual, other routers (members must be on the same network segment, intranet Form) UDP port number is 1985, use public address 224.0.0.2, TTL=1 HSRP state initial, learning, monitoring (mutual monitoring priority), speaking, backup, active HSRP timer: Hello interval 3s, hold time 10s








——HSRP configuration——
Configure as HSRP member
Switch(config-if)# standby 1 ip 192.168.1.254
Configure HSRP priority
Switch(config)#interface f0/0
Switch(config-if)#standby 1 ip 192.168 .1.254
Switch(config-if)#standby 1 priority (priority) 200
%HSRP-6-STATECHANGE: FastEthernet9 Fast Ethernet) 0/0 Grp (group) 1 state (state) Speak (speaking) -> Standby
%HSRP- 6-STATECHANGE: FastEthernet0/0 Grp 1 state Standby -> Active


Configure HSRP preemption
Switch(config)#interface fastEthernet 0/0
Switch(config-if)#standby 1 track f0/1
Switch(config)#interface fastEthernet 0/0
Switch(config-if)#standby 1 preempt (first take, Buy first) (backup priority)
Configure HSRP port tracking
Switch(config-if)# standby 1 track (tracking) int f 0/1
View HSRP summary information
Switch(config-if)# show standby brief(summary)

——二层交换配置HSRP——
SW1(config)# int f 0/24
SW1(config-if)# ip address 192.168.1.253 255.255.255.0
SW1(config-if)# standby 1 ip 192.168.1.254
SW1(config-if)# standby 1 priority(优先) 200
SW1(config-if)# standby 1 preempt(
SW1(config-if)# standby 1 track int f 0/1
SM1(config)#router rip
SM1(config-router)#version 2
SM1(config-router)#no auto-summary
SM1(config-router)#network 192.168.1.0
SM1(config-router)#network 192.168.2.0

SW2(config)# int f 0/24
SW2(config-if)# ip address 192.168.1.252 255.255.255.0
SW2(config-if)# standby 1 ip 192.168.1.254
SW2(config-if)# standby 1 priority 150
SW2(config-if)# standby 1 preempt
SW2(config-if)# standby 1 track int f 0/1
SM2(config)#router rip
SM2(config-router)#version 2
SM2(config-router)#no auto-summary
SM2(config-router)#network 192.168.1.0
SM2(config-router)#network 192.168.3.0

——三层交换配置HSRP——
SW-3L1(config)# int f 0/24
SW-3L1(config-if)# ip address 192.168.1.253 255.255.255.0
SW-3L1(config-if)# standby 1 ip 192.168.1.254
SW-3L1(config-if)# standby 1 priority 200
SW-3L1(config-if)# standby 1 preempt
SW-3L1(config-if)# standby 1 track int f 0/1

SW-3L2(config)# int f 0/24
SW-3L2(config-if)# ip address 192.168.1.252 255.255.255.0
SW-3L2(config-if)# standby 1 ip 192.168.1.254
SW-3L2(config-if)# standby 1 priority 150
SW-3L2(config-if)# standby 1 preempt
SW-3L2(config-if)# standby 1 track int f 0/1

SW-3L(config)# ip routing
SW-3L(config)# int v 1
SW-3L(config-if)# ip address 192.168.1.254 255.255.255.0
SW-3L(config-if)# no shutdown
SW-3L(config-if)# no switchport
SW-3L(config)# int f 0/24
SW-3L(config-if)# switchport trunk encapsulation dot1q
SW-3L(config-if)# switchport mode trunk
outer(config)#router rip
Router(config-router)#version 2
Router(config-router)#no auto-summary
Router(config-router)#network 192.168.2.0
Router(config-router)#network 192.168.3.0
Router(config-router)#network 192.168.4.0


- STP Spanning Tree Protocol -
STP: Spanning Tree Protocol
function: logically disconnect the loop to prevent the generation of broadcast storms. When the line fails, the blocked interface is activated, restores communication, and
acts as a backup line.
Spanning tree algorithm:
1. Root bridge: select a root bridge for each broadcast domain, the BID (bridge id: bridge priority 32768 + mac address of the bridge) is the smallest
2. Root port: each non-root network The bridge selects a root port respectively, with low path cost (short transmission time, network speed), small interface ID (connected to the opposite interface f0/1), green
3. Designated port: selected on each network segment (line between switches) Designated port, yellow
4. Blocked port: unselected port is blocked port, red

Bandwidth and path cost:
10Mbps-----100
16Mbps------62
45Mbps------39
100Mbps----19
155Mbps----14
622Mbps-----6
1000Mbps-- -4

BDDU Bridge Protocol Data Unit
Root Bridge ID-----8bit
Root Path Cost---4bit
Sending Bridge ID---8bit
Port ID--------2bit

5-state forwarding, learning, listening, blocking, and disabling of STP's convergence
switch port STP

——STP configuration——

PVST+ configuration
Select stable switch as root bridge
Enable spanning tree command
Switch(config)# spanning-tree vlan vlan-id
specify root bridge
Switch(config)# spanning-tree vlan vlan-id priority n4096 (Priority)
Specifies the primary and secondary root of the VLAN
Switch(config)# spanning-tree vlan id (1/2/3...) root { primary (primary root) | secondary (secondary root) }
View spanning tree configuration
Switch# show spanning -tree
View the detailed information of a VLAN spanning tree
Switch# show spanning-tree vlan vlan-id detail
Configure fast ports (avoid forwarding delay)
Switch(config-if)# spanning-tree portfast

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324937066&siteId=291194637