{"id":240,"date":"2024-07-18T04:49:49","date_gmt":"2024-07-18T04:49:49","guid":{"rendered":"https:\/\/www.zframez.com\/articles\/?p=240"},"modified":"2025-07-31T05:28:34","modified_gmt":"2025-07-31T05:28:34","slug":"bgp-protocol-peering-and-states","status":"publish","type":"post","link":"https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol-peering-and-states","title":{"rendered":"BGP Peering Process Explained \u2013 States from Idle to Established"},"content":{"rendered":"<body>\n<p class=\"wp-block-paragraph\"><strong>Understanding the BGP Peering Process<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When routers run BGP , they don\u2019t start exchanging route information right away. Before they can share anything, they need to <strong>form a stable connection<\/strong>, called a <strong>BGP peering session<\/strong>. This process involves multiple states, each indicating what\u2019s happening behind the scenes as the routers try to establish a session.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To make this easier to understand, it helps to compare with how OSPF forms its neighbor relationships \u2013 it also goes through defined states like Init, 2-Way, and Full. BGP has its own set of states that a router goes through as it tries to form a session with its neighbor.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Unlike OSPF, BGP doesn\u2019t use multicast or any hello mechanism to discover neighbors. Every BGP neighbor must be configured manually, and the whole communication happens over <strong>TCP (port 179)<\/strong>. So, let\u2019s go step by step and see what happens internally when we configure BGP.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"1024\" height=\"510\" src=\"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/bgp-states.png?resize=1024%2C510&#038;ssl=1\" alt=\"Diagram showing BGP peering process between two routers with labeled states (Idle, Connect, Active, OpenSent, OpenConfirm, Established) and packets exchanged (TCP SYN, OPEN, KEEPALIVE, UPDATE)\" class=\"wp-image-241\" loading=\"lazy\" srcset=\"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/bgp-states.png?resize=1024%2C510&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/bgp-states.png?resize=300%2C149&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/bgp-states.png?resize=768%2C382&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/bgp-states.png?resize=1536%2C764&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/bgp-states.png?w=1710&amp;ssl=1 1710w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption class=\"wp-element-caption\">BGP Peering States Diagram<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Initial State \u2013 Idle<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As soon as we configure the BGP process on a router and define a neighbor using the neighbor command, BGP goes into the <strong>Idle<\/strong> state.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the Idle state, BGP is basically doing all the background preparations:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It\u2019s checking the configuration,<\/li>\n\n\n\n<li>Setting up internal resources,<\/li>\n\n\n\n<li>And most importantly, it tries to initiate a TCP connection with the neighbor by sending a <strong>TCP SYN<\/strong> packet.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Once this TCP SYN is sent, BGP will move on to the <strong>Connect<\/strong> state.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Connect State \u2013 Waiting for TCP Handshake<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the <strong>Connect<\/strong> state, BGP is waiting for the <strong>TCP three-way handshake<\/strong> to complete.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the TCP handshake is successful (meaning the neighbor replied with SYN-ACK and we sent back ACK), then we have a TCP session ready between the two routers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is the basic transport layer connectivity that BGP needs. Once this is ready, BGP will immediately send an <strong>OPEN packet<\/strong> to the neighbor and transition to the <strong>OpenSent<\/strong> state.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<p class=\"wp-block-paragraph\">But what if the handshake fails?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Active State \u2013 Retry TCP Connection<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the TCP handshake fails (maybe because the neighbor is not configured yet or the peer IP is unreachable), BGP will move from Connect state to <strong>Active<\/strong> state.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Active state doesn\u2019t mean that everything is fine \u2014 in fact, it means BGP is trying again to re-establish the connection.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You\u2019ll usually see BGP stuck in Active state when:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Only one side is configured for BGP<\/li>\n\n\n\n<li>TCP port 179 is blocked<\/li>\n\n\n\n<li>There\u2019s a mismatch in the neighbor IP<\/li>\n\n\n\n<li>There\u2019s a routing issue<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">If BGP is able to retry and establish TCP successfully from here, it will go back to the Connect state and continue the process.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<p class=\"wp-block-paragraph\"><strong>OpenSent \u2013 Exchanging Open Messages<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the TCP handshake is done and BGP sends the <strong>OPEN packet<\/strong>, it will enter the <strong>OpenSent<\/strong> state.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this state:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>We have already sent our OPEN message<\/li>\n\n\n\n<li>We are waiting to receive the OPEN message from the neighbor<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The OPEN packet includes several important parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>BGP version (usually version 4)<\/li>\n\n\n\n<li>AS number<\/li>\n\n\n\n<li>BGP Router ID<\/li>\n\n\n\n<li>Hold time<\/li>\n\n\n\n<li>Optional parameters (like authentication\/password, if configured)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Once we receive the OPEN message from the neighbor, we will compare all the fields. If there\u2019s a mismatch (say, different AS number), the connection will be reset. If everything is fine, BGP will respond and move to the <strong>OpenConfirm<\/strong> state.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<p class=\"wp-block-paragraph\"><strong>OpenConfirm \u2013 Waiting for Keepalive<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the <strong>OpenConfirm<\/strong> state:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Both routers have exchanged their OPEN messages<\/li>\n\n\n\n<li>Now they are just waiting for a <strong>KEEPALIVE message<\/strong> from each other to confirm that everything is good<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This is a short and simple state. If we receive a valid KEEPALIVE message from the neighbor, it means the neighbor has accepted our OPEN message, and the peering is now fully established.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">At this point, BGP will move to the final state \u2013 <strong>Established<\/strong>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Established \u2013 Peering Complete<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the <strong>Established<\/strong> state, BGP peering is up.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is the state where:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>BGP will start sending <strong>UPDATE messages<\/strong>, which include route advertisements (NLRI)<\/li>\n\n\n\n<li>BGP will also receive updates from the neighbor<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">From now on, KEEPALIVE messages will be sent periodically to maintain the session, and any change in routes will be communicated through UPDATE packets.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But one thing to note \u2013 BGP <strong>does not<\/strong> have a separate state to indicate that route exchange is complete (unlike OSPF, which uses Full state). So once you\u2019re in the Established state, BGP might still be in the middle of exchanging routes \u2014 there\u2019s no way to know just from the state itself.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Quick Summary of All BGP States<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><td><strong>State<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><\/thead><tbody><tr><td><strong>Idle<\/strong><\/td><td>Initial state. Prepares resources and sends TCP SYN.<\/td><\/tr><tr><td><strong>Connect<\/strong><\/td><td>Waiting for TCP handshake to complete.<\/td><\/tr><tr><td><strong>Active<\/strong><\/td><td>TCP failed. Retrying connection.<\/td><\/tr><tr><td><strong>OpenSent<\/strong><\/td><td>Sent OPEN packet, waiting for neighbor\u2019s OPEN.<\/td><\/tr><tr><td><strong>OpenConfirm<\/strong><\/td><td>Exchanged OPENs, waiting for KEEPALIVE.<\/td><\/tr><tr><td><strong>Established<\/strong><\/td><td>Peering is up. Routes are exchanged.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What Happens If Something Goes Wrong?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If TCP fails: BGP stays in <strong>Active<\/strong><\/li>\n\n\n\n<li>If OPEN message parameters mismatch: BGP resets the session, goes back to <strong>Idle<\/strong><\/li>\n\n\n\n<li>If KEEPALIVE not received within Hold time: session is dropped<\/li>\n\n\n\n<li>If password (MD5) mismatch: session never reaches OpenConfirm<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">So, every stage has checks. If something fails, BGP will drop the session and restart from Idle.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<p class=\"wp-block-paragraph\"><strong>A Note on Troubleshooting<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If BGP is stuck in Idle or Active, it usually means:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The neighbor is not reachable (routing or interface issue)<\/li>\n\n\n\n<li>The neighbor is not configured with a matching BGP session<\/li>\n\n\n\n<li>TCP port 179 is blocked (ACLs or firewalls)<\/li>\n\n\n\n<li>Authentication mismatch (password not matching)<\/li>\n\n\n\n<li>AS number mismatch in the neighbor configuration<\/li>\n<\/ul>\n<\/body>","protected":false},"excerpt":{"rendered":"<p>Understanding the BGP Peering Process When routers run BGP , they don\u2019t start exchanging route information right away. Before they can share anything, they need to form a stable connection, called a BGP peering session. This process involves multiple states, each indicating what\u2019s happening behind the scenes as the routers try to establish a session. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"wp-custom-template-post-with-sidebar2","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[103,66],"tags":[130,134,135,124,127,126,125,129,133,128,132,131],"class_list":["post-240","post","type-post","status-publish","format-standard","hentry","category-bgp","category-routing","tag-active-state","tag-bgp-neighborship-states","tag-bgp-neighbourship-state-machine","tag-bgp-peering","tag-bgp-peering-process","tag-bgp-protocol-states","tag-bgp-states","tag-connect-state","tag-established-state","tag-idle-state","tag-open-confirm-state","tag-open-sent-state"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>BGP Peering Process Explained \u2013 States from Idle to Established - Tutorials<\/title>\n<meta name=\"description\" content=\"Learn how BGP establishes peering between routers, including all internal states like Idle, Connect, Active, OpenSent, OpenConfirm, and Established. Step-by-step explanation with practical insights and troubleshooting tips.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol-peering-and-states\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Understanding the BGP Peering Process \u2013 Step-by-Step\" \/>\n<meta property=\"og:description\" content=\"A clear and structured explanation of how BGP forms peering sessions. Covers all peering states, what happens in each, and common reasons for failures. Ideal for networking professionals and learners.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol-peering-and-states\" \/>\n<meta property=\"og:site_name\" content=\"Tutorials\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/zframez\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-18T04:49:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T05:28:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/bgp-states.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1710\" \/>\n\t<meta property=\"og:image:height\" content=\"851\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"sajith achipra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@zframez\" \/>\n<meta name=\"twitter:site\" content=\"@zframez\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"sajith achipra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/routing\\\/bgp-protocol-peering-and-states#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/routing\\\/bgp-protocol-peering-and-states\"},\"author\":{\"name\":\"sajith achipra\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#\\\/schema\\\/person\\\/8b3b88007644501771d2452d3cc80f41\"},\"headline\":\"BGP Peering Process Explained \u2013 States from Idle to Established\",\"datePublished\":\"2024-07-18T04:49:49+00:00\",\"dateModified\":\"2025-07-31T05:28:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/routing\\\/bgp-protocol-peering-and-states\"},\"wordCount\":909,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/routing\\\/bgp-protocol-peering-and-states#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/bgp-states-1024x510.png\",\"keywords\":[\"active state\",\"bgp neighborship states\",\"bgp neighbourship state machine\",\"bgp peering\",\"bgp peering process\",\"bgp protocol states\",\"bgp states\",\"connect state\",\"established state\",\"idle state\",\"open confirm state\",\"open sent state\"],\"articleSection\":[\"bgp\",\"routing\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.zframez.com\\\/articles\\\/routing\\\/bgp-protocol-peering-and-states#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/routing\\\/bgp-protocol-peering-and-states\",\"url\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/routing\\\/bgp-protocol-peering-and-states\",\"name\":\"BGP Peering Process Explained \u2013 States from Idle to Established - Tutorials\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/routing\\\/bgp-protocol-peering-and-states#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/routing\\\/bgp-protocol-peering-and-states#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/bgp-states-1024x510.png\",\"datePublished\":\"2024-07-18T04:49:49+00:00\",\"dateModified\":\"2025-07-31T05:28:34+00:00\",\"description\":\"Learn how BGP establishes peering between routers, including all internal states like Idle, Connect, Active, OpenSent, OpenConfirm, and Established. Step-by-step explanation with practical insights and troubleshooting tips.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/routing\\\/bgp-protocol-peering-and-states#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.zframez.com\\\/articles\\\/routing\\\/bgp-protocol-peering-and-states\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/routing\\\/bgp-protocol-peering-and-states#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.zframez.com\\\/articles\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/bgp-states.png?fit=1710%2C851&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/www.zframez.com\\\/articles\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/bgp-states.png?fit=1710%2C851&ssl=1\",\"width\":1710,\"height\":851},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/routing\\\/bgp-protocol-peering-and-states#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Tutorials\",\"item\":\"https:\\\/\\\/www.zframez.com\\\/articles\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"BGP Peering Process Explained \u2013 States from Idle to Established\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#website\",\"url\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/\",\"name\":\"zframez tutorials\",\"description\":\"Learn networking bit by bit\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#organization\",\"name\":\"zframez technologies\",\"url\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.zframez.com\\\/articles\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/zframez-logo.jpg?fit=864%2C864&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/www.zframez.com\\\/articles\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/zframez-logo.jpg?fit=864%2C864&ssl=1\",\"width\":864,\"height\":864,\"caption\":\"zframez technologies\"},\"image\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/zframez\\\/\",\"https:\\\/\\\/x.com\\\/zframez\",\"https:\\\/\\\/www.instagram.com\\\/zframez_technologies\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#\\\/schema\\\/person\\\/8b3b88007644501771d2452d3cc80f41\",\"name\":\"sajith achipra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3d9f27c5311500982b6f19d03d0506f1c328f30f51d8d5f73f46577687fd81f8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3d9f27c5311500982b6f19d03d0506f1c328f30f51d8d5f73f46577687fd81f8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3d9f27c5311500982b6f19d03d0506f1c328f30f51d8d5f73f46577687fd81f8?s=96&d=mm&r=g\",\"caption\":\"sajith achipra\"},\"sameAs\":[\"http:\\\/\\\/www.zframez.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"BGP Peering Process Explained \u2013 States from Idle to Established - Tutorials","description":"Learn how BGP establishes peering between routers, including all internal states like Idle, Connect, Active, OpenSent, OpenConfirm, and Established. Step-by-step explanation with practical insights and troubleshooting tips.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol-peering-and-states","og_locale":"en_US","og_type":"article","og_title":"Understanding the BGP Peering Process \u2013 Step-by-Step","og_description":"A clear and structured explanation of how BGP forms peering sessions. Covers all peering states, what happens in each, and common reasons for failures. Ideal for networking professionals and learners.","og_url":"https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol-peering-and-states","og_site_name":"Tutorials","article_publisher":"https:\/\/www.facebook.com\/zframez\/","article_published_time":"2024-07-18T04:49:49+00:00","article_modified_time":"2025-07-31T05:28:34+00:00","og_image":[{"width":1710,"height":851,"url":"https:\/\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/bgp-states.png","type":"image\/png"}],"author":"sajith achipra","twitter_card":"summary_large_image","twitter_creator":"@zframez","twitter_site":"@zframez","twitter_misc":{"Written by":"sajith achipra","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol-peering-and-states#article","isPartOf":{"@id":"https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol-peering-and-states"},"author":{"name":"sajith achipra","@id":"https:\/\/www.zframez.com\/articles\/#\/schema\/person\/8b3b88007644501771d2452d3cc80f41"},"headline":"BGP Peering Process Explained \u2013 States from Idle to Established","datePublished":"2024-07-18T04:49:49+00:00","dateModified":"2025-07-31T05:28:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol-peering-and-states"},"wordCount":909,"commentCount":0,"publisher":{"@id":"https:\/\/www.zframez.com\/articles\/#organization"},"image":{"@id":"https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol-peering-and-states#primaryimage"},"thumbnailUrl":"https:\/\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/bgp-states-1024x510.png","keywords":["active state","bgp neighborship states","bgp neighbourship state machine","bgp peering","bgp peering process","bgp protocol states","bgp states","connect state","established state","idle state","open confirm state","open sent state"],"articleSection":["bgp","routing"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol-peering-and-states#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol-peering-and-states","url":"https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol-peering-and-states","name":"BGP Peering Process Explained \u2013 States from Idle to Established - Tutorials","isPartOf":{"@id":"https:\/\/www.zframez.com\/articles\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol-peering-and-states#primaryimage"},"image":{"@id":"https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol-peering-and-states#primaryimage"},"thumbnailUrl":"https:\/\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/bgp-states-1024x510.png","datePublished":"2024-07-18T04:49:49+00:00","dateModified":"2025-07-31T05:28:34+00:00","description":"Learn how BGP establishes peering between routers, including all internal states like Idle, Connect, Active, OpenSent, OpenConfirm, and Established. Step-by-step explanation with practical insights and troubleshooting tips.","breadcrumb":{"@id":"https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol-peering-and-states#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol-peering-and-states"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol-peering-and-states#primaryimage","url":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/bgp-states.png?fit=1710%2C851&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/bgp-states.png?fit=1710%2C851&ssl=1","width":1710,"height":851},{"@type":"BreadcrumbList","@id":"https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol-peering-and-states#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Tutorials","item":"https:\/\/www.zframez.com\/articles"},{"@type":"ListItem","position":2,"name":"BGP Peering Process Explained \u2013 States from Idle to Established"}]},{"@type":"WebSite","@id":"https:\/\/www.zframez.com\/articles\/#website","url":"https:\/\/www.zframez.com\/articles\/","name":"zframez tutorials","description":"Learn networking bit by bit","publisher":{"@id":"https:\/\/www.zframez.com\/articles\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.zframez.com\/articles\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.zframez.com\/articles\/#organization","name":"zframez technologies","url":"https:\/\/www.zframez.com\/articles\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.zframez.com\/articles\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/zframez-logo.jpg?fit=864%2C864&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/zframez-logo.jpg?fit=864%2C864&ssl=1","width":864,"height":864,"caption":"zframez technologies"},"image":{"@id":"https:\/\/www.zframez.com\/articles\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/zframez\/","https:\/\/x.com\/zframez","https:\/\/www.instagram.com\/zframez_technologies\/"]},{"@type":"Person","@id":"https:\/\/www.zframez.com\/articles\/#\/schema\/person\/8b3b88007644501771d2452d3cc80f41","name":"sajith achipra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3d9f27c5311500982b6f19d03d0506f1c328f30f51d8d5f73f46577687fd81f8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3d9f27c5311500982b6f19d03d0506f1c328f30f51d8d5f73f46577687fd81f8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3d9f27c5311500982b6f19d03d0506f1c328f30f51d8d5f73f46577687fd81f8?s=96&d=mm&r=g","caption":"sajith achipra"},"sameAs":["http:\/\/www.zframez.com"]}]}},"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":247,"url":"https:\/\/www.zframez.com\/articles\/routing\/bgp-configuration-examples","url_meta":{"origin":240,"position":0},"title":"BGP Configuration Example 1: EBGP Peering","author":"sajith achipra","date":"July 18, 2024","format":false,"excerpt":"BGP Configuration Example: In the previous chapter, you learned about BGP's peering process and states. In this BGP configuration example , you will learn how to configure BGP with two Cisco routers, check the BGP peering status, and understand different BGP show commands. We\u2019ll provide step-by-step instructions to set up\u2026","rel":"","context":"In &quot;bgp&quot;","block_context":{"text":"bgp","link":"https:\/\/www.zframez.com\/articles\/category\/routing\/bgp"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/show-ip-bgp.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/show-ip-bgp.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/show-ip-bgp.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/show-ip-bgp.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":232,"url":"https:\/\/www.zframez.com\/articles\/routing\/how-bgp-works","url_meta":{"origin":240,"position":1},"title":"How BGP Works ?","author":"sajith achipra","date":"July 17, 2024","format":false,"excerpt":"How BGP Works \u2013 Step-by-Step Flow, Packet Types, and NLRI Continuing from our introduction to BGP, let\u2019s now look at how BGP actually works - how two routers become neighbors, what packets are exchanged between them, and how route information is shared Peering in BGP \u2013 No Auto Discovery Here\u2026","rel":"","context":"In &quot;bgp&quot;","block_context":{"text":"bgp","link":"https:\/\/www.zframez.com\/articles\/category\/routing\/bgp"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":262,"url":"https:\/\/www.zframez.com\/articles\/routing\/bgp-configuration-example-ebgp-loopback","url_meta":{"origin":240,"position":2},"title":"BGP Configuration Example 2: EBGP Using Loopback Interfaces","author":"sajith achipra","date":"July 18, 2024","format":false,"excerpt":"BGP Configuration Example In the last tutorial \u201cBGP configuration example : EBGP Peering\u201c, we configured an EBGP peering between two routers using their physical interface IP addresses. In this BGP configuration example, we\u2019ll use loopback interfaces for BGP peering. We prefer loopback interfaces when there are multiple paths between peers\u2026","rel":"","context":"In &quot;bgp&quot;","block_context":{"text":"bgp","link":"https:\/\/www.zframez.com\/articles\/category\/routing\/bgp"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/ebgp-configuration-topology.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/ebgp-configuration-topology.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/ebgp-configuration-topology.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/ebgp-configuration-topology.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/ebgp-configuration-topology.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/ebgp-configuration-topology.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":219,"url":"https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol","url_meta":{"origin":240,"position":3},"title":"Introduction to BGP Protocol","author":"sajith achipra","date":"July 17, 2024","format":false,"excerpt":"Introduction to BGP \u2013 The Backbone of Internet Routing In this tutorial, we\u2019ll go over the basics of BGP (Border Gateway Protocol) and what makes it different from other routing protocols. If you're just getting started with routing or trying to understand how large networks communicate over the internet, this\u2026","rel":"","context":"In &quot;bgp&quot;","block_context":{"text":"bgp","link":"https:\/\/www.zframez.com\/articles\/category\/routing\/bgp"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/BGP-packet.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/BGP-packet.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/BGP-packet.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/BGP-packet.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/BGP-packet.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/BGP-packet.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":1273,"url":"https:\/\/www.zframez.com\/articles\/routing\/understanding-bgp-next_hop-and-origin-path-attributes","url_meta":{"origin":240,"position":4},"title":"Understanding BGP NEXT_HOP and ORIGIN Path Attributes","author":"sajith achipra","date":"August 6, 2025","format":false,"excerpt":"Understanding the NEXT_HOP Attribute in BGP In BGP, every route that gets advertised comes with some additional information known as path attributes. One of the most important and commonly seen among them is the NEXT_HOP attribute. This attribute simply tells the router: \u201cIf you want to reach this network, send\u2026","rel":"","context":"In &quot;bgp&quot;","block_context":{"text":"bgp","link":"https:\/\/www.zframez.com\/articles\/category\/routing\/bgp"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/08\/ebgp-peers-with-NOH-attribute.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/08\/ebgp-peers-with-NOH-attribute.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/08\/ebgp-peers-with-NOH-attribute.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/08\/ebgp-peers-with-NOH-attribute.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/08\/ebgp-peers-with-NOH-attribute.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/08\/ebgp-peers-with-NOH-attribute.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":1270,"url":"https:\/\/www.zframez.com\/articles\/routing\/understanding-bgp-as_path-split-horizon-and-route-reflectors","url_meta":{"origin":240,"position":5},"title":"Understanding BGP AS_PATH, Split Horizon, and Route Reflectors","author":"sajith achipra","date":"August 5, 2025","format":false,"excerpt":"BGP Path Attributes \u2013 AS_PATH, Split Horizon, and Route Reflector One of the key features that makes BGP different from other routing protocols is its use of path attributes. These attributes are attached to BGP route advertisements and provide important information that routers use to make decisions - not just\u2026","rel":"","context":"In &quot;bgp&quot;","block_context":{"text":"bgp","link":"https:\/\/www.zframez.com\/articles\/category\/routing\/bgp"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/08\/BGP-AS-Path-demo.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/08\/BGP-AS-Path-demo.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/08\/BGP-AS-Path-demo.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/08\/BGP-AS-Path-demo.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/08\/BGP-AS-Path-demo.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/08\/BGP-AS-Path-demo.png?resize=1400%2C800&ssl=1 4x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/posts\/240","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/comments?post=240"}],"version-history":[{"count":4,"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/posts\/240\/revisions"}],"predecessor-version":[{"id":1252,"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/posts\/240\/revisions\/1252"}],"wp:attachment":[{"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/media?parent=240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/categories?post=240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/tags?post=240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}