{"id":4825,"date":"2026-01-30T15:12:28","date_gmt":"2026-01-30T15:12:28","guid":{"rendered":"https:\/\/geekmungus.co.uk\/?p=4825"},"modified":"2026-01-30T15:13:18","modified_gmt":"2026-01-30T15:13:18","slug":"bgp-test-lab-part-2-internal-bgp-ibgp-two-router-configuration","status":"publish","type":"post","link":"https:\/\/geekmungus.co.uk\/?p=4825","title":{"rendered":"BGP Test Lab &#8211; Part 2 &#8211; Internal BGP (iBGP) &#8211; Two Router Configuration"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Internal BGP (iBGP) is the next part of our deployment. We are going to be deploying two routers within one of the AS, Blue 65001. Remember that&nbsp;eBGP&nbsp;is used between AS and&nbsp;iBGP&nbsp;is used within an AS. So in this case our second router, Router B, will be linked to Router A via a single link, these two Routers will exchange routes using iBGP and Router A will act as the bridgehead that exchanges routes out to Router C within the other AS Green 65002.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll notice on the diagram below, the summary&nbsp;supernet&nbsp;has been added, although not essential, it&#8217;s good to be able to summarise whole ranges of address space to minimise the number of routes being exchanged. In this case AS Blue 65001 is having the summary 10.1.0.0\/16, while AS Green 65002 is having 65002.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Another very important thing to know is that&nbsp;iBGP&nbsp;requires (caveat below), a &#8220;full mesh&#8221; between all Routers within the AS. i.e. each Router within an AS must have a direct link to every other one, in this case we have two Router A and Router B, so we are fine. But if we were to add another Router to this AS, this would need links to both Router A and Router B too.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, you can also use&nbsp;iBGP without&nbsp;a &#8220;full mesh&#8221;, we&#8217;ll explore the techniques for how, when and why in later parts of this series, such as: using another routing protocol to exchange routes, Route Reflector and Confederations.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;ve not read\u00a0<a href=\"https:\/\/geekmungus.co.uk\/?p=4780\">BGP Test Lab &#8211; Part 1 &#8211; Introduction and Basic Two Router Configuration<\/a>\u00a0do that now, because this configuration builds upon this.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"997\" height=\"676\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-2.png\" alt=\"\" class=\"wp-image-4826\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-2.png 997w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-2-300x203.png 300w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-2-768x521.png 768w\" sizes=\"auto, (max-width: 997px) 100vw, 997px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The example assumes that you have two Routers already powered on, cabled up and ready for configuration.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-Step1-ConfigurePointtoPointLinks\">Step 1 &#8211; Configure Point to Point Links<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">First step is to configure the point to point links between Router A and Router C.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-RouterA\">Router A<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We add the point to point IP and VLAN for this link, ensuring it is enabled for routing.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>create vlan \"RA-RB\"\nconfigure vlan \"RA-RB\" ipaddress 192.168.100.25\/30\nenable ipforwarding vlan \"RA-RB\"\nconfigure vlan \"RA-RB\" add port 2 untagged<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-RouterB\">Router B<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We add the point to point IP and VLAN for this link, ensuring it is enabled for routing.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>create vlan \"RB-RA\"\nconfigure vlan \"RB-RA\" ipaddress 192.168.100.26\/30\nenable ipforwarding vlan \"RB-RA\"\nconfigure vlan \"RB-RA\" add port 2 untagged<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should now be able to ping from the interface IP on Router B to the interface IP on Router A for this newly added link, if you cannot verify your configuration before proceeding further.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-Step2-ConfigureLoopbackInterfaceforRouterID\">Step 2 &#8211; Configure Loopback Interface for Router ID<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">We then need to add the loopback interfaces for the Router ID on Router B.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-RouterB.1\">Router B<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Making this a loopback interface means it comes up and stays up, even there are no ports assigned or live in that VLAN.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>create vlan \"RouterB-LP\"\nconfigure vlan RouterB-LP tag 1112\nenable loopback-mode vlan RouterB-LP\nconfigure vlan RouterB-LP ipaddress 1.1.1.2 255.255.255.255\nenable ipforwarding vlan RouterB-LP<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-Step3-ConfigureVLANandInterfaceforExampleLAN(Subnet)onRouterB\">Step 3 &#8211; Configure VLAN and Interface for Example LAN (Subnet) on Router B<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;re going to create a VLAN and interface on Router B to be example LAN network, i.e. default gateway, so we can use these for testing and more importantly as networks we&#8217;re advertising via BGP.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;re enabling loopback on this for now, because it doesn&#8217;t have any active ports in the VLAN to keep it up, but it needs to be up for us to use it for testing.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-RouterB.2\">Router B<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">So we&#8217;ll create a VLAN called<strong>&nbsp;RouterB-LAN1 (tag 1003)<\/strong>&nbsp;on Router B with the interface IP address of 10.1.1.1\/24 (i.e. network subnet 10.1.1.0\/24), all within the summarised network of 10.1.0.0\/16. We used 10.1.0.0\/24 for the RouterA-LAN1 subnet which is connected to Router A.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>create vlan \"RouterB-LAN1\" tag 1003\nconfigure vlan \"RouterB-LAN1\" ipaddress 10.1.1.1\/24\nenable ipforwarding \"RouterB-LAN1\"\nenable loopback-mode vlan \"RouterB-LAN1\"<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-Step4-EnableBGPandCreateNeighbour\">Step 4 &#8211; Enable BGP and Create Neighbour<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Okay, now we are ready to enable BGP on Router B, but we&#8217;re also going to need to do some configuration on Router&nbsp;A too. Firstly, on Router B we&#8217;ll need to enable BGP and configure it&#8217;s AS number (same as Router A because its in the same AS) and a Router ID too. Then, we&#8217;ll configure the BGP Neighbour to Router A, the configuration for this is a bit different to what we did in the first part being this is&nbsp;iBGP&nbsp;rather than&nbsp;eBGP.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-RouterB.3\">Router B<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We enable BGP, then we add the neighbour with Router A.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>configure bgp AS-number 65001\nconfigure bgp routerid 1.1.1.2\nenable bgp\n\ncreate bgp neighbor 192.168.100.25 remote-AS-number 65001\nconfigure bgp neighbor 192.168.100.25 source-interface ipaddress 192.168.100.26\nenable bgp neighbor 192.168.100.25<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-RouterA.1\">Router A<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We don&#8217;t need to set up BGP, that was already done, we just need to add the BGP Neighbour to Router C.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>create bgp neighbor 192.168.100.26 remote-AS-number 65001\nconfigure bgp neighbor 192.168.100.26 source-interface ipaddress 192.168.100.25\nenable bgp neighbor 192.168.100.26<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-Verify\">Verify<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before going any further ensure that you can see the BGP Neighbour adjacency within the output of the &#8220;show&nbsp;bgp&nbsp;neighbor&#8221; command, the neighbour is showing as state &#8220;ESTABLISHED&#8221; and that the router is showing as an &#8220;internal peer&#8221;, i.e.&nbsp;iBGP&nbsp;which can be seen by the &#8220;I&#8221; at the beginning for example:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"731\" height=\"260\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-3.png\" alt=\"\" class=\"wp-image-4828\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-3.png 731w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-3-300x107.png 300w\" sizes=\"auto, (max-width: 731px) 100vw, 731px\" \/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-Step5-AddExampleLANSubnettoBGP\">Step 5 &#8211; Add Example LAN Subnet to BGP<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">In Step 2, we added an example LAN that we could use for testing, so we can actually advertise networks via BGP between the routers; and exchange some routes between them. Due to the limitations of the test lab at this stage, we don&#8217;t have any downstream switches connected to the routers, so we don&#8217;t have something real, so instead we&#8217;ll create the VLAN interface, but then make it a loopback, so the interface stays up artificially for testing purposes.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once done, we&#8217;ll enable this for BGP, meaning that BGP will add these into the RIB.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-RouterB.4\">Router B<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We add the subnet that we want to have advertised.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>configure bgp add network 10.1.1.0\/24<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-Step6-VerifyiBGPUsage,RouteExchangeandTroubleshooting\">Step 6 &#8211; Verify iBGP Usage, Route Exchange and Troubleshooting<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Now the configuration is done, we can verify what is happening.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-Question1:IsiBGPbeingusedtoadvertisetherouteswithintheAS?\">Question 1: Is iBGP being used to advertise the routes within the AS?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To determine this we run the command &#8220;show&nbsp;iproute&#8221; and &#8220;show&nbsp;bgp&nbsp;neighbor&#8221; from Router A and Router C, and we can indeed see that on Router A, the RouterB-LAN1 subnet (10.1.1.0\/24) is being advertised via&nbsp;iBGP&nbsp;to Router A and on Router B we can see that Router A&#8217;s RouterA-LAN1 subnet (10.1.0.0\/24) is being advertised&nbsp;via iBGP to&nbsp;Router A.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"749\" height=\"623\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-4.png\" alt=\"\" class=\"wp-image-4829\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-4.png 749w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-4-300x250.png 300w\" sizes=\"auto, (max-width: 749px) 100vw, 749px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"733\" height=\"613\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-6.png\" alt=\"\" class=\"wp-image-4831\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-6.png 733w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-6-300x251.png 300w\" sizes=\"auto, (max-width: 733px) 100vw, 733px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Based on these outputs, we can see that the\u00a0iBGP is\u00a0being used to exchange the routes within the AS.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-Question2:IstheroutelearnedfromRouterBbeingadvertisedtoRouterC?Andviceversa?\">Question 2: Is the route learned from Router B being advertised to Router C? And vice versa?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For all the traffic to flow between all three of our LAN subnets, all three routers need to know a route to all three of the networks, so that outgoing traffic knows where to go,&nbsp;but equally as&nbsp;important the return traffic knows it&#8217;s way back!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-Investigation\">Investigation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s examine Router C&#8217;s route table, that all looks fine, the circled routes are those from AS Blue 65001, and we can see we have both the LANs being advertised.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"752\" height=\"646\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-7.png\" alt=\"\" class=\"wp-image-4832\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-7.png 752w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-7-300x258.png 300w\" sizes=\"auto, (max-width: 752px) 100vw, 752px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Router A shows what we would expect, the LAN subnet from AS Green 65002 and the LAN subnet from its local interface 10.1.0.0\/24 as well as the route from Router C within the same AS.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"741\" height=\"627\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-8.png\" alt=\"\" class=\"wp-image-4833\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-8.png 741w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-8-300x254.png 300w\" sizes=\"auto, (max-width: 741px) 100vw, 741px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now we come to Router B and this is where we have a problem. Notice that the Router C LAN is missing. What this means is, that although a client on the\u00a0<strong>RouterC-LAN1<\/strong>\u00a0(10.2.0.0\/24) might be able to reach the\u00a0<strong>RouterB-LAN1<\/strong>\u00a0(10.1.1.0\/24), Router B has no route back to this VLAN, so connectivity won&#8217;t work.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"703\" height=\"623\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-9.png\" alt=\"\" class=\"wp-image-4834\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-9.png 703w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-9-300x266.png 300w\" sizes=\"auto, (max-width: 703px) 100vw, 703px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-Cause\">Cause<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">So why is this happening? Why is Router B not learning the route from Router A via iBGP?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s all down to the differences between&nbsp;eBGP&nbsp;and&nbsp;iBGP. Every BGP route has a NEXT_HOP attribute:&nbsp;\u201cIf you want to reach this prefix, send packets to this IP address.\u201d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So with&nbsp;eBGP&nbsp;when a router leans a route&nbsp;via eBGP, it changes the NEXT_HOP to itself when advertising the route onward (to downstream routers). But when&nbsp;iBGP&nbsp;learns a route it does not change NEXT_HOP when advertising the route onward (to downstream routers). What this means we can now see in the outputs below.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The outputs are from Router B, we can see here that Router B has indeed learnt the route for Router C&#8217;s LAN&nbsp;<strong>RouterC-LAN1<\/strong>&nbsp;(10.2.0.0\/24), but notice that there is a &#8220;u&#8221; for unfeasible next to this route. Because of this although the route has been learnt by the Router B, it&#8217;s not been added to the routing table of Router B, ergo, if you were to try to ping from the interface of RouterB-LAN1 (i.e. 10.1.1.1) to the interface of RouterC-LAN1 (i.e. 10.2.0.1) (or vice versa) then you&#8217;d find it didn&#8217;t work!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"415\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-10.png\" alt=\"\" class=\"wp-image-4835\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-10.png 730w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-10-300x171.png 300w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><figcaption class=\"wp-element-caption\">Router B &#8211; Unfeasible Route<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"255\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-11.png\" alt=\"\" class=\"wp-image-4836\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-11.png 500w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-11-300x153.png 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><figcaption class=\"wp-element-caption\">Router B &#8211; Route Detail<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Notice the &#8220;Next-Hop 192.168.100.10&#8221; value for the route to this network 10.2.0.0\/24 in the second output (right). From Router B&#8217;s point of view, it doesn&#8217;t have a route to 192.168.100.10, this IP is on Router A (and Router A is the only router in AS Blue that knows about it), therefore Router B can&#8217;t send any traffic to it (directly), which therefore makes this route unfeasible from Router B&#8217;s point of view.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So we now know what is happening and why this route is not being added to Router B&#8217;s route table (because its unfeasible), the question is how do we go about fixing this, and what are the right ways and wrong ways to do this?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are a few ways that can be implemented, we&#8217;ll explore the first in the section below called:&nbsp;<strong>&#8220;Step 7 &#8211; Configure&nbsp;iBGP&nbsp;Next-Hop for Edge Router (Bridgehead Router)&#8221;<\/strong>, and the others in subsequent parts of this series.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-Step7-ConfigureiBGPNext-HopforEdgeRouter(BridgeheadRouter)\">Step 7 &#8211;&nbsp;Configure iBGP&nbsp;Next-Hop for Edge Router (Bridgehead Router)<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">There is the concept of the &#8220;Next-Hop-Self&#8221; configuration. What &#8220;Next-Hop-Self&#8221; does is to tell a router, for example Router A in this example (i.e. the edge\/bridgehead router) to re-write the route&#8217;s NEXT_HOP attribute with itself when advertising on&nbsp;iBGP routes.&nbsp;i.e. to behave like&nbsp;eBGP&nbsp;effectively.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-Why?\">Why?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">OK, so if it&#8217;s that easy, what&#8217;s the big deal. Well, the &#8220;Next-Hop-Self&#8221; is not the fix, well not the fix for all eventualities, it is a reasonable way to resolve this issue in certain configurations.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now in our case we have the following topology, Router A is the edge router (or bridgehead router) for the AS Blue 65001, and Router B is an internal router. Therefore, setting &#8220;next-hop-self&#8221; on the routes being advertised from Router A to router B is reasonable, because Router B essentially has nowhere else to go being it is a &#8220;router on a stick&#8221; type configuration.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this case us manipulating the routes as they are advertised across is okay, we&#8217;re not doing anything particularly problematic for ourselves. But if in future the network (within AS Blue) were to grow, it&#8217;s a design decision that would need to be revisited.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"977\" height=\"683\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-12.png\" alt=\"\" class=\"wp-image-4837\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-12.png 977w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-12-300x210.png 300w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-12-768x537.png 768w\" sizes=\"auto, (max-width: 977px) 100vw, 977px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-WhyNot?\">Why Not?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Using next-hop-self is not a magic solution, but can work well in certain situations. So why should you not use it?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next-hop-self can, if used in the wrong situation:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>cause issues\u00a0by breaking the way that you&#8217;d expect BGP to work, this can mean that traffic flows in unexpected ways, or ways not designed for.<\/li>\n\n\n\n<li>cause an\u00a0AS with multiple exit points to hide these exit points, meaning reduction in availability in the event of failure or traffic not flowing out of multiple exit points as expected.<\/li>\n\n\n\n<li>at best\u00a0cause suboptimal routing and traffic flows and at worst loss of connectivity in certain (failure) scenarios.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-Options\">Options<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">So what are the options?<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Next-Hop-Self &#8211; As described above, we set the BGP neighbour configuration to use &#8220;next-hop-self&#8221; on Router A, so any routes it learns (from Router C) have the NEXT_HOP attribute changed to Router A as the next hop, essentially to the IP address at the other end of the point to point IP from Router C&#8217;s point of view.<\/li>\n\n\n\n<li>Inject Next-Hop Subnets into another routing protocol &#8211; Using another routing protocol (interior routing protocol) for example OSPF or\u00a0EIGRP\u00a0etc., we distribute all the routes for the &#8220;next-hop&#8221; subnets, i.e. the point to point links via another routing protocol. So in this example Router C would learn the route to 192.168.100.9\/30 (i.e. 192.168.100.10) but not via BGP it would learn it say via OSPF. Router C would therefore find that previously unfeasible route is now\u00a0feasible and\u00a0it would appear in the route table and connectivity would work.<\/li>\n\n\n\n<li>Route Reflectors &#8211; A more scalable approach is to use Route Reflectors to distribute the routes effectively within an AS.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-ButWhatAboutLoops?\">But What About Loops?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s possible for routing loops to occur. BGP has mechanisms to avoid these happening, and these differ based on if you are using&nbsp;iBGP&nbsp;or using&nbsp;eBGP.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>eBGP prevents loops using the AS_PATH: if you ever see your own AS number in the path of a route, you reject the route and don&#8217;t install it in that router&#8217;s routing table, therefore no loop can form.<\/li>\n\n\n\n<li>iBGP\u00a0cannot use AS_PATH for loop prevention (because all routers are in the same AS), so it uses strict propagation rules instead: routes learned from iBGP are not re-advertised to other iBGP peers. Therefore, there no loop can form via this method.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For&nbsp;eBGP&nbsp;this is very simple and effective. But requires that routes go across AS, so they can appear in the AS_PATH.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But for&nbsp;iBGP&nbsp;this is not the case, there is only one AS, so routes that are propagated don&#8217;t have an AS added to AS_PATH, being it is in the same one.&nbsp;For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>R1 \u2014\u2014 R2 \u2014\u2014 R3<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>R1 advertises a route to R2 (iBGP)<\/li>\n\n\n\n<li>R2\u00a0<strong>cannot<\/strong>\u00a0advertise it to R3<\/li>\n\n\n\n<li>Therefore, the route cannot circulate indefinitely<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This is&nbsp;<strong>loop prevention by suppression<\/strong>, not detection.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The cost of this rule therefore is that:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>iBGP does\u00a0not scale naturally<\/li>\n\n\n\n<li>And to scale requires techniques like:\n<ul class=\"wp-block-list\">\n<li>Full mesh, or<\/li>\n\n\n\n<li>Route reflectors, or<\/li>\n\n\n\n<li>Confederations<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-Resolution-UsingNext-Hop-Self\">Resolution &#8211; Using Next-Hop-Self<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Okay, so enough about the theory, let&#8217;s get this fixed and working again.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">All we need to do is edit the BGP neighbour configuration on Router A to ensure the neighbour to Router C is marked as &#8220;next-hop-self&#8221;.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-RouterA.2\">Router A<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>disable bgp neighbor 192.168.100.26\nconfigure bgp neighbor 192.168.100.26 next-hop-self\nenable bgp neighbor 192.168.100.26<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Okay, that should do it. The BGP routes that Router A has learnt will be advertised to Router C, but with the NEXT_HOP attribute set to the Router A end of the point to point link, i.e. 192.168.100.25. We&#8217;ll verify this in the final step.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-Step8-VerifyBehaviour\">Step 8 &#8211; Verify Behaviour<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">So we should be good to go now, so let&#8217;s verify this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"415\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-13.png\" alt=\"\" class=\"wp-image-4838\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-13.png 730w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-13-300x171.png 300w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><figcaption class=\"wp-element-caption\">Router B &#8211; Before<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"724\" height=\"406\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-14.png\" alt=\"\" class=\"wp-image-4839\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-14.png 724w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-14-300x168.png 300w\" sizes=\"auto, (max-width: 724px) 100vw, 724px\" \/><figcaption class=\"wp-element-caption\">Router B &#8211; After<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">As we can see Router B is now seeing 10.2.0.0\/24 which is the RouterC-LAN1 network subnet being installed as a route in the route table.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"716\" height=\"639\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-15.png\" alt=\"\" class=\"wp-image-4840\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-15.png 716w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-15-300x268.png 300w\" sizes=\"auto, (max-width: 716px) 100vw, 716px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">And the ping and traceroute now work as expected.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"670\" height=\"373\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-16.png\" alt=\"\" class=\"wp-image-4841\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-16.png 670w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/01\/image-16-300x167.png 300w\" sizes=\"auto, (max-width: 670px) 100vw, 670px\" \/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"BGPTestLabPart2InternalBGP(iBGP)TwoRouterConfiguration-AdditionalInformation\">Additional Information<\/h1>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.bgphelp.com\/2017\/03\/05\/bgp-next-hop-self-explained\/\">https:\/\/www.bgphelp.com\/2017\/03\/05\/bgp-next-hop-self-explained\/<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Internal BGP (iBGP) is the next part of our deployment. We are going to be deploying two routers within one of the AS, Blue 65001. Remember that&nbsp;eBGP&nbsp;is used between AS and&nbsp;iBGP&nbsp;is used within an AS. So in this case our second router, Router B, will be linked to Router A via a single link, these &#8230; <a title=\"BGP Test Lab &#8211; Part 2 &#8211; Internal BGP (iBGP) &#8211; Two Router Configuration\" class=\"read-more\" href=\"https:\/\/geekmungus.co.uk\/?p=4825\" aria-label=\"Read more about BGP Test Lab &#8211; Part 2 &#8211; Internal BGP (iBGP) &#8211; Two Router Configuration\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":4783,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62,41,17],"tags":[],"class_list":["post-4825","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bgp","category-extreme-networks","category-networking"],"_links":{"self":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4825"}],"version-history":[{"count":2,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4825\/revisions"}],"predecessor-version":[{"id":4844,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4825\/revisions\/4844"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/media\/4783"}],"wp:attachment":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}