{"id":34006,"date":"2019-10-31T21:55:54","date_gmt":"2019-10-31T18:55:54","guid":{"rendered":"https:\/\/prohoster.info\/blog\/printsip-raboty-protokola-vrrp\/"},"modified":"2019-10-31T21:55:54","modified_gmt":"2019-10-31T18:55:54","slug":"printsip-raboty-protokola-vrrp","status":"publish","type":"post","link":"https:\/\/prohoster.info\/pt\/blog\/administrirovanie\/printsip-raboty-protokola-vrrp","title":{"rendered":"Princ\u00edpio de funcionamento do protocolo VRRP","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><b>FHRP (First Hop Redundancy Protocol)<\/b> \u2014 um conjunto de protocolos projetados para criar redund\u00e2ncia no gateway padr\u00e3o. A ideia comum para esses protocolos \u00e9 unir v\u00e1rios roteadores em um \u00fanico roteador virtual com um endere\u00e7o IP compartilhado. Esse endere\u00e7o IP ser\u00e1 atribu\u00eddo aos hosts como o endere\u00e7o do gateway padr\u00e3o. A implementa\u00e7\u00e3o livre dessa ideia \u00e9 o protocolo VRRP (Virtual Router Redundancy Protocol). Neste artigo, vamos explorar os fundamentos do protocolo VRRP.<\/p>\n<p><img decoding=\"async\" alt=\"Princ\u00edpio de funcionamento do protocolo VRRP\" src=\"\/wp-content\/uploads\/2019\/05\/d9af3141a4b0573e206409ac6dbbd60f.jpg\" style=\"display:block;margin: 0 auto;\" \/><noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><br \/>\nOs roteadores VRRP se unem em um \u00fanico roteador virtual. Todos os roteadores no grupo t\u00eam um endere\u00e7o IP virtual (VIP) compartilhado e um n\u00famero de grupo ou VRID (Virtual Router Identifier) comum. Um roteador pode fazer parte de v\u00e1rios grupos, cada um dos quais deve ter um par VIP\/VRID exclusivo.<\/p>\n<p>No caso da Cisco, o roteador virtual \u00e9 definido na interface desejada com o comando:<\/p>\n<pre><code class=\"plaintext\">R1(config-if)# vrrp  ip<\/code><\/pre>\n<p>\nTodos os roteadores s\u00e3o classificados em dois tipos: VRRP Master e VRRP Backup. <\/p>\n<p><b>VRRP Master<\/b> \u2014 \u00e9 o roteador respons\u00e1vel por encaminhar pacotes para este grupo virtual. <\/p>\n<p><b>VRRP Backup<\/b> \u2014 \u00e9 o roteador que aguarda pacotes do Master. Se os pacotes do Master param de chegar, o Backup tenta assumir o estado de Master. <\/p>\n<p>Um roteador torna-se Master se tiver a maior prioridade. O Master retransmite constantemente mensagens para o endere\u00e7o de broadcast 224.0.0.18, informando aos roteadores Backup que est\u00e1 funcionando. O Master envia mensagens de acordo com o timer Adver Timer, que por padr\u00e3o \u00e9 de 1 segundo. <\/p>\n<p><img decoding=\"async\" alt=\"Princ\u00edpio de funcionamento do protocolo VRRP\" src=\"\/wp-content\/uploads\/2019\/05\/c7a60362445dd9d89fec7bdbd2ff513d.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\nNesse caso, o endere\u00e7o MAC do remetente usa o endere\u00e7o do grupo 00:00:5E:00:01:xx, onde xx \u00e9 o VRID em formato hexadecimal. Neste exemplo, o primeiro grupo est\u00e1 em uso. <\/p>\n<p><img decoding=\"async\" alt=\"Princ\u00edpio de funcionamento do protocolo VRRP\" src=\"\/wp-content\/uploads\/2019\/05\/5d16bcf86a6ce3c8ebe8c610dfe17156.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\nSe os roteadores Backup n\u00e3o receberem mensagens durante tr\u00eas Adver Timers (Master Down Timer), o novo Master se torna o roteador com a maior prioridade ou o roteador com o maior IP. Nesse caso, o roteador Backup com maior prioridade assumir o papel de Master com menor prioridade. No entanto, quando o Backup tem o modo preempt desativado, n\u00e3o assumir\u00e1 a fun\u00e7\u00e3o do Master. <\/p>\n<pre><code class=\"plaintext\">R1(config-if)# no vrrp  preempt<\/code><\/pre>\n<p>\nSe o roteador VRRP for o propriet\u00e1rio do endere\u00e7o VIP, ele sempre assume o papel de Master. <\/p>\n<p>A prioridade do VRRP \u00e9 definida em valores de 1 a 254. O valor 0 \u00e9 reservado para casos em que o Master precisa <i>desconectar<\/i> assume responsibility for routing. A value of 255 is set for the VIP owner router. The default priority is 100 but can be set administratively:<\/p>\n<pre><code class=\"plaintext\">R1(config-if)#vrrp  priority<\/code><\/pre>\n<p>\nHere we can see the router's priority when set administratively:<\/p>\n<p><img decoding=\"async\" alt=\"Princ\u00edpio de funcionamento do protocolo VRRP\" src=\"\/wp-content\/uploads\/2019\/05\/1b7d6de438b7d44ee9ae1d4a9e4fb8ca.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\nAnd here is a case where the router is the owner of the VIP:<\/p>\n<p><img decoding=\"async\" alt=\"Princ\u00edpio de funcionamento do protocolo VRRP\" src=\"\/wp-content\/uploads\/2019\/05\/c593d3fa9dde81fb694b3e3cb0358444.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\nA VRRP router can have three states: Initialize, Backup, Master. These states are changed sequentially by the router. <\/p>\n<p>In the Initialize state, the router waits to start working. If this router is the owner of the VIP address (priority is 255), it sends messages indicating that it is becoming Master. It also sends <noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/Address_Resolution_Protocol\">a gratuitous ARP request<\/a><\/noindex>, where the source MAC address equals the virtual router's address. It then goes to the Master state. If the router is not the owner of the VIP, it moves to the Backup state. <\/p>\n<p><img decoding=\"async\" alt=\"Princ\u00edpio de funcionamento do protocolo VRRP\" src=\"\/wp-content\/uploads\/2019\/05\/faa6941e52a9edcef72022b75333fc03.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\nIn the Backup state, the router waits for packets from the Master. The router in this state does not respond to ARP requests from the VIP address. It also does not accept packets that have the virtual router's MAC address as the destination address. <\/p>\n<p>If the Backup does not receive messages from the Master during the Master Down Timer, it sends a VRRP message indicating that it intends to become Master. It then sends a broadcast VRRP message, with the source MAC address equal to that of the virtual router. In this message, the router specifies its priority.<\/p>\n<p>In the Master state, the router processes packets addressed to the virtual router. It also responds to ARP requests for the VIP. The Master sends VRRP messages every Adver Timer to confirm that it is operational. <\/p>\n<pre><code class=\"plaintext\">*May 13 19:52:18.531: %VRRP-6-STATECHANGE: Et1\/0 Grp 1 state Init -&gt; Backup\n*May 13 19:52:21.751: %VRRP-6-STATECHANGE: Et1\/0 Grp 1 state Backup -&gt; Master<\/code><\/pre>\n<p>\nVRRP also allows load balancing between multiple routers. For this, two VRRP groups are created on one interface. One group is assigned a higher priority than the other. Meanwhile, the priority on the second router is set inversely. That is, if the priority of the first group on one router is 100, and the second group is 200, then on the other router the priority of the first group will be 200, and the second will be 100. <\/p>\n<p>Como mencionado anteriormente, cada grupo deve ter seu pr\u00f3prio VIP exclusivo. Como resultado, obtemos dois endere\u00e7os IP, atendidos por dois roteadores, cada um dos quais pode servir como gateway padr\u00e3o. <\/p>\n<p><img decoding=\"async\" alt=\"Princ\u00edpio de funcionamento do protocolo VRRP\" src=\"\/wp-content\/uploads\/2019\/05\/2f2246fd8e673a6fd64d4c74b0a79ce2.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\nMetade dos computadores recebe um endere\u00e7o de gateway padr\u00e3o, a outra metade outro. Assim, metade do tr\u00e1fego passar\u00e1 por um roteador e a outra metade por outro. Se um dos roteadores falhar, o segundo assume o funcionamento de ambos os VIPs.<\/p>\n<p><img decoding=\"async\" alt=\"Princ\u00edpio de funcionamento do protocolo VRRP\" src=\"\/wp-content\/uploads\/2019\/05\/31501226c0cb7a668ced43e38791f1c3.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\nAssim, o VRRP permite organizar a redund\u00e2ncia do gateway padr\u00e3o, aumentando a confiabilidade da rede. E ao usar v\u00e1rios roteadores virtuais, tamb\u00e9m \u00e9 poss\u00edvel balancear a carga entre os roteadores reais. O tempo de resposta a uma falha pode ser reduzido diminuindo os temporizadores.<br \/>\n<br \/>Fonte: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/452490\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>FHRP (First Hop Redundancy Protocol) \u2014 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0448\u043b\u044e\u0437\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041e\u0431\u0449\u0435\u0439 \u0438\u0434\u0435\u0435\u0439 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 \u043e\u0434\u0438\u043d \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440 \u0441 \u043e\u0431\u0449\u0438\u043c IP \u0430\u0434\u0440\u0435\u0441\u043e\u043c. \u042d\u0442\u043e\u0442 IP \u0430\u0434\u0440\u0435\u0441 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0445\u043e\u0441\u0442\u0430\u0445 \u043a\u0430\u043a \u0430\u0434\u0440\u0435\u0441 \u0448\u043b\u044e\u0437\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0421\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0434\u0430\u043d\u043d\u043e\u0439 \u0438\u0434\u0435\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b VRRP (Virtual Router Redundancy Protocol). [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":25663,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-34006","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.3 - aioseo.com -->\n\t<meta name=\"description\" content=\"FHRP (First Hop Redundancy Protocol) \u2014 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0448\u043b\u044e\u0437\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/pt\/blog\/administrirovanie\/printsip-raboty-protokola-vrrp\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.3\" \/>\n\t\t<meta property=\"og:locale\" content=\"pt_PT\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 VRRP | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"FHRP (First Hop Redundancy Protocol) \u2014 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0448\u043b\u044e\u0437\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/pt\/blog\/administrirovanie\/printsip-raboty-protokola-vrrp\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-10-31T18:55:54+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T18:55:54+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Princ\u00edpio de funcionamento do protocolo VRRP | ProHoster","description":"FHRP (First Hop Redundancy Protocol) \u2014 um conjunto de protocolos destinados a criar redund\u00e2ncia para o gateway padr\u00e3o.","canonical_url":"https:\/\/prohoster.info\/pt\/blog\/administrirovanie\/printsip-raboty-protokola-vrrp","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"pt_PT","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 VRRP | ProHoster","og:description":"FHRP (First Hop Redundancy Protocol) \u2014 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0448\u043b\u044e\u0437\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.","og:url":"https:\/\/prohoster.info\/pt\/blog\/administrirovanie\/printsip-raboty-protokola-vrrp","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-10-31T18:55:54+00:00","article:modified_time":"2019-10-31T18:55:54+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"34006","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-21 17:33:19","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-03-01 02:29:44","updated":"2026-01-21 17:33:19","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/posts\/34006","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/comments?post=34006"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/posts\/34006\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/media\/25663"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/media?parent=34006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/categories?post=34006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/tags?post=34006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}