HSRP 的配置方法及实验
HSRP实验

HSRP 一网络拓扑图二实验思路1.vlan trunk 的配置2.ip地址配置3.DHCP DHCP中继配置4.HSRP配置三实验步骤ESW3的基本步骤ESW3#vlan databaseESW3(vlan)#vlan 10VLAN 10 modified:ESW3(vlan)#vlan 20VLAN 20 modified:ESW3(vlan)#vlan 30VLAN 30 modified:ESW3(vlan)#vlan 40VLAN 40 modified:ESW3(vlan)#exitESW3#configESW3(config)#interface f1/0ESW3(config-if)#switchport mode access ESW3(config-if)#switchport access vlan 10 ESW3(config-if)#interface f1/1ESW3(config-if)#switchport mode access ESW3(config-if)#switchport access vlan 20 ESW3(config-if)#interface f1/2ESW3(config-if)#switchport mode access ESW3(config-if)#switchport access vlan 30 ESW3(config-if)#interface f1/3ESW3(config-if)#switchport mode accessESW3(config-if)#switchport access vlan 40ESW3(config-if)#exitESW3(config)#interface fastEthernet 1/4ESW3(config-if)#switchport trunk encapsulation dot1q ESW3(config-if)#switchport mode trunkESW3(config-if)#interface fastEthernet 1/5ESW3(config-if)#switchport trunk encapsulation dot1q ESW3(config-if)#switchport mode trunkESW1的基本配置ESW1#vlan databaseESW1(vlan)#vlan 10VLAN 10 modified:ESW1(vlan)#vlan 20VLAN 20 modified:ESW1(vlan)#vlan 30VLAN 30 modified:ESW1(vlan)#vlan 40VLAN 40 modified:ESW1(vlan)#exitESW1(config)#interface fastEthernet1/2ESW1(config-if)#ip address 192.168.100.1 255.255.255.0 ESW1(config)#interface fastEthernet 1/0ESW1(config-if)#switchport trunk encapsulation dot1q ESW1(config-if)#switchport mode trunkESW1(config-if)#interface fastEthernet 1/1ESW1(config-if)#switchport trunk encapsulation dot1q ESW1(config-if)#switchport mode trunkESW1(config-if)#exESW1(config)#interface vlan 10ESW1(config-if)#ip address 192.168.10.1 255.255.255.0 ESW1(config-if)#standby 10 ip 192.168.10.254ESW1(config-if)# standby 10 priority 200ESW1(config-if)#standby 10 preemptESW1(config)#interface vlan 20ESW1(config-if)#ip address 192.168.20.1 255.255.255.0 ESW1(config-if)#standby 20 ip 192.168.20.254ESW1(config-if)# standby 20 priority 200ESW1(config-if)#standby 20 preemptESW1(config)#interface vlan 30ESW1(config-if)#ip address 192.168.30.1 255.255.255.0 ESW1(config-if)#standby 30 ip 192.168.30.254ESW1(config-if)#standby 30 priority 150ESW1(config-if)#standby 30 preemptESW1(config)#interface vlan 40ESW1(config-if)#ip address 192.168.40.1 255.255.255.0ESW1(config-if)#standby 40 ip 192.168.40.254 ESW1(config-if)#standby 40 priority 150ESW1(config-if)#standby 40 preemptESW1(config-if)#exESW1(config)#interface vlan 10ESW1(config-if)#ip helper-address 192.168.100.2 ESW1(config)#interface vlan 20ESW1(config-if)#ip helper-address 192.168.100.2 ESW1(config)#interface vlan 30ESW1(config-if)#ip helper-address 192.168.100.2 ESW1(config)#interface vlan 40ESW1(config-if)#ip helper-address 192.168.100.2 ESW2的基本配置ESW2#vlan databaseESW2(vlan)#vlan 10VLAN 10 modified:ESW2(vlan)#vlan 20VLAN 20 modified:ESW2(vlan)#vlan 30VLAN 30 modified:ESW2(vlan)#vlan 40VLAN 40 modified:ESW2(vlan)#exitESW2(config)#interface fastEthernet1/2ESW2(config-if)#ip address 192.168.200.1 255.255.255.0 ESW2(config)#interface fastEthernet 1/0ESW2(config-if)#switchport trunk encapsulation dot1q ESW2(config-if)#switchport mode trunkESW2(config-if)#interface fastEthernet 1/1ESW2(config-if)#switchport trunk encapsulation dot1q ESW2(config-if)#switchport mode trunkESW2(config-if)#exESW2(config)#interface vlan 10ESW2(config-if)#ip address 192.168.10.2 255.255.255.0 ESW2(config-if)#standby 10 ip 192.168.10.254ESW2(config-if)#standby 10 priority 150ESW2(config-if)#standby 10 preemptESW2(config)#interface vlan 20ESW2(config-if)#ip address 192.168.20.2 255.255.255.0 ESW2(config-if)#standby 20 ip 192.168.20.254ESW2(config-if)# standby 20 priority 150ESW2(config-if)#standby 20 preemptESW2(config)#interface vlan 30ESW2(config-if)#ip address 192.168.30.2 255.255.255.0 ESW2(config-if)#standby 30 ip 192.168.30.254ESW2(config-if)#standby 30 priority 200ESW2(config-if)#standby 30 preemptESW2(config)#interface vlan 40ESW2(config-if)#ip address 192.168.40.2 255.255.255.0 ESW2(config-if)#standby 40 ip 192.168.40.254ESW2(config-if)#standby 40 priority 200ESW2(config-if)#standby 40 preemptESW2(config-if)#exESW2(config)#interface vlan 10ESW2(config-if)#ip helper-address 192.168.200.2ESW2(config)#interface vlan 20ESW2(config-if)#ip helper-address 192.168.200.2ESW2(config)#interface vlan 30ESW2(config-if)#ip helper-address 192.168.200.2ESW2(config)#interface vlan 40ESW2(config-if)#ip helper-address 192.168.200.2R1的基本配置R1#configureR1(config)#interface ethernet 0/1R1(config-if)#ip address 192.168.100.2 255.255.255.0 R1(config-if)#no shutdownR1(config-if)#interface ethernet 0/0R1(config-if)#ip address 192.168.200.2 255.255.255.0R1(config-if)#no shutdownR1(config-if)#exitR1(config)#service dhcpR1(config)#ip dhcp pool vlan10R1(dhcp-config)# network 192.168.10.0 255.255.255.0 R1(dhcp-config)#default-router 192.168.10.1R1(dhcp-config)#dns-server 3.3.3.3R1(dhcp-config)#exitR1(config)#ip dhcp pool vlan20R1(dhcp-config)# network 192.168.20.0 255.255.255.0 R1(dhcp-config)#default-router 192.168.20.1R1(dhcp-config)#dns-server 3.3.3.3R1(dhcp-config)#exitR1(config)#ip dhcp pool vlan30R1(dhcp-config)# network 192.168.30.0 255.255.255.0 R1(dhcp-config)#default-router 192.168.30.1R1(dhcp-config)#dns-server 3.3.3.3R1(dhcp-config)#exitR1(config)#ip dhcp pool vlan40R1(dhcp-config)# network 192.168.40.0 255.255.255.0 R1(dhcp-config)#default-router 192.168.40.1R1(dhcp-config)#dns-server 3.3.3.3R1(dhcp-config)#exitR1(config)#ip route 192.168.10.0 255.255.255.0 192.168.100.1 R1(config)#ip route 192.168.10.0 255.255.255.0 192.168.200.1 R1(config)#ip route 192.168.20.0 255.255.255.0 192.168.100.1 R1(config)#ip route 192.168.20.0 255.255.255.0 192.168.200.1 R1(config)#ip route 192.168.30.0 255.255.255.0 192.168.100.1 R1(config)#ip route 192.168.30.0 255.255.255.0 192.168.200.1 R1(config)#ip route 192.168.40.0 255.255.255.0 192.168.100.1 R1(config)#ip route 192.168.40.0 255.255.255.0 192.168.200.1测试结果PC1 DHCP show ipPC1> dhcpDORA IP 192.168.10.2/24 GW 192.168.10.1PC1> show ipNAME : PC1[1]IP/MASK : 192.168.10.2/24GATEWAY : 192.168.10.1DNS : 3.3.3.3DHCP SERVER : 192.168.100.2DHCP LEASE : 86397, 86400/43200/75600MAC : 00:50:79:66:68:00LPORT : 10000RHOST:PORT : 127.0.0.1:10001MTU: : 1500PC2 DHCP show ipPC2> dhcpDORA IP 192.168.20.2/24 GW 192.168.20.1 PC2> show ipNAME : PC2[1]IP/MASK : 192.168.20.2/24 GATEWAY : 192.168.20.1DNS : 3.3.3.3DHCP SERVER : 192.168.100.2DHCP LEASE : 86394, 86400/43200/75600 MAC : 00:50:79:66:68:01LPORT : 10004RHOST:PORT : 127.0.0.1:10005MTU: : 1500PC3 DHCP show ipPC3> dhcpDORA IP 192.168.30.2/24 GW 192.168.30.1PC3> show ipNAME : PC3[1]IP/MASK : 192.168.30.2/24 GATEWAY : 192.168.30.1DNS : 3.3.3.3DHCP SERVER : 192.168.100.2DHCP LEASE : 86393, 86400/43200/75600 MAC : 00:50:79:66:68:02LPORT : 10002RHOST:PORT : 127.0.0.1:10003MTU: : 1500PC4 DHCP show ipPC4> dhcpDORA IP 192.168.40.2/24 GW 192.168.40.1 PC4> show ipNAME : PC4[1]IP/MASK : 192.168.40.2/24 GATEWAY : 192.168.40.1DNS : 3.3.3.3DHCP SERVER : 192.168.100.2DHCP LEASE : 86394, 86400/43200/75600MAC : 00:50:79:66:68:03LPORT : 10006RHOST:PORT : 127.0.0.1:10007MTU: : 1500PC1pingPC4PC1> ping 192.168.40.2 -t84 bytes from 192.168.40.2 icmp_seq=1 ttl=63 time=37.786 ms 84 bytes from 192.168.40.2 icmp_seq=2 ttl=63 time=31.251 ms 84 bytes from 192.168.40.2 icmp_seq=3 ttl=63 time=37.749 ms 84 bytes from 192.168.40.2 icmp_seq=4 ttl=63 time=15.626 ms 84 bytes from 192.168.40.2 icmp_seq=5 ttl=63 time=31.264 ms当f1/0接口关闭之后192.168.40.2 icmp_seq=6 timeout192.168.40.2 icmp_seq=7 timeout84 bytes from 192.168.40.2 icmp_seq=8 ttl=63 time=31.251 ms 84 bytes from 192.168.40.2 icmp_seq=9 ttl=63 time=37.282 ms 84 bytes from 192.168.40.2 icmp_seq=10 ttl=63 time=84.531 ms 84 bytes from 192.168.40.2 icmp_seq=11 ttl=63 time=31.253 ms84 bytes from 192.168.40.2 icmp_seq=12 ttl=63 time=31.250 ms 84 bytes from 192.168.40.2 icmp_seq=13 ttl=63 time=122.337 ms 84 bytes from 192.168.40.2 icmp_seq=14 ttl=63 time=31.248 ms五调试信息ESW1 show running-configESW1#show running-configBuilding configuration...Current configuration : 2971 bytes!version 12.3service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname ESW1!boot-start-markerboot-end-marker!!no aaa new-modelresource policy!memory-size iomem 5ip subnet-zerono ip icmp rate-limit unreachable ip tcp synwait-time 5!!ip cefno ip domain lookupno ip dhcp use vrf connected!!!!!!!!!!!!!!!vtp file nvram:vlan.dat!!no crypto isakmp ccm!!!!interface FastEthernet1/0 switchport mode trunkduplex fullspeed 100!interface FastEthernet1/1 switchport mode trunkduplex fullspeed 100interface FastEthernet1/2no switchportip address 192.168.100.1 255.255.255.0 duplex fullspeed 100!interface FastEthernet1/3duplex fullspeed 100!interface FastEthernet1/4duplex fullspeed 100!interface FastEthernet1/5duplex fullspeed 100!interface FastEthernet1/6duplex fullspeed 100!interface FastEthernet1/7 duplex fullspeed 100!interface FastEthernet1/8 duplex fullspeed 100!interface FastEthernet1/9 duplex fullspeed 100!interface FastEthernet1/10 duplex fullspeed 100!interface FastEthernet1/11 duplex fullspeed 100!interface FastEthernet1/12 duplex fullspeed 100interface FastEthernet1/13duplex fullspeed 100!interface FastEthernet1/14duplex fullspeed 100!interface FastEthernet1/15duplex fullspeed 100!interface Vlan1no ip addressshutdown!interface Vlan10ip address 192.168.10.1 255.255.255.0 ip helper-address 192.168.100.2standby 10 ip 192.168.10.254standby 10 priority 200standby 10 preemptinterface Vlan20ip address 192.168.20.1 255.255.255.0 ip helper-address 192.168.100.2standby 20 ip 192.168.20.254standby 20 priority 200standby 20 preempt!interface Vlan30ip address 192.168.30.1 255.255.255.0 ip helper-address 192.168.100.2standby 30 ip 192.168.30.254standby 30 priority 150standby 30 preempt!interface Vlan40ip address 192.168.40.1 255.255.255.0 ip helper-address 192.168.100.2standby preemptstandby 40 ip 192.168.40.254standby 40 priority 150!no ip http serverno ip http secure-serverip classless!!!no cdp log mismatch duplex!!!control-plane!!!!!!!!!banner exec ^C************************************************************* **This is a normal Router with a SW module inside (NM-16ESW)It has been preconfigured with hard coded speed and duplexTo create vlans use the command "vlan database" from exec mode After creating all desired vlans use "exit" to apply the configTo view existing vlans use the command "show vlan-switch brief"Warning: You are using an old IOS image for this router. Please update the IOS to enable the "macro" command!************************************************************* **^C!line con 0exec-timeout 0 0privilege level 15logging synchronousline aux 0exec-timeout 0 0privilege level 15logging synchronousline vty 0 4login!!endESW2 show running-configESW2#show running-configBuilding configuration...Current configuration : 3130 bytes!version 12.3service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption!hostname ESW2!boot-start-markerboot-end-marker!!no aaa new-modelresource policy!memory-size iomem 5ip subnet-zerono ip icmp rate-limit unreachable ip tcp synwait-time 5!!ip cefno ip domain lookupno ip dhcp use vrf connected!!!!!!!!!!!!!!!vtp file nvram:vlan.dat!!no crypto isakmp ccm!!!!interface FastEthernet1/0 switchport mode trunkduplex fullspeed 100!interface FastEthernet1/1 switchport mode trunkduplex fullspeed 100interface FastEthernet1/2no switchportip address 192.168.200.1 255.255.255.0 duplex fullspeed 100!interface FastEthernet1/3duplex fullspeed 100!interface FastEthernet1/4duplex fullspeed 100!interface FastEthernet1/5duplex fullspeed 100!interface FastEthernet1/6duplex fullspeed 100!interface FastEthernet1/7 duplex fullspeed 100!interface FastEthernet1/8 duplex fullspeed 100!interface FastEthernet1/9 duplex fullspeed 100!interface FastEthernet1/10 duplex fullspeed 100!interface FastEthernet1/11 duplex fullspeed 100!interface FastEthernet1/12 duplex fullspeed 100interface FastEthernet1/13duplex fullspeed 100!interface FastEthernet1/14duplex fullspeed 100!interface FastEthernet1/15duplex fullspeed 100!interface Vlan1no ip addressshutdown!interface Vlan10ip address 192.168.10.254 255.255.255.0 ip helper-address 192.168.200.2standby 10 ip 192.168.10.254standby 10 priority 150standby 10 preemptinterface Vlan20ip address 192.168.20.254 255.255.255.0 ip helper-address 192.168.200.2standby 20 ip 192.168.20.254standby 20 priority 150standby 20 preempt!interface Vlan30ip address 192.168.30.254 255.255.255.0 ip helper-address 192.168.200.2standby 30 ip 192.168.30.254standby 30 priority 200standby 30 preempt!interface Vlan40ip address 192.168.40.254 255.255.255.0 ip helper-address 192.168.200.2standby 40 ip 192.168.40.254standby 40 priority 200standby 40 preempt!no ip http serverno ip http secure-serverip classless!!!mac-address-table static 0000.0c07.ac1e interface FastEthernet1/1 vlan 30mac-address-table static 0000.0c07.ac28 interface FastEthernet1/1 vlan 40no cdp log mismatch duplex!!!control-plane!!!!!!!!!banner exec ^C************************************************************* **This is a normal Router with a SW module inside (NM-16ESW)It has been preconfigured with hard coded speed and duplexTo create vlans use the command "vlan database" from exec modeAfter creating all desired vlans use "exit" to apply the config To view existing vlans use the command "show vlan-switch brief"Warning: You are using an old IOS image for this router. Please update the IOS to enable the "macro" command!************************************************************* **^C!line con 0exec-timeout 0 0privilege level 15logging synchronousline aux 0exec-timeout 0 0privilege level 15logging synchronousline vty 0 4login!!endESW3 show running-configESW3#show running-configBuilding configuration...Current configuration : 2415 bytes!version 12.3service timestamps debug datetime msec service timestamps log datetime msec no service password-encryptionno service dhcp!hostname ESW3!boot-start-markerboot-end-marker!!no aaa new-model!resource policy!memory-size iomem 5ip subnet-zerono ip routingno ip icmp rate-limit unreachable ip tcp synwait-time 5!!no ip cefno ip domain lookupno ip dhcp use vrf connected!!!!!!!!!!!!!!!vtp file nvram:vlan.dat!!no crypto isakmp ccm!!!!interface FastEthernet1/0 switchport access vlan 10 duplex fullspeed 100interface FastEthernet1/1 switchport access vlan 20 duplex fullspeed 100!interface FastEthernet1/2 switchport access vlan 30 duplex fullspeed 100!interface FastEthernet1/3 switchport access vlan 40 duplex fullspeed 100!interface FastEthernet1/4 switchport mode trunkduplex fullspeed 100!interface FastEthernet1/5 switchport mode trunkduplex fullspeed 100!interface FastEthernet1/6 duplex fullspeed 100!interface FastEthernet1/7 duplex fullspeed 100!interface FastEthernet1/8 duplex fullspeed 100!interface FastEthernet1/9 duplex fullspeed 100!interface FastEthernet1/10 duplex fullspeed 100!interface FastEthernet1/11 duplex fullspeed 100!interface FastEthernet1/12 duplex fullspeed 100!interface FastEthernet1/13 duplex fullspeed 100!interface FastEthernet1/14 duplex fullspeed 100!interface FastEthernet1/15 duplex fullspeed 100!interface Vlan1no ip addressno ip route-cacheshutdown!no ip http serverno ip http secure-server ip classless!!!no cdp log mismatch duplex !!!control-plane!!!!!!!!!banner exec ^C************************************************************* **This is a normal Router with a SW module inside (NM-16ESW)It has been preconfigured with hard coded speed and duplexTo create vlans use the command "vlan database" from exec modeAfter creating all desired vlans use "exit" to apply the config To view existing vlans use the command "show vlan-switch brief"Warning: You are using an old IOS image for this router. Please update the IOS to enable the "macro" command!************************************************************* **^C!line con 0exec-timeout 0 0privilege level 15logging synchronousline aux 0exec-timeout 0 0privilege level 15logging synchronousline vty 0 4login!!endR1 show running-configR1#show running-configBuilding configuration...Current configuration : 2114 bytes!version 12.3service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption!hostname R1!boot-start-markerboot-end-marker!!no aaa new-model!resource policy!memory-size iomem 5ip subnet-zerono ip icmp rate-limit unreachableip tcp synwait-time 5!!ip cefno ip domain lookupno ip dhcp use vrf connected!ip dhcp pool vlan10network 192.168.10.0 255.255.255.0 default-router 192.168.10.1dns-server 3.3.3.3!ip dhcp pool vlan20network 192.168.20.0 255.255.255.0 default-router 192.168.20.1dns-server 3.3.3.3!ip dhcp pool vlan30network 192.168.30.0 255.255.255.0 default-router 192.168.30.1dns-server 3.3.3.3!ip dhcp pool vlan40network 192.168.40.0 255.255.255.0 default-router 192.168.40.1dns-server 3.3.3.3!!!!!!!!!!!!!!!!!no crypto isakmp ccm!!!!interface Ethernet0/0ip address 192.168.200.2 255.255.255.0 half-duplex!interface Ethernet0/1ip address 192.168.100.2 255.255.255.0 half-duplex!interface Ethernet0/2no ip addressshutdownhalf-duplexinterface Ethernet0/3 no ip addressshutdownhalf-duplex!interface Ethernet1/0 no ip addressshutdownhalf-duplex!interface Ethernet1/1 no ip addressshutdownhalf-duplex!interface Ethernet1/2 no ip addressshutdownhalf-duplex!interface Ethernet1/3 no ip addressshutdownhalf-duplex!no ip http serverno ip http secure-serverip classlessip route 192.168.10.0 255.255.255.0 192.168.100.1 ip route 192.168.10.0 255.255.255.0 192.168.200.1 ip route 192.168.20.0 255.255.255.0 192.168.100.1 ip route 192.168.20.0 255.255.255.0 192.168.200.1 ip route 192.168.30.0 255.255.255.0 192.168.100.1 ip route 192.168.30.0 255.255.255.0 192.168.200.1 ip route 192.168.40.0 255.255.255.0 192.168.100.1 ip route 192.168.40.0 255.255.255.0 192.168.200.1 !!!no cdp log mismatch duplex!!!control-plane!!!!!!!!!!line con 0exec-timeout 0 0privilege level 15 logging synchronous line aux 0exec-timeout 0 0privilege level 15 logging synchronous line vty 0 4login!!end六实验结论通过这系列实验,熟悉了HSRP的协议,加深了理解。
多组负载均衡[HSRP]配置实例
![多组负载均衡[HSRP]配置实例](https://img.taocdn.com/s3/m/f2de7a45b307e87100f69605.png)
多组负载均衡[HSRP]配置实例实验配置:一、外网配置:配置R1:Router>enRouter#conf tRouter(config)#hostname R1R1(config)#int S0R1(config-if)#ip add 12.1.1.1 255.255.255.252R1(config-if)#no shutR1(config-if)#int E0R1(config-if)#ip add 192.168.10.100 255.255.255.0R1(config-if)#no shutR1(config)#ip route 0.0.0.0 0.0.0.0 S0R1#sh run配置R2:Router>enRouter#conf tRouter(config)#hostname R2R2(config)#int S0R2(config-if)#ip add 12.1.1.2 255.255.255.252 R2(config-if)#no shutR2(config-if)#clock rate 64000R2(config-if)#int S1R2(config-if)#ip add 23.1.1.2 255.255.255.248 R2(config-if)#no shutR2(config-if)#clock rate 64000R2(config-if)#endR2#sh run配置R3:Router>enRouter#conf tRouter(config)#hostname R3R3(config)#int S0R3(config-if)#ip add 23.1.1.3 255.255.255.248 R3(config-if)#no shutR3(config-if)#ip add 192.168.20.200 255.255.255.0R3(config-if)#no shutR3(config-if)#exitR3(config)#ip route 0.0.0.0 0.0.0.0 S0R3#sh run二、配置NAT:R1#conf tR1(config)#access-list 10 permit 192.168.10.0 255.255.255.0R1(config)#ip nat inside source list 10 interface S0 overloadR1(config)#endR1#sh runR3#conf tR3(config)#access-list 20 permit 192.168.20.0 255.255.255.0R3(config)#ip nat inside source list 20 interface S0 overloadR3(config)#endR3#sh run三、配置HSRP多组负载均衡:R1#conf tR1(config)#int E0R1(config-if)#standby 1 ip add 192.168.10.254 //激活HSRP,设置R1连接的内网的虚拟网关R1(config-if)#standby 1 priority 120 //用于设定端口的HSRP优先级,具有最高备份优先级的HS RP成员将成为激活路由器R1(config-if)#standby 1 preempt //表明当本地路由器的备份优先级超过当前激活路由器时,它就将接管控制权,成为激活路由器R1(config-if)#standby 1 track serial 0 40 //用于设置允许路由器端口根据另一端口的可用性而修改自己的HSRP优先级值(即监视端口状态)R1(config-if)#standby use-bia //启用HSRP多组均衡负载R1(config-if)#standby 2 ip add 192.168.20.254R1(config-if)#standby 2 premptR3#conf tR3(config)#int E0R3(config-if)#standby 2 ip add 192.168.20.254 //激活HSRP,设置R3连接的内网的虚拟网关R3(config-if)#standby 2 priority 120 //用于设定端口的HSRP优先级,具有最高备份优先级的HS RP成员将成为激活路由器R3(config-if)#standby 2 preempt //表明当本地路由器的备份优先级超过当前激活路由器时,它就将接管控制权,成为激活路由器R3(config-if)#standby 2 track serial 0 40 //用于设置允许路由器端口根据另一端口的可用性而修改自己的HSRP优先级值R3(config-if)#standby use-bia //启用HSRP多组均衡负载R3(config-if)#standby 1 ip add 192.168.20.254R3(config-if)#standby 1 prempt配置PC机:PC1:设置本地连接的TCP/IP属性:ip:192.168.10.10 掩码:255.255.255.0 网关:192.168.10.254PC2设置本地连接的TCP/IP属性:ip:192.168.20.20 掩码:255.255.255.0 网关:192.168.20.254分别在PC1和PC2上ping外网,在R1,R3上分别开启地址转换信息显示和HSRP信息显示,可以观察看你想看到的信息。
HSRP的配置

HSRP的配置1:将路由器配置为一个HSRP的成员,可以在端口模式下输入:Standby {group-number} ip {virtual-ip-address}{group-number} 该端口所属的HSRP组,默认是0.{virtual-ip-address} 指定的的虚拟ip地址,如果没有制定,路由器就会通过HSRP HELLO 消息学到虚拟ip地址。
在选择活跃路由器时候,线路上至少有一台路由器被配置。
从HSRP组中取消一个端口:No standby group ip2:关掉端口重定向功能:No ip redirects3:配置HSRP的优先级优先级越大,就越优先成为活跃路由器。
Standby {group-number} priority4:配置HSRP的占先权:当活跃路由器失效后,备份的路由器就自动承担了活跃路由器的角色,即使当较高优先级的原路由器又重新开始在网上工作时,这台备份路由器仍然继续作为转发路由器。
要想原来的较高优先级的路由器从优先级较低的新活跃路由器那里重新取回转发权使用命令:standby {group-number} preempt5:配置HELLO消息的计时器:默认计时器一般是不需要修改。
同一个HSRP组中的HELLO时间和保持时间应该配置的相同。
HELLO间隔时间默认为3秒,可以在1到255之间变化。
保持时间最少应该是HELLO 时间的3倍。
默认的保持时间为10秒。
Standby group-number times hellotime holdtime6:配置HSRP的端口跟踪:检测路由器的另外端口状态,如果被跟踪端口变为Down,其他路由器就接替成为活跃路由器。
这一过程是通过在被跟踪端口的链路状态变为down时减小路由器的优先级实现的。
默认的减小值为10.Standby group-number track type nember interface-priorityType :说明跟踪端口的类型Number:说明跟踪端口号。
华为HSRP协议原理及配置

HSRP协议原理及配置8.1 实验目的:1. 熟悉HSRP协议原理;2. 掌握HSRP的配置;3. 熟悉HSRP的应用。
8.2 实验环境:本实验至少需要三台路由器、一台交换机、两台主机。
实验中用交换机模拟局域网,其中局域网A有两台路由器与局域网B相连,所以为了安全可靠,我们在两台路由器之间进行备份。
这就是我们本实验要讨论的热备份路由协议。
具体的实验组网如下:8.3 实验步骤:8.3.1 实验准备本实验需要使用HSRP协议完成路由器之间的热备份,在HSRP中需要使用到虚拟IP 地址,用该IP地址用作主机的缺省网关,就可以在一台路由器故障时,不修改主机配置而仍然与主机PCC通信。
所以我们首先要规划IP地址。
本实验的IP地址规划如下:路由器的接口IP地址分配如下:RTA RTB RTCE0 10.110.32.11/21 10.110.32.10/21 10.110.10.100/24S0 1.0.0.1/24 1.0.0.2S1 2.0.0.1/24 2.0.0.2各主机的IP地址分配如下:PCA PCB PCCIP 10.110.32.20 10.110.10.30 10.110.10.1Gateway 10.110.32.1 10.110.10.1 10.110.10.1008.3.2 单备份组配置本实验需要路由器RTA与RTB实现热备份,并且正常时以RTA为活动路由器,并且在RTA由故障状态恢复正常时能继续担当活动路由器。
根据实验要求和HSRP协议原理可以设定RTA的优先级较高(默认值为100),同时置抢占标志,即可满足要求。
具体实验配置步骤很简单,不再赘述,下面列出各路由器的配置信息供您参考:RTA(config-if-Ethernet0)#show running-configNow create configuration...Current configuration!version 1.5.6hostname RTA!interface Aux0async mode interactiveencapsulation ppp!interface Ethernet0speed autoduplex autono loopbackip address 10.110.32.11 255.255.248.0standby 1 ip 10.110.32.1 //创建备份组并设定虚拟IP地址standby 1 preempt //设定抢占标志standby 1 priority 120 //设定优先级ip rip version 2 mcast //设定RIP协议版本!interface Serial0encapsulation pppip address 1.0.0.1 255.255.255.0ip rip version 2 mcast!interface Serial1encapsulation ppp!exitrouter ripno auto-summary //取消自动聚合功能network all!endRTB(config-if-Serial1)#show running-configNow create configuration...Current configuration!version 1.5.6hostname RTB!interface Aux0async mode interactiveencapsulation ppp!interface Ethernet0speed autoduplex autono loopbackip address 10.110.32.10 255.255.248.0standby 1 ip 10.110.32.1standby 1 preemptip rip version 2 mcast!interface Serial0encapsulation ppp!interface Serial1encapsulation pppip address 2.0.0.1 255.255.255.0ip rip version 2 mcast!exitrouter ripno auto-summarynetwork all!endRTC(config-if-Serial1)#show running-config Now create configuration...Current configuration!version 1.5.6logging consolehostname RTC!interface Aux0async mode interactiveencapsulation ppp!interface Ethernet0speed autoduplex autono loopbackip address 10.110.10.100 255.255.255.0ip rip version 2 mcast!interface Serial0clock-select DTECLK1encapsulation pppip address 1.0.0.2 255.255.255.0ip rip version 2 mcast!interface Serial1clock-select DTECLK1encapsulation pppip address 2.0.0.2 255.255.255.0ip rip version 2 mcast!exitrouter ripno auto-summarynetwork all!end注意:在配置动态路由协议时,由于使用的是RIP协议,该协议默认版本version 1不支持可变长子网掩码,而实验中设定的IP地址又是A类地址。
HSRP实验指导书

HSRP实验实验6-1HSRP实验学习目标•了解网关冗余技术。
•配置HSRP实现对业务网关的冗余原理HSRP 是Cisco 的专有协议。
HSRP(Hot Standby Router Protocol)把多台路由器组成一个“热备份组”,形成一个虚拟路由器。
这个组内只有一个路由器是活动的(Active),并由它来转发数据包,如果活动路由器发生了故障,备份路由器将成为活动路由器。
从网络内的主机来看,网关并没有改变。
HSRP 路由器利用HELLO 包来互相监听各自的存在。
当路由器长时间没有接收到HELLO包,就认为活动路由器故障,备份路由器就会成为活动路由器。
HSRP 协议利用优先级决定哪个路由器成为活动路由器。
如果一个路由器的优先级比其它路由器的优先级高,则该路由器成为活动路由器。
路由器的缺省优先级是100。
一个组中,最多有一个活动路由器和一个备份路由器。
拓扑图图1拓扑操作步骤步骤一配置汇聚交换机HSRP1、将《VLAN间路由实验》中保存的拓扑打开,要求服务器区设备访问网络主走SW1,图书馆区设备访问网络主走SW2,交换机管理网段主走SW1。
步骤二配置服务器区域VLAN101 HSRP。
1、VLAN101 standby 10.X.0.13、在SW1上关闭F0/1接口验证HSRP切换过程4、在SW1上开启F0/1接口验证HSRP回切过程步骤三配置图书馆区域VLAN103 HSRP 1、VLAN103 standby 10.X.2.12、查看HSRP状态步骤四配置管理VLAN2 HSRP 1、VLAN2 standby 10.X.129.254步骤五设置二层交换机缺省网关及PC机IP参数1、设置SW3-SW6缺省网关(由于模拟器只支持HSRP配置,不支持具体功能,所以接入交换机网关配置为10.0.129.1,本应为standby IP)2、设置PC1 和PC3的IP地址等参数(由于模拟器只支持HSRP配置,不支持具体功能,所以PC1网关配置为10.0.0.251,所以PC3网关配置为10.0.2.252,本应为standby IP)步骤六保存配置1、全网设备保存配置,防止掉电配置丢失。
HSRP实验详解及案例

热备份路由协议(HSRP)一、HSRP的相关概念HSRP(hot standby router protocol)是思科私有的一种协议,二、HSRP的配置1、配置为HSRP的成员switch(config-if)#standby group-number ip irtual-ip-addressgroup-number:默认组是0号,范围0~255irtual-ip-address:虚拟HSRP路由器的ip地址,即网段的网关地址。
例如:switch(config-if)#(no)standby 10 ip 192.168.1.2542、配置HSRP的优先级switch(config-if)#standby group-number priority priority-valuepriority-value:范围是0~255,默认值是100.例如:switch(config-if)#(no)standby 10 priority 2003、配置HSRP的占先权switch(config-if)#standby group-number preempt4、配置Hello消息的计时器switch(config-if)#standby group-number times hellotime holdtimehellotime:默认时间是3s,设置范围是1~255,holdtime:保持时间是hello时间的3倍,默认是10s。
例如:switch(config-if)#standby 10 times 2 85、配置HSRP的端口跟踪switch(config-if)#standby group-number track i nterface-type mod/num interface-priority interface-priority:当端口失效时,路由器的热备份优先级将降低的数值,默认为10.例如:switch(config-if)#standby 10 track fastEthernet 0/1 1006、查看HSRP状态switch#show standby [interface-type mod/num] [group-number] briefinterface-type mod/num:要显示的端口类型和序号。
Cisco HSRP 路由器的配置

Cisco HSRP 路由器的配置1、介绍本文档将详细说明如何配置Cisco HSRP(Hot Standby Router Protocol)路由器。
HSRP是一种用于提供冗余路由的协议,通过同时配置多个路由器来实现高可靠性和冗余性。
在本文档中,将介绍HSRP的概念、配置过程以及一些常见问题的解决方法。
2、HSRP概念及工作原理⑴ HSRP概念HSRP是一种用于提供冗余路由的协议,通过将多个路由器配置为一个虚拟路由器来实现冗余性。
在一个HSRP组中,有一个主路由器和一个或多个备用路由器。
主路由器负责转发数据流量,而备用路由器在主路由器失效时接管主路由器的功能。
⑵ HSRP工作原理每个HSRP组都有一个主要的虚拟IP地质,该地质与组中的主路由器相对应。
当主路由器失效时,备用路由器中的其中一个将成为新的主路由器,接管原先主路由器的功能,并使用相同的虚拟IP 地质。
主路由器和备用路由器通过互相发送心跳包来检测彼此的状态。
3、配置前的准备工作在开始配置HSRP之前,确保满足以下条件:⑴路由器上已运行适当的IOS版本,支持HSRP功能。
⑵彼此连接的路由器中至少有两台路由器。
⑶路由器之间配置了适当的接口,并具有可达性。
4、HSRP配置步骤以下是配置Cisco HSRP路由器的步骤:⑴创建HSRP组在每台路由器上创建HSRP组,使用相同的组号,并指定虚拟IP地质。
⑵配置接口在每台路由器的接口上配置HSRP,并将其指定为HSRP组的一部分。
⑶配置优先级为了指定主路由器,您可以配置每个路由器的HSRP优先级。
优先级越高,该路由器成为主路由器的可能性越大。
⑷配置其他参数根据需求,您还可以配置其他一些参数,如预共享密钥、追踪对象等。
5、常见问题及解决方法⑴ HSRP状态不稳定如果HSRP状态频繁切换或不稳定,可能是由于网络问题或路由器之间的通信问题引起的。
检查网络连接并确保良好的通信。
⑵主路由器失效后备用路由器无法接管如果主路由器失效后备用路由器无法接管其功能,可能是由于HSRP组配置错误或接口问题。
实验四:HSRP

实验四:HSRP一:实验目标(1)组网需求:企业总部局域网采用两台核心交换机,为防止二层环路,需全网运行STP:将SW1部署为根网桥,SW2部署为备份根网桥,并将接入PC的接口配置为portfast端口;同时部署HSRP为内部vlan提供网关冗余。
本局域网有4个vlan,生产业务vlan10,办公业务vlan11,服务器vlan12,二层交换机网管vlan8,将SW1部署为vlan8/10/12主网关,将sw2部署为vlan11的主网关,要求vlan10、11的主网关跟踪上行链路。
(2)测试HSRP主备网关倒换。
(3)分析pc1 ping pc2的三层通信过程和二层通信过程。
二:拓扑图三:预期结果当vlan10或vlan11的上行链路shutdown时,HSRP组的主备网关会倒换。
四:调试二层接口配置:SW3:show ip int bri:三层接口配置: SW1:show ip int bri:SW2:show ip int bri:STP配置:SW1:SW2:SW3:HSRP配置:SW1中:VLAN8:VLAN 10:VLAN 11:VLAN 12:SW2中:Vlan8:Vlan10:Vlan11:Vlan12:Sw1中vlan10的上行链路跟踪:Sw2中vlan11的上行链路跟踪:五:测试SW1中Show ip int bri:SW2中Show ip int bri:未将sw1的上行链路showdown时:Sw1中:Show standby bri:Sw2中:Show standby bri:将sw1上行链路接口fa0/12 shutdown后:Sw1中:Show standby bri:Sw2中:Show standby bri:重新将SW1中的fa0/12口打开:Pc1 ping pc2:六:总结与原理分析PC1 ping PC2的数据流分析:PC1—SW3—SW1—SW3—PC2PC2—SW3—SW1—SW2—SW1—SW3—PC1①Pc1封装icmp包,发现未知目的MAC地址且目的IP与自己不在同一个网段,则封装一个ARP请求,请求的目的IP为网关IP,目的MAC为全F;②在通过fa0/10口时,arp请求被打上了vlan10 的标签;③进入sw3,sw3查询mac地址表,发现没有pc1 的mac地址,便更新mac表;④由于配置了生成树协议,相对于vlan10,sw3的fa0/2口是阻塞的,所以arp请求被交换机从fa0/1口发送到三层交换机sw1;⑤Sw1收到arp请求后,发现目的ip是自身的,然后拆vlan10标,更新mac地址表,便封装一个arp应答,封装时打上vlan10的标,从fa0/3口单播出去;⑥Sw3收到arp应答,查询mac地址表后,从fa0/10转发出去,在出口拆掉vlan10的标签;⑦Pc1收到arp应答,更新自身的arp缓存表,重新封装icmp包,其目的mac是网关,目的IP是pc2的IP地址,将封装好的icmp包,通过fa0/10口送往SW3;⑧Icmp包在fa0/10口被打上vlan10的标签;⑨Icmp包进入sw3,sw3查询mac地址表,把icmp包从fa0/1口转发出去;⑩SW1收到icmp包,拆vlan10标,发现目的IP地址不是自己的,但是网关却是已知的vlan11,且不知道目的mac地址,便封装一个arp请求,并打上vlan11的标签,洪泛出去;⑪由于配置了生成树协议,所以SW3的Fa0/2口相对于vlan11是阻塞的,所以ARP请求从fa0/3口发送到SW3;⑫SW3收到了arp请求后将其洪泛,arp请求从fa0/11口出去,在通过fa0/11口时被拆掉vlan11的标签;⑬Pc2收到arp请求,更新自己的arp缓存表后,封装一个arp应答;⑭Arp应答从fa0/11口进入SW3时被打vlan11的标签;⑮SW3收到arp应答后,更新mac地址表,然后从fa0/1口转发给SW1;⑯SW1收到arp应答后,拆除arp应答的vlan11的标签,更新mac地址表,重新封装icmp包,将ICMP转发给SW3;⑰SW3收到ICMP包后,将ICMP包转发给PC2,在通过sw3的fa0/11口时,icmp包的vlan11标签被拆除;⑱Pc2收到icmp包后,发现目的IP地址,mac地址均为自己的后,封装一个icmp回应包,通过SW3的fa0/11口时被打上vlan11的标签,之后进入SW3;⑲Icmp回应包进入SW3后被SW3通过fa0/1口转发到SW1;⑳由于配置了HSRP,且SW1是vlan11的备份路由,所以SW1需通过查路由表,将icmp回应包转发给SW2;21SW2收到icmp回应包后,拆掉vlan11的标签,更新mac地址表和路由表,发现icmp包的目的IP是自己网段内的IP地址,重新封装一个icmp回应包,并打上vlan10的标签,SW2的端口Fa0/3连接的SW3的Fa0/2相对于vlan10是阻塞的,所以打了vlan10标签的数据流将被发送到SW1;22SW1收到icmp回应包后,更新自己的mac地址表和路由表,并查询mac地址表后,将其转发到SW3;23SW3收到icmp回应包后,查询mac地址表,将其通过fa0/10口转发,icmp 包在通过fa0/10口时,被拆除vlan10的标签;24Pc1收到icmp回应包。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
HSRP 的配置方法[no] standby [group-number] ip [virtual ip address] 说明:使路由器在指定局域网段加入或退出一个备份组。
需要指定备份组号和虚拟IP 地址。
备份组号范围从0 到255,如group-number 不指定,备份组号缺省为0,virtual ip address 如果不指定,路由器不会参与备份,直到从备份组中的活动路由器获得虚拟IP 地址。
注意虚拟IP 地址应该是接口所在网段的地址。
一旦退出HSRP 备份组,则路由器在该备份组上设置的所有HSRP 特性不再有效(如优先级,授权字等).standby [group-number] priority [priority-value] 说明:HSRP 中根据优先级来确定参与备份组的每台路由器的地位,备份组中优先级最大并且已获得虚拟IP 地址的路由器将成为活动路由器,优先级其次的路由器将成为备份路由器。
优先级缺省值是100,可设置范围从0 到255。
standby [group-number] preempt 说明:一旦备份组中的某台路由器成为活动路由器,只要它没有出现故障,其它路由器即使随后被配置更高的优先级,也不会成为活动路由,除非被设置抢占方式。
路由器如果设置抢占方式,它一旦发现自己的优先级比当前的活动路由器的优先级高,就会成为活动路由器。
相应地,原活动路由器会退出活动态,成为备份路由器或其它。
缺省方式是不抢占。
standby [group-number] authentication string 说明:HSRP 授权字确认同备份组间其它路由器的有效性。
授权字string 的长度不超过8 个字节。
注意:同一备份组要设置相同的授权字。
standby [group-number] timers [hello_time] [hold_time] 说明:HSRP 备份组路由器之间通过定时发送Hello 报文确认相互的状态,超过一定时间(hold time)没有收到某台路由器的Hello 报文,则认为它已关机或出现故障。
用户可以调整发送Hello 报文的间隔时间(hello time)和超时时间(hold time)。
缺省值分别是3 秒和10 秒。
时间单位是秒。
注意:同一备份组要设置相同的hello time 和hold time。
standby [group-number] track interface_name [priority-reduced] 说明:HSRP 监视接口功能,更好地扩充了备份功能,即不仅在路由器出现故障时提供备份功能,而且在某网络接口不可用时,也可以使用备份功能。
命令作用是监视接口interface_name,如果接口变为不可用,则将优先级减少priority-reduced (priority-reduced 缺省值为10)。
实现多组HSRP实验实验配置一、外网配置:配置R1:Router>enRouter#conf tRouter(config)#hostname R1R1(config)#int S0R1(config-if)#ip add 12.1.1.1 255.255.255.252R1(config-if)#no shutR1(config-if)#int E0R1(config-if)#ip add 192.168.10.100 255.255.255.0R1(config-if)#no shutR1(config-if)#exitR1(config)#ip route 0.0.0.0 0.0.0.0 S0R1#sh run配置R2:Router>enRouter#conf tRouter(config)#hostname R2R2(config)#int S0R2(config-if)#ip add 12.1.1.2 255.255.255.252 R2(config-if)#no shutR2(config-if)#clock rate 64000R2(config-if)#int S1R2(config-if)#ip add 23.1.1.2 255.255.255.248 R2(config-if)#no shutR2(config-if)#clock rate 64000R2(config-if)#endR2#sh run配置R3:Router>enRouter#conf tRouter(config)#hostname R3R3(config)#int S0R3(config-if)#ip add 23.1.1.3 255.255.255.248 R3(config-if)#no shutR3(config-if)#int E0R3(config-if)#ip add 192.168.20.200 255.255.255.0R3(config-if)#no shutR3(config-if)#exitR3(config)#ip route 0.0.0.0 0.0.0.0 S0R3#sh run二、配置NAT:R1#conf tR1(config)#access-list 10 permit 192.168.10.0 255.255.255.0R1(config)#ip nat inside source list 10 interface S0 overloadR1(config)#endR1#sh runR3#conf tR3(config)#access-list 20 permit 192.168.20.0 255.255.255.0R3(config)#ip nat inside source list 20 interface S0 overloadR3(config)#endR3#sh run三、配置HSRP多组负载均衡:R1#conf tR1(config)#int E0R1(config-if)#standby 1 ip add 192.168.10.254 //激活HSRP,设置R1连接的内网的虚拟网关R1(config-if)#standby 1 priority 120 //用于设定端口的HSRP优先级,具有最高备份优先级的HSRP 成员将成为激活路由器R1(config-if)#standby 1 preempt //表明当本地路由器的备份优先级超过当前激活路由器时,它就将接管控制权,成为激活路由器R1(config-if)#standby 1 track serial 0 40 //用于设置允许路由器端口根据另一端口的可用性而修改自己的HSRP优先级值(即监视端口状态)R1(config-if)#standby use-bia //启用HSRP多组均衡负载R1(config-if)#standby 2 ip add 192.168.20.254R1(config-if)#standby 2 premptR3#conf tR3(config)#int E0R3(config-if)#standby 2 ip add 192.168.20.254 //激活HSRP,设置R3连接的内网的虚拟网关R3(config-if)#standby 2 priority 120 //用于设定端口的HSRP优先级,具有最高备份优先级的HSRP 成员将成为激活路由器R3(config-if)#standby 2 preempt //表明当本地路由器的备份优先级超过当前激活路由器时,它就将接管控制权,成为激活路由器R3(config-if)#standby 2 track serial 0 40 //用于设置允许路由器端口根据另一端口的可用性而修改自己的HSRP优先级值R3(config-if)#standby use-bia //启用HSRP多组均衡负载R3(config-if)#standby 1 ip add 192.168.10.254R3(config-if)#standby 1 prempt配置PC机:PC1:设置本地连接的TCP/IP属性:ip:192.168.10.10 掩码:255.255.255.0 网关:192.168.10.254 PC2设置本地连接的TCP/IP属性:ip:192.168.20.20 掩码:255.255.255.0 网关:192.168.20.254分别在PC1和PC2上ping外网,在R1,R3上分别开启地址转换信息显示和HSRP信息显示,可以观察看你想看到的信息。
实验总结:1.在一个HSRP组内的多个路由器共用一个虚拟的物理地址和IP地址,该地址被作为局域网内所有主机的缺省网关地址。
HSRP协议决定哪个路由器被激活,该被激活的路由器接收发过来的数据包并进行路由。
2.相关命令:?standby ip: 用于激活HSRP。
?standby priority: 用于设定端口的HSRP优先级,具有最高备份优先级的HSTP成员将成为激活路由器(假设设置为优先权方式)。
? standby timers: 用于设定hello包之间的时间间隔(hello time)以及路由器在多长一个时间段内没有从HSRP邻居收到hello包就判定该邻居已关闭(hold time)。
? standby preempt: 表明当本地路由器的备份优先级超过当前激活路由器时,它就将接管控制权,成为激活路由器。
? standby track: 用于设置允许路由器端口根据另一端口的可用性而修改自己的HSRP优先级值3.配置HSRP步骤:①创建虚拟IP,用作内网网关②抢占线路优先级③提高组优先级④监视端口(监视的端口down掉后,自动下降所设的优先级值,默认自动下降10)4.一个路由器可以同时属于多个HSRP组,该特性允许网络管理员在提供冗余能力的同时对各路由器进行负载平衡。
在上图中,两台PC使用不同的缺省网关,主机1以HSRP组1的虚拟IP地址192.168.10.254为缺省网关,而主机2以组2的虚拟IP地址192.168.20.254为缺省网关。
在正常工作状态下,局域网的数据流量在两台路由器之间均分;一旦发生故障,备份路由器被激活,所有流量被路由至该路由器的端口。
上图中的两台路由器均同时属于两个HSRP组,路由器1是组1的激活路由器及组2的备份路由器,路由器3是组2的激活路由器及组1的备份路由器。