{"id":17,"date":"2026-04-14T21:35:04","date_gmt":"2026-04-14T21:35:04","guid":{"rendered":"https:\/\/inhochoi.com\/index.php\/2026\/04\/14\/bgp-basics-cisco-fortigate\/"},"modified":"2026-04-14T21:35:04","modified_gmt":"2026-04-14T21:35:04","slug":"bgp-basics-cisco-fortigate","status":"publish","type":"post","link":"https:\/\/inhochoi.com\/index.php\/2026\/04\/14\/bgp-basics-cisco-fortigate\/","title":{"rendered":"BGP Basics \u2014 Configuration on Cisco IOS and FortiGate"},"content":{"rendered":"<div style=\"height:24px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<p style=\"font-size:clamp(0.875rem, 0.875rem + ((1vw - 0.2rem) * 0.431), 1.15rem);line-height:1.9\">Border Gateway Protocol (BGP) is the routing protocol that holds the internet together. It is the standard exterior gateway protocol used to exchange routing information between autonomous systems (AS). Whether you are managing enterprise WAN links, configuring SD-WAN underlay routing, or peering with an ISP, understanding BGP fundamentals is essential. In this post, we will cover the core concepts and then walk through basic configuration on both <strong>Cisco IOS<\/strong> and <strong>FortiGate (FortiOS)<\/strong>.<\/p>\n<div style=\"height:24px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h2 class=\"wp-block-heading\">What Is BGP?<\/h2>\n<p style=\"line-height:1.85\">BGP is a <strong>path-vector<\/strong> routing protocol that operates over TCP port 179. Unlike interior gateway protocols (IGPs) such as OSPF or EIGRP, BGP is designed to route between autonomous systems \u2014 each identified by a unique AS number (ASN). There are two flavours:<\/p>\n<ul>\n<li><strong>eBGP (External BGP)<\/strong> \u2014 peering between different autonomous systems. The default TTL is 1 (directly connected neighbours).<\/li>\n<li><strong>iBGP (Internal BGP)<\/strong> \u2014 peering within the same autonomous system. Requires a full mesh or route reflectors to avoid routing loops.<\/li>\n<\/ul>\n<div style=\"height:16px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h2 class=\"wp-block-heading\">Key BGP Concepts<\/h2>\n<h3 class=\"wp-block-heading\">BGP Neighbour States<\/h3>\n<p style=\"line-height:1.85\">A BGP session progresses through several states before routes are exchanged:<\/p>\n<ol>\n<li><strong>Idle<\/strong> \u2014 BGP is waiting to start a TCP connection.<\/li>\n<li><strong>Connect<\/strong> \u2014 TCP three-way handshake is in progress.<\/li>\n<li><strong>OpenSent<\/strong> \u2014 An OPEN message has been sent to the peer.<\/li>\n<li><strong>OpenConfirm<\/strong> \u2014 An OPEN message has been received and acknowledged.<\/li>\n<li><strong>Established<\/strong> \u2014 The session is up and routes are being exchanged.<\/li>\n<\/ol>\n<h3 class=\"wp-block-heading\">BGP Path Attributes<\/h3>\n<p style=\"line-height:1.85\">BGP uses path attributes to determine the best route. The default decision process (simplified):<\/p>\n<ol>\n<li><strong>Weight<\/strong> (Cisco-proprietary, local to the router \u2014 higher is preferred)<\/li>\n<li><strong>Local Preference<\/strong> (shared within the AS \u2014 higher is preferred)<\/li>\n<li><strong>Locally Originated<\/strong> (prefer routes originated by this router)<\/li>\n<li><strong>AS Path Length<\/strong> (shorter path is preferred)<\/li>\n<li><strong>Origin Type<\/strong> (IGP &lt; EGP &lt; Incomplete)<\/li>\n<li><strong>MED (Multi-Exit Discriminator)<\/strong> (lower is preferred, compared across same neighbour AS)<\/li>\n<li><strong>eBGP over iBGP<\/strong><\/li>\n<li><strong>Lowest IGP metric to next hop<\/strong><\/li>\n<li><strong>Lowest Router ID<\/strong><\/li>\n<\/ol>\n<div style=\"height:24px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h2 class=\"wp-block-heading\">BGP Message Types<\/h2>\n<p style=\"line-height:1.85\">BGP uses four message types to manage sessions and exchange routing information:<\/p>\n<ul>\n<li><strong>OPEN<\/strong> \u2014 Initiates a BGP session and negotiates parameters (ASN, hold time, router ID).<\/li>\n<li><strong>UPDATE<\/strong> \u2014 Advertises new routes or withdraws previously announced routes.<\/li>\n<li><strong>KEEPALIVE<\/strong> \u2014 Maintains the session (sent every 60 seconds by default, hold time 180 seconds).<\/li>\n<li><strong>NOTIFICATION<\/strong> \u2014 Signals an error condition and tears down the session.<\/li>\n<\/ul>\n<div style=\"height:32px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h2 class=\"wp-block-heading\">Cisco IOS \u2014 Basic BGP Configuration<\/h2>\n<p style=\"line-height:1.85\">Below is a basic eBGP configuration on a Cisco router. In this example, our router is in <strong>AS 65001<\/strong> and peers with a neighbour in <strong>AS 65002<\/strong> at IP <code>10.0.0.2<\/code>.<\/p>\n<pre class=\"wp-block-code\"><code>! Enter BGP configuration\nrouter bgp 65001\n\n ! Set a router ID (best practice)\n bgp router-id 1.1.1.1\n\n ! Disable auto-summary (default in modern IOS, but good habit)\n no auto-summary\n\n ! Define the eBGP neighbour\n neighbor 10.0.0.2 remote-as 65002\n\n ! Optional: set a description\n neighbor 10.0.0.2 description eBGP-to-ISP\n\n ! Advertise networks into BGP\n network 192.168.1.0 mask 255.255.255.0\n network 172.16.0.0 mask 255.255.0.0\n\n ! Optional: set a password for MD5 authentication\n neighbor 10.0.0.2 password SecureBGP123<\/code><\/pre>\n<h3 class=\"wp-block-heading\">Cisco \u2014 iBGP Example<\/h3>\n<p style=\"line-height:1.85\">For iBGP, the remote AS matches your own. You typically peer via loopback interfaces:<\/p>\n<pre class=\"wp-block-code\"><code>router bgp 65001\n neighbor 2.2.2.2 remote-as 65001\n neighbor 2.2.2.2 update-source Loopback0\n neighbor 2.2.2.2 next-hop-self<\/code><\/pre>\n<h3 class=\"wp-block-heading\">Cisco \u2014 Useful Verification Commands<\/h3>\n<pre class=\"wp-block-code\"><code>! Check BGP neighbour status\nshow ip bgp summary\n\n! View the full BGP table\nshow ip bgp\n\n! Check details for a specific neighbour\nshow ip bgp neighbors 10.0.0.2\n\n! View advertised routes to a neighbour\nshow ip bgp neighbors 10.0.0.2 advertised-routes\n\n! View routes received from a neighbour\nshow ip bgp neighbors 10.0.0.2 received-routes<\/code><\/pre>\n<div style=\"height:32px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h2 class=\"wp-block-heading\">FortiGate (FortiOS) \u2014 Basic BGP Configuration<\/h2>\n<p style=\"line-height:1.85\">FortiGate supports BGP through its CLI. Below is the equivalent eBGP setup \u2014 our FortiGate is in <strong>AS 65001<\/strong>, peering with <strong>AS 65002<\/strong> at <code>10.0.0.2<\/code>.<\/p>\n<pre class=\"wp-block-code\"><code># Enter the BGP router configuration\nconfig router bgp\n    set as 65001\n    set router-id 1.1.1.1\n\n    # Define the eBGP neighbour\n    config neighbor\n        edit \"10.0.0.2\"\n            set remote-as 65002\n            set description \"eBGP-to-ISP\"\n\n            # Optional: MD5 authentication\n            set password SecureBGP123\n\n            # Enable the neighbour (enabled by default)\n            set shutdown disable\n        next\n    end\n\n    # Advertise networks into BGP\n    config network\n        edit 1\n            set prefix 192.168.1.0 255.255.255.0\n        next\n        edit 2\n            set prefix 172.16.0.0 255.255.0.0\n        next\n    end\nend<\/code><\/pre>\n<h3 class=\"wp-block-heading\">FortiGate \u2014 iBGP Example<\/h3>\n<pre class=\"wp-block-code\"><code>config router bgp\n    set as 65001\n    config neighbor\n        edit \"2.2.2.2\"\n            set remote-as 65001\n            set update-source \"loopback0\"\n            set next-hop-self enable\n        next\n    end\nend<\/code><\/pre>\n<h3 class=\"wp-block-heading\">FortiGate \u2014 Route Maps and Prefix Lists<\/h3>\n<p style=\"line-height:1.85\">Controlling inbound and outbound routes is critical. Here is how to create a prefix list and apply it via a route map on FortiGate:<\/p>\n<pre class=\"wp-block-code\"><code># Create a prefix list\nconfig router prefix-list\n    edit \"ALLOW-RFC1918\"\n        config rule\n            edit 1\n                set prefix 10.0.0.0 255.0.0.0\n                set le 32\n                set action permit\n            next\n            edit 2\n                set prefix 172.16.0.0 255.240.0.0\n                set le 32\n                set action permit\n            next\n            edit 3\n                set prefix 192.168.0.0 255.255.0.0\n                set le 32\n                set action permit\n            next\n        end\n    next\nend\n\n# Create a route map referencing the prefix list\nconfig router route-map\n    edit \"BGP-OUTBOUND\"\n        config rule\n            edit 1\n                set match-ip-address \"ALLOW-RFC1918\"\n                set action permit\n            next\n        end\n    next\nend\n\n# Apply the route map to the neighbour\nconfig router bgp\n    config neighbor\n        edit \"10.0.0.2\"\n            set route-map-out \"BGP-OUTBOUND\"\n        next\n    end\nend<\/code><\/pre>\n<h3 class=\"wp-block-heading\">FortiGate \u2014 Useful Verification Commands<\/h3>\n<pre class=\"wp-block-code\"><code># Check BGP neighbour summary\nget router info bgp summary\n\n# View the BGP routing table\nget router info bgp network\n\n# Check details for a specific neighbour\nget router info bgp neighbors 10.0.0.2\n\n# View routes advertised to a neighbour\nget router info bgp neighbors 10.0.0.2 advertised-routes\n\n# View routes received from a neighbour\nget router info bgp neighbors 10.0.0.2 routes<\/code><\/pre>\n<div style=\"height:32px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h2 class=\"wp-block-heading\">Cisco vs. FortiGate \u2014 Quick Comparison<\/h2>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Feature<\/th>\n<th>Cisco IOS<\/th>\n<th>FortiGate (FortiOS)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Enter BGP config<\/td>\n<td><code>router bgp &lt;ASN&gt;<\/code><\/td>\n<td><code>config router bgp<\/code><\/td>\n<\/tr>\n<tr>\n<td>Define neighbour<\/td>\n<td><code>neighbor &lt;IP&gt; remote-as &lt;ASN&gt;<\/code><\/td>\n<td><code>config neighbor \u2192 edit &lt;IP&gt; \u2192 set remote-as<\/code><\/td>\n<\/tr>\n<tr>\n<td>Advertise network<\/td>\n<td><code>network &lt;prefix&gt; mask &lt;mask&gt;<\/code><\/td>\n<td><code>config network \u2192 edit \u2192 set prefix<\/code><\/td>\n<\/tr>\n<tr>\n<td>Verify neighbours<\/td>\n<td><code>show ip bgp summary<\/code><\/td>\n<td><code>get router info bgp summary<\/code><\/td>\n<\/tr>\n<tr>\n<td>View BGP table<\/td>\n<td><code>show ip bgp<\/code><\/td>\n<td><code>get router info bgp network<\/code><\/td>\n<\/tr>\n<tr>\n<td>MD5 authentication<\/td>\n<td><code>neighbor &lt;IP&gt; password<\/code><\/td>\n<td><code>set password<\/code> under neighbour<\/td>\n<\/tr>\n<tr>\n<td>Route map (outbound)<\/td>\n<td><code>neighbor &lt;IP&gt; route-map &lt;name&gt; out<\/code><\/td>\n<td><code>set route-map-out<\/code> under neighbour<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<div style=\"height:24px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h2 class=\"wp-block-heading\">Common Troubleshooting Tips<\/h2>\n<ul>\n<li><strong>Neighbour stuck in Active\/Idle<\/strong> \u2014 Check TCP connectivity on port 179. Verify firewall rules, ACLs, and that the neighbour IP and ASN are correct on both sides.<\/li>\n<li><strong>Routes not appearing in the table<\/strong> \u2014 Ensure the network statement matches an exact route in the routing table (Cisco) or that the prefix is correctly defined (FortiGate). Check route maps and prefix lists for unintended deny rules.<\/li>\n<li><strong>MD5 authentication mismatch<\/strong> \u2014 Both sides must have the identical password. A mismatch will cause TCP resets. On FortiGate, use <code>diagnose sys tcpsock | grep 179<\/code> to check for session issues.<\/li>\n<li><strong>iBGP next-hop unreachable<\/strong> \u2014 Use <code>next-hop-self<\/code> on Cisco or <code>set next-hop-self enable<\/code> on FortiGate to rewrite the next hop for iBGP peers.<\/li>\n<li><strong>AS path loop<\/strong> \u2014 iBGP does not modify the AS path, which is why a full mesh or route reflectors are required.<\/li>\n<\/ul>\n<div style=\"height:24px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n<p style=\"line-height:1.85\">BGP is a deep protocol with many advanced features \u2014 route reflectors, confederations, communities, graceful restart, BFD integration, and more. But every BGP deployment starts with these basics: defining your AS, establishing neighbour relationships, and advertising your prefixes. Once you are comfortable with the fundamentals on both Cisco and FortiGate, you will have a solid foundation to build on.<\/p>\n<p style=\"line-height:1.85\">In future posts, we will dive deeper into advanced BGP topics including route filtering strategies, BGP communities, and high-availability designs. Stay tuned.<\/p>\n<div style=\"height:16px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<p style=\"font-size:0.9rem;color:#888\"><em>\u2014 Inho<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A practical introduction to Border Gateway Protocol (BGP) fundamentals with hands-on configuration examples for both Cisco IOS and FortiGate (FortiOS).<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-17","post","type-post","status-publish","format-standard","hentry","category-networking"],"_links":{"self":[{"href":"https:\/\/inhochoi.com\/index.php\/wp-json\/wp\/v2\/posts\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/inhochoi.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/inhochoi.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/inhochoi.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/inhochoi.com\/index.php\/wp-json\/wp\/v2\/comments?post=17"}],"version-history":[{"count":0,"href":"https:\/\/inhochoi.com\/index.php\/wp-json\/wp\/v2\/posts\/17\/revisions"}],"wp:attachment":[{"href":"https:\/\/inhochoi.com\/index.php\/wp-json\/wp\/v2\/media?parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/inhochoi.com\/index.php\/wp-json\/wp\/v2\/categories?post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/inhochoi.com\/index.php\/wp-json\/wp\/v2\/tags?post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}