HSRP (Hot Standby Router Protocol)

Source: Internet
Author: User

First, Introduction

HSRP (hot Standby Router Protocol Thermal Backup Router protocol) is a proprietary protocol of Cisco. HSRP makes up a "hot backup group" of multiple routers, forming a virtual router. Only one router in this group is active (active), and it forwards the packets, and if the active router fails, the backup router becomes the active router. From the hosts in the network, the gateway has not changed.

Ii. working process of HSRP

The HSRP routers use Hello packets to listen to each other's existence. When the router does not receive a Hello packet for a long time, it considers the active router to be faulty and the backup router becomes the active router. The HSRP protocol leverages the precedence to determine which router becomes the active router. If a router has a higher priority than the other routers, the router becomes the active router. The default priority for routers is 100.

In a group, long has an active router and a backup router, and the HSRP router sends multicast (224.0.0.2) messages in three ways:

    • Hello: Notifies other router senders of HSRP priority and status information, and the HSRP router sends a hello message every 3 seconds by default.

    • Coup: Sends a COUP message when the standby router becomes an active router.

    • Resign: Proactively sends a RESIGN message when the active router is going down or when a higher-priority router sends hello.

Iii. 6 states of the HSRP router

    • When the INITIAL:HSRP is started, HSRP is not running, typically in the state when the configuration is changed or the port has just started.
    • Learn: In this state, the router has not decided on the virtual IP address, and does not see the authenticated, from the active router's Hello message, the router is still waiting for the active router to send a hello message.
    • Listen: The router has got a virtual IP address, but it is neither an active router nor a waiting router. It has been listening for Hello messages from the active router and waiting for the router.
    • Speak: In this state, the router periodically sends a HELLO message and actively participates in the active router or waits for the router to race. If the active route and wait route are selected, it becomes a listening state (Listen). At this point, only the active router and the waiting route are in speaking state.
    • Standby: The router in this state is the next active router, which sends hello messages on a regular basis.
    • Active: The active router assumes the task of forwarding packets that are sent to the virtual MAC address of the group. It periodically sends a hello message.

Iv. Two timers for HSRP

HSRP uses 2 timers: Hello interval and hold time. The default hello interval is 3 seconds, and the default hold interval is 10 seconds. The Hello interval defines how often information is exchanged between two sets of routers. The Hlod interval defines the length of time after which no information is received from other routers, and the active router or standby router is declared as failed. Configuring the timer is not as small as possible, although the smaller the timer, the shorter the switching time. The timer configuration needs to be consistent with the switching time of the STP and so on. In addition, the hold interval should be at least 3 times times the Hello interval.

V. Configuration templates

    •    r1 (config-if) #standby 1 IP 192.168.13.254 //enable HSRP feature, Create standby Group 1 and set the virtual gateway IP address
    •    r1 (config-if) #standby priority 120  //sets the precedence of HSRP, which is large and preempted to an active router, the default is
    •     R1 (config-if) #standby 1 preempt        //setting allows preemption to the active router at the highest priority of the router
    •    r1 (config-if) #standby 1 Timers 3 10         //set Hellotime to 3 seconds, holdtime to 10 seconds, default is the value
    •    R1 (config-if) #standby 1 authentication MD5 key-string cisco         //Configure authentication password
    •    r1 (config-if) #standby 1 track s0/0 30         //Configuring port tracing

Description

    • Routers of the same group number belong to the same HSRP group, and all routers that belong to the same HSRP group must have a consistent virtual IP address.
    • If you configure the "standby 1 preempt delay minimum 1000" command again, it will delay 1000 milliseconds for preemption.
    • Hellotime: How long does the router send hello information each interval; Holdtime: If the other routers in the same group do not receive information about the active router, the active router fails, and if you want to change the default values, all routers with the HSRP group must be consistent.
    • Configure the authentication password in order to prevent illegal devices from joining the HSRP group, and the password for the HSRP group must be the same.
    • Port tracking: If the s0/0 port trace is not configured in the experiment, R1 will not be routed to the network segment where R2 's Loopback0 interface is R1 if there is a problem with the s0/0 interface. However Ethernet between R1 and R3 is still not problematic, the Hello packet of HSRP is sent and received normally. So R1 is still the active router for the virtual Gateway 192.168.13.254, and the server's data will still be sent to R1, which will cause the server to not ping R2 loopback interface. After configuring the route trace, the port trace causes R1 to discover that the link on the s0/0 has a problem and takes its priority (we set the 120) minus a number (we set it to 30) and becomes 90. Because R3 has a default value of 100, the R3 becomes the active router, and the server's packets are sent to R3. The lower value should pick the appropriate value so that other routers can become active routers.

HSRP (Hot Standby Router Protocol)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.