Internal BGP (Border Gateway Protocol) explained

Hello,

In the video for split horizon when the routers are drawn linearly and are within the same AS you show that the first router advertise its prefixes to the second router but the second router cant advertise it to the third due to split horizon. Technically since all 3 of the routers are within the same AS then the first router should not be able to advertise to the second router too right due to the same rule? They are all IBGP neighbors then no router should be able to advertise any prefixes correct? or is there a rule where the first router in an IBGP can advertise its prefixes to the next router and it stops there?

Hello Kshitij

The iBGP split horizon rule states that an iBGP router that learns a route from an iBGP peer will not advertise that route to any other peers. This does not mean that the iBGP router cannot advertise routes that it learns from other sources, like from the network command under the BGP configuration, or from redistribution from an IGP or from static routes. These routes can and will be advertised using iBGP.

Remember, iBGP requires a full mesh of iBGP peerings between all iBGP routers within an AS. That means that an iBGP router will advertise its networks to all other iBGP peers directly. So there is no need for one iBGP router to relay routes it learns from another iBGP router. Does that make sense?

I hope this has been helpful!

Laz

Hi,

in the topology why we couldnt carry the advertisement within the same AS.

I mean that without having to establish neighborship between R2 and R4 why dont we just,

  1. advertise 1.1.1.1 network from R2 to R3
  2. advertise 1.1.1.1 network from R3 to R4
  3. advertise from R4 to R5

With that way there would be no necessity to have neighborship between R2 and R4. Is this technically feasible?

Thank you

Hello Görgen

This has to do with the way iBGP works. If you do it the way you suggest, the advertisement would never reach R4 because of the iBGP split horizon rule. On the other hand, if you made R3 an iBGP peer as well as you suggest, you would also have to follow the iBGP full mesh peering rule, which means you would be obligated to create the peering between R2 and R4 directly.

By making only R2 and R4 iBGP peers, and keeping R3 out, you are not breaking any of these design rules, allowing BGP to advertise the necessary networks. Does that make sense?

I hope this has been helpful!

Laz

Hello Guys I have one question in this part of the text:

So, our IP packet reached R4, but after that, it went somewhere into oblivion. R4 is not the problem, so we’ll have to check the next device in the path towards R1. That’s R3.

R3 is an interesting router since it doesn’t run BGP, only OSPF. Let’s check R3:

R3#show ip route 1.1.1.0
% Network not in table

Why the traffic need to go from R5 - R4 - R3 ? cause already we have and neighborhood between R4 - R2 I think the path must be R5 - R4 - R2.

Hello Daniel

From the point of view of BGP, indeed, the next hop from R4 is R2. However, physically, the packet must still traverse R3. So that packet will reach R3 with a destination IP of 1.1.1.1. Since R3 does not have that in its routing table, it will discard it. It is not enough for R4 to have R2’s IP address as the next hop. This just tells R4 out of which interface to send the packet. It is the responsibility of R3 to route the packet to its destination further, but if its routing table (for whatever reason) doesn’t have the destination network, it will be discarded.

For this reason, R3 must also learn about the destination network, and to do that it should participate in BGP.

I hope this has been helpful!

Laz

Hello Rene,
I don’t understand why i must use the command - neighbor x.x.x.x next-hop-self, in routers R2 and R4.
Regards,
David

Hello David!

When R1 advertises its 1.1.1.0/24 network to R2, it advertises it with the IP address of the Fa0/0 interface of R1 as the next hop IP: 192.168.12.1. This makes sense since that’s the interface to which you want to send packets destined for the 1.1.1.0/24 network.

However, R2 must now announce the 1.1.1.0/24 network to its iBGP peers within AS2. When it does so, it does not change the next hop IP. So when R4 receives the BGP update for 1.1.1.0/24 it will also receive it with a next hop IP of 192.168.12.1. However, R4 doesn’t know how to reach 192.168.12.1, because that destination is not in its routing table.

One of the prerequisites of a route entering the BGP table is that the next hop is reachable (i.e. in the local routing table). But this is not the case at this point for R4, so the route does not enter the BGP table.

To resolve this issue, R2 has been configured with the “next hop self” feature. This feature causes R2 to replace the next hop IP for the 1.1.1.0/24 network with itself when it advertises it. So when it announces this prefix to R4, it will use the 2.2.2.2 address as the next hop IP for that route, which is its own IP address. Ultimately, this allows R4 to put the 1.1.1.0/24 network into its BGP table, because it has a route to that next hop address.

For more information about the next hop self feature and examples of how it is employed, take a look at the following lesson:

I hope this has been helpful!

Laz

Screenshot (199)
I created full mesh ibgp routing in between and ran ospf. I advertise a network on R4 in ibgp and when I saw that network in R1 it is shown with next hop 4.4.4.4.(loopback of r4 used to create ibgp neigbourship) but I thought I would get two route to the network on r4 one via r2 and r3. And yes I ran the next-hop-self command on both r3 and r2. What am I missing???

Hello Speedosuper111

What you are seeing is normal iBGP behavior. By definition, the iBGP split horizon rule prevents iBGP peers that receive routes via iBGP to readvertise them to other iBGP peers. So in this topology, you would never see R4 advertise a network, and have R2 or R3 readvertise that network to R1. R1 will only receive one advertisement or that network, DIRECTLY from R4. That’s why you see the 4.4.4.4 next hop.

Remember that in an AS, you have full mesh peering between iBGP peers. So R4 peers directly with R2, R3, AND R1, even though R1 is not directly connected (that’s why you need the underlying IGP to establish full connectivity).

So R1 will receive the update for the network directly from R4, providing itself as the next hop IP. Make sense?

I hope this has been helpful!

Laz

I got it and I created R2 as route-reflector and with the help of route-map on R1 I set the next hop ip to R2’s ip so that set the next hop of R2. How route-reflector works here with the route-map combined??

Hello Speedosuper111

The route reflector and the modification of the next hop IP are two separate independent processes. They can be applied together, but they don’t directly affect one another. You must ensure that you are applying each one for the proper reasons.

A route-reflector solves the iBGP full-mesh requirement by allowing routes learned from one iBGP peer to be advertised to other iBGP peers. Keep in mind that route-reflectors do NOT change the next-hop attribute by default, nor is it needed in most cases. When R2 reflects a route from R4 to R1, it preserves the original next-hop (R4’s IP), and this is what should happen. The RR adds ORIGINATOR_ID and CLUSTER_LIST attributes to the route for loop prevention, but leaves next-hop unchanged.

By using a route map, you have changed the next hop IP of the specific route to that of R2. Specifically:

  • When R1 receives the BGP update from R2, the next-hop is still pointing to R4
  • Your route-map (applied inbound on R1) modifies the next-hop attribute as R1 receives it
  • This changes the next-hop from R4’s IP to R2’s IP in R1’s BGP table
  • Result: R1 now forwards traffic to R2, and R2 forwards it onward to R4

But the question is, why would you want to do this? If you’re just experimenting, that’s great, but in a production network, it is preferable to have the next hop IP in iBGP be the IP of the actual router that generated or injected the route, rather than route it via another iBGP router. This can result in suboptimal routing. Make sense?

I hope this has been helpful!

Laz

Hello, everyone.

What’s a common practice for eBGP Multihop? Considering that for loopback peerings, you could just use disable-connected-check.

I was thinking Route Servers maybe? Since those don’t always have to be directly connected, right?

Thank you
David

Hello David

You could, but this still has the risk of failing depending upon how the specific platform and OS interpret the TTL=1 issue. Whenever using loopbacks as the source of BGP information, it’s always best practice to use multihop.

For other scenarios, eBGP multihop is used:

  • If you have a firewall or other Layer 3 security device between eBGP routers
  • When peers are genuinely separated by multiple routers, e.g., a service provider to customer link across an access network
  • BGP over Tunnels - when running BGP over GRE, IPsec, or other overlay tunnels where the peer may be multiple routing hops away through the underlay

In standard IXP deployments, route servers typically do NOT require eBGP multihop. Route servers at Internet Exchange Points (IXPs) are usually located on a shared Layer 2 broadcast domain (the IXP peering LAN/VLAN). All participating routers and the route server share the same subnet and are Layer 2 adjacent. Therefore, standard eBGP with TTL = 1 works perfectly fine.

Using multihop at an IXP is generally discouraged unless there’s a very specific non-standard topology. The standard practice is direct peering on the IXP fabric with default TTL. Make sense?

I hope this has been helpful

Laz

1 Like