{"id":938,"date":"2011-09-07T22:27:00","date_gmt":"2011-09-07T14:27:00","guid":{"rendered":"http:\/\/note.systw.net\/note\/?p=938"},"modified":"2023-11-07T22:29:51","modified_gmt":"2023-11-07T14:29:51","slug":"rfc2338-vrrp","status":"publish","type":"post","link":"https:\/\/systw.net\/note\/archives\/938","title":{"rendered":"RFC2338 VRRP"},"content":{"rendered":"\n<p>VRRP(Virtual Router Redundancy Protocol)<br>a standards-based,defined in IETF standard RFC 2338<br>VRRP is so similar to HSRP<\/p>\n\n\n\n<p><strong>VRRP group<\/strong><br>\u3000group numbers range=HSRP<br><strong>VRRP role<\/strong><br>\u3000master router:\u7b49\u540c\u65bcHSRP active router<br>\u3000backup state:\u7b49\u540c\u65bcHSRP all others<br><strong>VRRP priority<\/strong><br>\u3000default priority\u548cHSRP\u76f8\u7b49,\u90fd\u662f100<br>\u3000The one with the highest router priority VRRP group<br>\u3000priority=0,\u8868\u793a\u56fa\u5b9a\u70baBackup status<\/p>\n\n\n\n<p><strong>virtual router MAC address<\/strong><br>\u6982\u5ff5\u985e\u4f3cHSRP virtual MAC address,\u683c\u5f0f\u70ba0000.5e00.01xx,<br>ps:where xx is a two-digithex VRRP group number.<\/p>\n\n\n\n<p><strong>no tracking interfaces<\/strong><br>VRRP has no mechanism for tracking interfaces to allow more capable routers to take over<br>the master role.<br>ps:<br>\u53ef\u900f\u904e\u5efa\u7acbTrack\u7684Profile\u4f86\u9054\u6210<\/p>\n\n\n\n<p><strong>VRRP advertisements<\/strong><br>VRRP advertisements are sent at&nbsp;<strong>1-second<\/strong>&nbsp;intervals.<br>\u53ea\u6709Master Router\u6703\u9001advertisements<br>Backup routers optionally can learn the advertisement interval from the master router<br>ps:<br>VRRP sends its advertisements to the multicast destination address&nbsp;<strong>224.0.0.18<\/strong>&nbsp;, using IP protocol&nbsp;<strong>112<\/strong><\/p>\n\n\n\n<p><strong>VRRP Holdtime<\/strong><br>Down Interval = 3* Advertisement Timer + Skew time<br>ps:Skew Time = 256-priority\/256<\/p>\n\n\n\n<p><strong>Different between VRRP and HSRP<\/strong><br>hollotime:VRRP is 1-second, HSRP is 3-second<br>VirtualIP: VRRP support, HSRP don&#8217;t support<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<\/p>\n\n\n\n<p>Assign a VRRP router priority<br><strong>(config-if)#vrrp &lt; group&gt; priority<\/strong><br>Assign a virtual IP address.<br><strong>(config-if)#vrrp &lt; group&gt; ip &lt; ip-address&gt; [secondary]<\/strong><br>ex:<br>l3device_a\u7684\u8a2d\u5b9a\u5982\u4e0b<br>l3device_a(config)# interface vlan 50<br>l3device_a(config-if)# ip address 192.168.1.10 255.255.255.0<br>l3device_a(config-if)# vrrp 1 priority 200<br>l3device_a(config-if)# vrrp 1 ip 192.168.1.1<br>l3device_b\u7684\u8a2d\u5b9a\u5982\u4e0b<br>l3device_b(config)# interface vlan 50<br>l3device_b(config-if)# ip address 192.168.1.11 255.255.255.0<br>l3device_b(config-if)# vrrp 1 priority 100<br>l3device_b(config-if)# vrrp 1 ip 192.168.1.1<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;.<\/p>\n\n\n\n<p>\u5176\u4ed6\u8a2d\u5b9a<\/p>\n\n\n\n<p><strong>preempt<\/strong><br>By default, all VRRP routers are configured to preempt the current master router if their priorities are greater<\/p>\n\n\n\n<p>Disable preempting (default is to preempt).<br><strong>(config-if)#no vrrp &lt; group&gt; preempt<\/strong><br>Change the preempt delay (default 0 seconds).<br><strong>(config-if)# vrrp &lt; group&gt; preempt [delay &lt; seconds&gt;]<\/strong><\/p>\n\n\n\n<p>&#8230;<\/p>\n\n\n\n<p>Alter the advertisement timer<br><strong>(config-if)#vrrp &lt; group&gt; timers advertise [msec] &lt; interval&gt;<\/strong><br>Learn the advertisement interval from the master router.<br><strong>(config-if)#vrrp &lt; group&gt; timers learn<\/strong><\/p>\n\n\n\n<p>&#8230;<\/p>\n\n\n\n<p>Use authentication for advertisements.<br><strong>(config-if)#vrrp &lt; group&gt; authentication &lt; string&gt;<\/strong><br>\u8a8d\u8b49\u65b9\u6cd5\u6709\u4ee5\u4e0b\u5e7e\u7a2e<br>Plain-text<br>MD5 key-string<br>MD5 Key-chain<\/p>\n\n\n\n<p><br>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<\/p>\n\n\n\n<p><strong>VRRP loadbalance<\/strong><br>\u6982\u5ff5\u540cHSRP<br>ex:<br>\u5047\u8a2d\u67091\u500bswitch\u9023\u63a5l3device_a\u548cl3device_b,\u4e26\u8b93\u7db2\u8def\u53ef\u4ee5loadbalance\uff0c\u8a2d\u5b9aVRRP\u8a2d\u5b9a\u5982\u4e0bl3device_a\u7684\u8a2d\u5b9a\u5982\u4e0b<br>l3device_a(config)# interface vlan 50<br>l3device_a(config-if)# ip address 192.168.1.10 255.255.255.0<br>l3device_a(config-if)# vrrp 1 priority 200<br>l3device_a(config-if)# vrrp 1 ip 192.168.1.1<br>l3device_a(config-if)# vrrp 2 priority 100<br>l3device_a(config-if)# vrrp 2 ip 192.168.1.2<br>l3device_a(config-if)# no vrrp 2 preempt<br>l3device_b\u7684\u8a2d\u5b9a\u5982\u4e0b<br>l3device_b(config)# interface vlan 50<br>l3device_b(config-if)# ip address 192.168.1.11 255.255.255.0<br>l3device_b(config-if)# vrrp 1 priority 100<br>l3device_b(config-if)# vrrp 1 ip 192.168.1.1<br>l3device_b(config-if)# no vrrp 1 preempt<br>l3device_b(config-if)# vrrp 2 priority 200<br>l3device_b(config-if)# vrrp 2 ip 192.168.1.2<br>clients\u8a2d\u5b9a\u5982\u4e0b<br>\u5c07\u4e00\u90e8\u4efdpc\u7684gateway\u8a2d\u6210vrrp group1\u7684ip(192.168.1.1)<br>\u548c\u53e6\u4e00\u90e8\u4efdpc\u8a2d\u6210vrrp group2\u7684ip(192.168.1.2)<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<\/p>\n\n\n\n<p>display information about VRRP status<br><strong>#show vrrp [brief]<\/strong><br>ps<br>l3device_a# show vrrp brief \u70ba\u4f8b,\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Interface Grp Pri Time Own Pre State Master addr Group addr<br>Vlan50 1 200 3218 Y Master 192.168.1.10 192.168.1.1<br>Vlan50 2 100 3609 Backup 192.168.1.11 192.168.1.2<br>ps:<br>l3device_b# show vrrp brief \u70ba\u4f8b,\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Interface Grp Pri Time Own Pre State Master addr Group addr<br>Vlan50 1 100 3609 Backup 192.168.1.10 192.168.1.1<br>Vlan50 2 200 3218 Y Master 192.168.1.11 192.168.1.2<br>ps<br>l3device_a# show vrrp \u70ba\u4f8b,\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Vlan50 &#8211; Group 1<br>\u3000State is Master<br>\u3000<strong>Virtual IP address is 192.168.1.1<\/strong><br>\u3000Virtual MAC address is 0000.5e00.0101<br>\u3000Advertisement interval is 1.000 sec<br>\u3000Preemption is enabled<br>\u3000\u3000min delay is 0.000 sec<br><strong>\u3000Priority is 200<\/strong><br>\u3000Authentication is enabled<br><strong>\u3000Master Router is 192.168.1.10 (local), priority is 200<\/strong><br>\u3000Master Advertisement interval is 1.000 sec<br>\u3000Master Down interval is 3.218 sec<br>Vlan50 &#8211; Group 2<br>\u3000State is Backup<br>\u3000<strong>Virtual IP address is 192.168.1.2<\/strong><br>\u3000Virtual MAC address is 0000.5e00.0102<br>\u3000Advertisement interval is 1.000 sec<br><strong>\u3000Preemption is disabled<\/strong><br>\u3000Priority is 100<br>\u3000Authentication is enabled<br>\u3000<strong>Master Router is 192.168.1.11, priority is 200<\/strong><br>\u3000Master Advertisement interval is 1.000 sec<br>\u3000Master Down interval is 3.609 sec<br>(expires in 2.977 sec)<br>ps:<br>l3device_b# show vrrp \u70ba\u4f8b,\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Vlan50 &#8211; Group 1<br>\u3000State is Backup<br>\u3000Virtual IP address is 192.168.1.1<br>\u3000Virtual MAC address is 0000.5e00.0101<br>\u3000Advertisement interval is 1.000 sec<br>\u3000Preemption is disabled<br>\u3000Priority is 100<br>\u3000Authentication is enabled<br>\u3000Master Router is 192.168.1.10, priority is 200<br>\u3000Master Advertisement interval is 1.000 sec<br>\u3000Master Down interval is 3.609 sec<br>\u3000(expires in 2.833 sec)<br>Vlan50 &#8211; Group 2<br>\u3000State is Master<br>\u3000Virtual IP address is 192.168.1.2\u3000<br>\u3000Virtual MAC address is 0000.5e00.0102<br>\u3000Advertisement interval is 1.000 sec<br>\u3000Preemption is enabled<br>\u3000\u3000min delay is 0.000 sec<br>\u3000Priority is 200<br>\u3000Authentication is enabled<br>\u3000Master Router is 192.168.1.11 (local),priority is 200<br>\u3000Master Advertisement interval is 1.000 sec<br>\u3000Master Down interval is 3.218 sec<\/p>\n","protected":false},"excerpt":{"rendered":"<p>VRRP(Virtual Router Redundancy &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[33],"tags":[],"class_list":["post-938","post","type-post","status-publish","format-standard","hentry","category-cisco-layer3"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/938","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/comments?post=938"}],"version-history":[{"count":0,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/938\/revisions"}],"wp:attachment":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/media?parent=938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/categories?post=938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/tags?post=938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}