iBGP Peering |
BGP Update Source
TASK
- Configure eBGP peering between R4 (AS 1) and BB3 (AS 54).
- Configure eBGP peering between R6 (AS 1) and BB1 (AS 54).
R4 eBGP peering is going to be the first task. I would like to pay attention to some important details regarding eBGP connection.
R4 Configuration:
R4 Configuration:
router bgp 1
neighbor 192.168.134.254 remote-as 54
Now, a few verification steps to make a few important observations.
R4#show ip bgp neighbor 192.168.134.254
BGP neighbor is 192.168.134.254, remote AS 54, external link
BGP version 4, remote router ID 31.3.0.1
BGP state = Established, up for 00:03:51
The neighbor is in AS 54 unlike R4, which is in AS 1. That makes the BGP connection type eBGP.
This is marked with 'external link' for eBGP (internal link is iBGP).
Another very important characteristic of eBGP is that BGP uses TTL 1 (hop) by default. In iBGP connections that TTL is 255 by default (Outgoing TTL 1). This means that it is assumed that in order for eBGP connections to work, the peers (routers) must be DIRECTLY connected to each other. This can be changed and shown in later labs.
R4#show ip bgp neighbor 192.168.134.254 | i TTL
Connection is ECN Disabled, Mininum incoming TTL 0, Outgoing TTL 1
What are we learning from AS 54? Here it is:
R4#show ip bgp reg _54$
Network Next Hop Metric LocPrf Weight Path
*> 28.119.16.0/24 192.168.134.254 0 0 54 i
*> 28.119.17.0/24 192.168.134.254 0 0 54 i
*> 114.0.0.0 192.168.134.254 0 54 i
*> 115.0.0.0 192.168.134.254 0 54 i
*> 116.0.0.0 192.168.134.254 0 54 i
*> 117.0.0.0 192.168.134.254 0 54 i
*> 118.0.0.0 192.168.134.254 0 54 i
*> 119.0.0.0 192.168.134.254 0 54 i
R4#
R6 Configuration:
router bgp 1
neighbor 192.168.116.254 remote-as 54
Now let's see what prefixes both R4 and R6 are learning from AS 54:
R6#show ip bgp regex ^54_
Network Next Hop Metric LocPrf Weight Path
*> 28.119.16.0/24 192.168.116.254 0 54 i
* i 192.168.134.254 0 100 0 54 i
*> 28.119.17.0/24 192.168.116.254 0 54 i
* i 192.168.134.254 0 100 0 54 i
*> 112.0.0.0 192.168.116.254 0 0 54 50 60 i
* i 192.168.134.254 0 100 0 54 50 60 i
*> 113.0.0.0 192.168.116.254 0 0 54 50 60 i
* i 192.168.134.254 0 100 0 54 50 60 i
*> 114.0.0.0 192.168.116.254 0 0 54 i
* i 192.168.134.254 0 100 0 54 i
*> 115.0.0.0 192.168.116.254 0 0 54 i
* i 192.168.134.254 0 100 0 54 i
*> 116.0.0.0 192.168.116.254 0 0 54 i
* i 192.168.134.254 0 100 0 54 i
*> 117.0.0.0 192.168.116.254 0 0 54 i
* i 192.168.134.254 0 100 0 54 i
*> 118.0.0.0 192.168.116.254 0 0 54 i
* i 192.168.134.254 0 100 0 54 i
*> 119.0.0.0 192.168.116.254 0 0 54 i
* i 192.168.134.254 0 100 0 54 i
R6#
R4#show ip bgp reg ^54_
Network Next Hop Metric LocPrf Weight Path
* i 28.119.16.0/24 192.168.116.254 0 100 0 54 i
*> 192.168.134.254 0 0 54 i
* i 28.119.17.0/24 192.168.116.254 0 100 0 54 i
*> 192.168.134.254 0 0 54 i
* i 112.0.0.0 192.168.116.254 0 100 0 54 50 60 i
*> 192.168.134.254 0 54 50 60 i
* i 113.0.0.0 192.168.116.254 0 100 0 54 50 60 i
*> 192.168.134.254 0 54 50 60 i
* i 114.0.0.0 192.168.116.254 0 100 0 54 i
*> 192.168.134.254 0 54 i
* i 115.0.0.0 192.168.116.254 0 100 0 54 i
*> 192.168.134.254 0 54 i
* i 116.0.0.0 192.168.116.254 0 100 0 54 i
*> 192.168.134.254 0 54 i
* i 117.0.0.0 192.168.116.254 0 100 0 54 i
*> 192.168.134.254 0 54 i
* i 118.0.0.0 192.168.116.254 0 100 0 54 i
*> 192.168.134.254 0 54 i
* i 119.0.0.0 192.168.116.254 0 100 0 54 i
*> 192.168.134.254 0 54 i
R4#
Both R4 and R6 have two paths to the prefixes advertised by AS 54. Each one of them prefers its direct peer for those (marked with gt sign). Also, when advertising BGP prefixes, each one of them is going to advertise its best route only. Using iBGP advertisement, both R4 and R6 are going to preserver next-hop attribute.
At this point, it is going to be very interesting to look into BGP table on R1 which is receiving the same prefixes from R4 and R6. Here's what we get:
R1#show ip bgp regexp _54$
Network Next Hop Metric LocPrf Weight Path
* i 28.119.16.0/24 192.168.116.254 0 100 0 54 i
* i 192.168.134.254 0 100 0 54 i
* i 28.119.17.0/24 192.168.116.254 0 100 0 54 i
* i 192.168.134.254 0 100 0 54 i
* i 114.0.0.0 192.168.116.254 0 100 0 54 i
* i 192.168.134.254 0 100 0 54 i
* i 115.0.0.0 192.168.116.254 0 100 0 54 i
* i 192.168.134.254 0 100 0 54 i
* i 116.0.0.0 192.168.116.254 0 100 0 54 i
* i 192.168.134.254 0 100 0 54 i
* i 117.0.0.0 192.168.116.254 0 100 0 54 i
* i 192.168.134.254 0 100 0 54 i
* i 118.0.0.0 192.168.116.254 0 100 0 54 i
* i 192.168.134.254 0 100 0 54 i
* i 119.0.0.0 192.168.116.254 0 100 0 54 i
* i 192.168.134.254 0 100 0 54 i
R1#
What is worth noticing here is that R1 gets prefixes with two different paths:
- through 192.168.116.254 (BB1) and through 192.168.134.254 (BB3)
- none of these are the best routes as R1 does not know how to reach these next-hop IP addresses
There are few ways to fix it. For now, let's advertise those networks into EIGRP that is already running on all routers. Here's the configuration:
R4(config)#router eigrp 1
R4(config-router)#network 192.168.134.0
R4(config-router)#
R6(config)#router eigrp 1
R6(config-router)#network 192.168.116.0
Once R1 (and all other routers) can reach next-hop addressess: 192.168.116.254 and 192.168.134.254 via EIGRP, BGP can select the best path (grater than sign)
R1#show ip bgp regexp _54$
Network Next Hop Metric LocPrf Weight Path
* i 28.119.16.0/24 192.168.116.254 0 100 0 54 i
*>i 192.168.134.254 0 100 0 54 i
* i 28.119.17.0/24 192.168.116.254 0 100 0 54 i
*>i 192.168.134.254 0 100 0 54 i
* i 114.0.0.0 192.168.116.254 0 100 0 54 i
*>i 192.168.134.254 0 100 0 54 i
* i 115.0.0.0 192.168.116.254 0 100 0 54 i
*>i 192.168.134.254 0 100 0 54 i
* i 116.0.0.0 192.168.116.254 0 100 0 54 i
*>i 192.168.134.254 0 100 0 54 i
* i 117.0.0.0 192.168.116.254 0 100 0 54 i
*>i 192.168.134.254 0 100 0 54 i
* i 118.0.0.0 192.168.116.254 0 100 0 54 i
*>i 192.168.134.254 0 100 0 54 i
* i 119.0.0.0 192.168.116.254 0 100 0 54 i
*>i 192.168.134.254 0 100 0 54 i
R1#
R1#show ip route bgp
Gateway of last resort is not set
28.0.0.0/24 is subnetted, 2 subnets
B 28.119.16.0 [200/0] via 192.168.134.254, 00:04:58
B 28.119.17.0 [200/0] via 192.168.134.254, 00:04:58
B 112.0.0.0/8 [200/0] via 192.168.134.254, 00:04:58
B 113.0.0.0/8 [200/0] via 192.168.134.254, 00:04:58
B 114.0.0.0/8 [200/0] via 192.168.134.254, 00:04:58
B 115.0.0.0/8 [200/0] via 192.168.134.254, 00:04:58
B 116.0.0.0/8 [200/0] via 192.168.134.254, 00:04:58
B 117.0.0.0/8 [200/0] via 192.168.134.254, 00:04:58
B 118.0.0.0/8 [200/0] via 192.168.134.254, 00:04:58
B 119.0.0.0/8 [200/0] via 192.168.134.254, 00:04:58
172.16.0.0/16 is variably subnetted, 11 subnets, 2 masks
B 172.16.2.0/24 [200/0] via 10.1.0.2, 03:19:38
B 172.16.3.0/24 [200/0] via 10.1.13.3, 03:19:38
B 172.16.4.0/24 [200/0] via 10.1.146.4, 03:19:07
B 172.16.5.0/24 [200/0] via 10.1.0.5, 03:19:10
B 172.16.6.0/24 [200/0] via 10.1.146.6, 03:19:18
B 172.16.7.0/24 [200/0] via 10.1.67.7, 03:19:38
B 172.16.8.0/24 [200/0] via 10.1.58.8, 03:19:15
B 172.16.9.0/24 [200/0] via 10.1.79.9, 03:19:12
B 172.16.10.0/24 [200/0] via 10.1.108.10, 03:19:07
R1#
In the above output it is I can see that the next-hop for AS 54 network is 192.168.134.254 (BB3).
The question is what does R1 advertise to its peer R3? Is it going to be both paths or only the best? As per BGP rules, only the best path is further advertised.
Let's see one of those prefixes on R1 in more detail. Pay attention which path is the best. Then take a look at what R3 receives from R1.
R1#show ip bgp 112.0.0.0
BGP routing table entry for 112.0.0.0/8, version 24
Paths: (2 available, best #1, table default)
Not advertised to any peer
Refresh Epoch 1
54 50 60
192.168.134.254 (metric 307200) from 10.1.146.4 (172.16.4.4)
Origin IGP, metric 0, localpref 100, valid, internal, best
Refresh Epoch 1
54 50 60
192.168.116.254 (metric 2195456) from 10.1.146.6 (172.16.6.6)
Origin IGP, metric 0, localpref 100, valid, internal
R1#
R1#show ip bgp neighbor 10.1.13.3 advertised-routes
Network Next Hop Metric LocPrf Weight Path
*> 172.16.1.0/24 0.0.0.0 0 32768 i
Total number of prefixes 1
R1#
What? Only one prefix is being advertised (the one that belongs to R1)?
Of course, this is as expected. R1 is learning AS 54 prefixes from R4 and R6 over iBGP session.
BGP split-horizon rule stipulates that what is learned over iBGP cannot be re-advertised over another iBGP session. It is a loop prevention mechanism. Later, we will see how it can be handled. So far now we're going to leave this at that.
Summary
- BGP routes learned over eBGP retain original next-hop attribute
- Prefixes learned over iBGP will NOT be advertised over iBGP sessions (BGP Split-Horizon rule)
- BGP Router only advertises the best paths