BGP Fundamentals: eBGP vs iBGP, Full Mesh and Synchronization
A new iBGP session comes up, every router shows Established, and yet one edge router has no Internet routes at all. Nothing is broken: BGP is following one of its oldest rules. BGP fundamentals are full of rules like that. They explain why iBGP needs a full mesh, why eBGP sessions die when you peer between loopbacks, and why old configurations carry a no synchronization line. This is part 2 of our 26-part BGP Deep Dive. We go through the autonomous system and its number, path-vector routing, eBGP vs iBGP, TCP port 179, the three RIBs, the iBGP full mesh and the retired synchronization rule. Every rule is quoted from RFC 4271 or a vendor document, and checked on a real five-router GoBGP lab. We also captured the UPDATE bytes that the lab routers sent.
- AS: a group of prefixes with "a SINGLE and CLEARLY DEFINED routing policy".[2] AS numbers are 32 bits since RFC 6793. Of the 88,156 ASes that originated routes seen by RIPE RIS on 27 November 2026, 56.4 % had 4-byte numbers.[3][17]
- Path vector: BGP sends each prefix with the list of ASes it crossed. A router that finds its own AS in that list drops the route. Local policy picks the best path, and AS-path length is only a tie-breaker.[1]
- eBGP vs iBGP: it is the same protocol with different rules. Over iBGP, AS_PATH and NEXT_HOP stay unchanged and LOCAL_PREF is added. A route learned from one iBGP peer is never passed to another iBGP peer.[1] Our lab shows each of these rules in the UPDATE bytes.
- Full mesh: that rule forces every iBGP speaker to peer with every other one, n(n-1)/2 sessions in total. Route reflectors and confederations exist to avoid it.[6][7]
- Synchronization: do not advertise an iBGP route to eBGP peers before the IGP knows it. The rule was needed in the 1990s and has been off by default in Cisco IOS since 12.2(8)T.[5][11]
What an AS is · 2-byte and 4-byte ASNs · Path vector vs distance vector vs link state · eBGP vs iBGP · TCP 179 and collisions · The three RIBs · Real lab: split horizon · The UPDATE bytes · iBGP full mesh · Synchronization · Configuration examples · Common mistakes · FAQ
BGP fundamentals start with the autonomous system
BGP routes between autonomous systems, so the first thing to pin down is what an AS is. RFC 1930 gives the definition most operators work with: "An AS is a connected group of one or more IP prefixes run by one or more network operators which has a SINGLE and CLEARLY DEFINED routing policy."[2] Note what is missing from that definition: there is nothing about one company, one IGP or one router vendor. The word that matters is policy. Your AS is the unit that the rest of the Internet sees as making one set of routing decisions.
RFC 4271, the BGP-4 specification, describes the same thing from the inside. Routers in an AS use an IGP and common metrics among themselves, and an exterior protocol towards other ASes. To the outside, the AS has to look like it has "a single coherent interior routing plan".[1] The consequence for BGP is that the protocol knows two kinds of neighbours: "A peer in a different AS is referred to as an external peer, while a peer in the same AS is referred to as an internal peer."[1] The rest of this article follows from that sentence.
AS numbers: 2-byte, 4-byte, private and reserved
The original AS number was a 16-bit field, so 65,536 values. RFC 6793 (December 2012, replacing RFC 4893 from 2007) "expands the pool for AS numbers from 0-65535 to 0-4294967295".[3] The extension works without a new BGP version. A speaker announces the 4-octet AS capability in its OPEN message, and two new speakers then put 4-byte numbers straight into AS_PATH. Towards an old 2-byte speaker, a new speaker writes the reserved number 23456 (AS_TRANS) in the 2-byte fields and carries the real path in the optional transitive AS4_PATH attribute.[3] You will meet AS_TRANS in any capture where one side does not support 4-byte ASNs.
The special ranges come from several RFCs and are collected in IANA's special-purpose registry:[4]
| Range | Purpose | Source |
|---|---|---|
| 0 | Reserved | RFC 7607 |
| 23456 | AS_TRANS | RFC 6793 |
| 64496-64511 and 65536-65551 | Documentation and sample code | RFC 5398 |
| 64512-65534 | Private use (1,023 numbers) | RFC 6996 |
| 65535 and 4294967295 | Reserved, last number of each range | RFC 7300 |
| 4200000000-4294967294 | Private use (94,967,295 numbers) | RFC 6996 |
Private ASNs are the BGP version of RFC 1918 addresses: use them inside your network, for customers that only peer with you, or in a data-centre fabric. Strip them before routes reach the Internet. RFC 6996 notes that "normal AS path filtering MAY also be used to prevent prefixes originating from Private Use ASNs from being advertised to the global Internet."[4]
Real data: what the Internet actually uses
We asked RIPEstat's ris-asns call for every AS that originated a prefix seen by the RIPE RIS collectors. The answer, for the 16:00 UTC dump of 27 November 2026, was 88,156 origin ASNs:[17]
- 38,089 public 16-bit ASNs (43.2 %) and 49,755 public 32-bit ASNs (56.4 %). 4-byte ASNs are no longer exotic. They are the majority, so any tool, regex or database column that still assumes 16 bits is wrong for most of the Internet.
- 300 origins in the private ranges (251 in 64512-65534 and 49 in 4200000000+), plus 12 documentation or reserved numbers, among them 65535 and 64501. RIS peers with networks of all kinds and records what their full feeds contain, so these numbers show leaks that some network passed on. They are not routes that the whole Internet accepted. They also show that not everyone filters private ASNs.
If you want to check an origin AS yourself, our BGP Route Lookup tool shows the origin, AS paths and RPKI state of any prefix. Our post on BGP large communities covers the 4-byte ASN problem from the policy side.
Path vector vs distance vector vs link state
The protocols you meet first, RIP, OSPF and IS-IS, belong to two families:
- Distance vector (RIP): each router tells its neighbours "I can reach X at distance N". The metric is a hop count, and 16 means "infinity", or unreachable.[16] RIP runs over UDP port 520.[16] Loops are fought with split horizon, poison reverse and that small infinity, and they still happen.
- Link state (OSPF, IS-IS): each router floods a description of its own links, every router builds the same map and runs SPF on it. OSPF runs directly over IP protocol 89.[16] There is no loop as long as everybody has the same map. That works inside one domain, but not between companies that do not want to show each other their topology.
BGP is the third kind, path vector. It keeps the neighbour-to-neighbour model of distance vector, but a route carries the list of ASes it has crossed instead of a single number. RFC 1105 already explained why. This information is "sufficient to construct a graph of AS connectivity from which routing loops may be pruned and policy decisions at an AS level may be enforced."[20] RFC 4271 keeps the same wording: the AS list lets a speaker prune loops and enforce policy.[1]
Two practical consequences follow, and both surprise people coming from OSPF:
- Loop prevention is a membership test, not a metric. A router that finds its own AS number anywhere in a received AS_PATH ignores the route. No counting to infinity and no hold-down timers are needed. We showed this in a three-AS lab in part 1, and it gets its own part (AS_PATH, part 7).
- "Best" is a policy decision. In RFC 4271 the decision process first computes a degree of preference from local policy. Only between routes with equal preference do the tie-breakers apply: shortest AS_PATH, lowest ORIGIN, MED, eBGP over iBGP, IGP cost to the next hop and so on.[1] A long path that your policy prefers wins over a short one. Part 16 walks through every step of the algorithm.
Scale is the third difference. Geoff Huston counted 1,049,757 IPv4 entries in the default-free table in January 2026.[18] No link-state protocol floods that many entries, and no distance-vector protocol refreshes them every 30 seconds. BGP sends the full table once and then only changes (see the next sections).
eBGP vs iBGP: same protocol, different rules
Whether a session is eBGP or iBGP depends only on one comparison: is the peer's AS number (configured as remote-as, and confirmed in the peer's OPEN) the same as mine? Everything else in this section follows from that.
1. AS_PATH: prepended on eBGP, untouched on iBGP
RFC 4271 section 5.1.2 says that when a speaker advertises a route to an internal peer, it "SHALL NOT modify the AS_PATH attribute". Towards an external peer it prepends its own AS number. When it originates a route, it sends an empty AS_PATH to internal peers and a path containing just its own AS to external peers.[1] So inside an AS the path does not grow, and the loop check cannot work there. That is why iBGP needs a different loop rule (section 4 below).
2. NEXT_HOP: rewritten on eBGP, kept on iBGP
Section 5.1.3: "When sending a message to an internal peer, if the route is not locally originated, the BGP speaker SHOULD NOT modify the NEXT_HOP attribute unless it has been explicitly configured to announce its own IP address as the NEXT_HOP."[1] The route therefore arrives at internal routers with the address of the external neighbour as its next hop. If your IGP does not carry that address (the eBGP link subnet), the route is unusable. This is the most common reason for next-hop-self (Cisco, FRR: neighbor X next-hop-self).[14] Our post BGP NEXT_HOP Explained covers the troubleshooting side, and part 8 of this series covers the attribute in full.
3. LOCAL_PREF exists only inside the AS
LOCAL_PREF is the AS-wide preference for outbound traffic. A speaker includes it in UPDATEs to internal peers and does not send it to external peers (with a confederation exception). In our lab it shows up as {LocalPref: 100} on every iBGP-learned route and is absent on eBGP-learned ones; the bytes are in Figure 6.[1][19]
4. The iBGP rule: never pass an iBGP route to another iBGP peer
This is the rule behind the iBGP full mesh. RFC 4271 section 9.2: "When a BGP speaker receives an UPDATE message from an internal peer, the receiving BGP speaker SHALL NOT re-distribute the routing information contained in that UPDATE message to other internal peers (unless the speaker acts as a BGP Route Reflector [RFC2796])."[1] Many textbooks call it iBGP split horizon. The name fits only partly: RIP's split horizon blocks one interface, while this rule blocks a whole class of peers. Because AS_PATH does not change inside the AS, this rule is what stops iBGP loops. The section on the lab below shows it working.
5. TTL: eBGP expects a direct neighbour
RFC 4271 does not set a TTL, but implementations agree on the default. Junos: "If you omit this statement, all EBGP peers are assumed to be directly connected ... and the default time-to-live (TTL) value is 1." Junos uses 64 for multihop eBGP, confederation and iBGP sessions.[13] FRR: "When the neighbor is not directly connected and this knob [ebgp-multihop] is not enabled, the session will not establish."[14] Cisco's case-study document says the same and uses neighbor ... ebgp-multihop for external peers that are not directly connected.[10] iBGP peers, on the other hand, "do not need to have direct connection. But there must be some IGP that runs and allows the two neighbors to reach one another."[10] That is why iBGP is normally configured between loopbacks with update-source Loopback0. The interface address would make the session fail with the link.
GTSM (RFC 5082) turns the TTL idea into a security feature. Both sides send with TTL 255 and accept only packets that still carry 255, which a spoofed packet from further away cannot do. FRR implements it as neighbor PEER ttl-security hops N and notes that it is mutually exclusive with ebgp-multihop.[8][14]
6. Trust: eBGP wins ties and has the lower distance
Step d) of the RFC 4271 tie-breaking procedure: "If at least one of the candidate routes was received via EBGP, remove from consideration all routes that were received via IBGP."[1] When the same prefix is also learned by another protocol, Cisco's administrative distance decides between them: 20 for eBGP and 200 for iBGP, compared with 110 for OSPF.[12] The high iBGP distance is deliberate. If an IGP route and an iBGP route to the same prefix exist, the IGP route should win inside the AS.
7. RFC 8212: no policy, no routes (eBGP only)
Since RFC 8212 (2017), an implementation that follows it must not import or export routes on an eBGP session that has no policy configured. FRR enables bgp ebgp-requires-policy by default for traditional configurations: "Without the incoming filter, no routes will be accepted. Without the outgoing filter, no routes will be announced."[9][14] iBGP sessions are not affected. A new eBGP session that is Established but exchanges nothing is often this, not a bug. Our troubleshooting post Established but No Routes collects the other causes.
TCP port 179, who opens the session, and collisions
BGP runs over TCP. RFC 4271: "A BGP implementation MUST connect to and listen on TCP port 179 for incoming connections in addition to trying to connect to peers."[1] So both routers try to connect at once. One of them usually connects first, and the other then sees the incoming connection. If both connections complete, there is a connection collision. Section 6.8 resolves it with the BGP Identifier: "retain only the connection initiated by the BGP speaker with the higher-valued BGP Identifier." A collision with a session that is already Established closes the new connection, unless configuration allows otherwise.[1] The Identifier is the 4-byte router ID carried in OPEN. This is one reason two routers with the same router ID cannot peer.
You can see who opened each session on any Linux BGP speaker. In our lab every router listens on port 10179 instead of 179, so it can run without root. The side with the random high port is the one that sent the SYN:[19]
$ ss -tn state established '( sport = :10179 or dport = :10179 )' (GoBGP 4.11 lab, 28 Nov 2026)
Local Address:Port Peer Address:Port
127.0.2.22:60079 127.0.2.21:10179 <- r2 opened the eBGP session to r1
127.0.2.22:55047 127.0.2.23:10179 <- r2 opened the iBGP session to r3
127.0.2.23:53097 127.0.2.24:10179 <- r3 opened the iBGP session to r4
127.0.2.25:40261 127.0.2.24:10179 <- r5 opened the eBGP session to r4
There is exactly one connection per pair. With GoBGP's passive-mode you tell one side never to dial out; other implementations have equivalent knobs, and our lab uses it for the Python peers. Once the session is up, the two speakers exchange the full table once and then only changes. They send KEEPALIVEs so that the Hold Timer does not expire. RFC 4271 suggests a 90 s hold time, with keepalives at one third of it.[1] GoBGP uses exactly that ("Hold time is 90, keepalive interval is 30 seconds" in our output). Cisco IOS defaults to 60 s keepalive and 180 s hold time.[15] The smaller of the two proposed hold times wins.[1] The full state machine is part 4, and the messages byte by byte are part 3. Our older BGP Active state troubleshooting post covers what to check when TCP 179 never comes up.
Adj-RIB-In, Loc-RIB and Adj-RIB-Out
RFC 4271 section 3.2 splits the BGP routing information base into three parts:[1]
- Adj-RIBs-In (one per peer): "routing information learned from inbound UPDATE messages ... Their contents represent routes that are available as input to the Decision Process." These are the routes before your inbound policy.
- Loc-RIB: "the local routing information the BGP speaker selected by applying its local policies to the routing information contained in its Adj-RIBs-In." And: "The next hop for each of these routes MUST be resolvable via the local BGP speaker's Routing Table."
- Adj-RIBs-Out (one per peer): what "the local BGP speaker selected for advertisement to its peers", after outbound policy.
Two details are often missed. First, the RFC says this "neither implies nor requires that an implementation must maintain three separate copies".[1] Many routers do not keep the pre-policy Adj-RIB-In, to save memory. That is why FRR and Cisco have soft-reconfiguration inbound, which stores "all received route updates (including those that are rejected by inbound policy) in an unmodified form". Without it, a router needs the peer to resend everything (route refresh) before a new inbound policy can take effect.[14] Part 24 covers soft reset, route refresh and ORF. Second, the Loc-RIB is not the forwarding table. Whether a BGP route goes into the routing table, and whether it beats a route from another protocol, "is a local policy decision". In practice it is the administrative distance from the previous section.[1]
Our lab makes the split visible. Router r5 (AS 65003) has an import policy that rejects 203.0.113.0/24. Its Adj-RIB-In from r4 holds both prefixes, but its Loc-RIB holds only the one that passed policy:[19]
$ gobgp neighbor 127.0.2.24 adj-in -a ipv4 (on r5, GoBGP 4.11 lab output)
ID Network Next Hop AS_PATH Age Attrs
0 198.51.100.0/24 127.0.2.24 65002 65001 00:00:05 [{Origin: i}]
0 203.0.113.0/24 127.0.2.24 65002 65001 00:00:05 [{Origin: i}]
$ gobgp global rib -a ipv4 (on r5)
Network Next Hop AS_PATH Age Attrs
*> 198.51.100.0/24 127.0.2.24 65002 65001 00:00:05 [{Origin: i}]
Real lab: iBGP split horizon, before and after the full mesh
The lab uses five GoBGP 4.11 daemons on loopback addresses 127.0.2.21-25. r1 is in AS 65001 and originates two documentation prefixes, 198.51.100.0/24 and 203.0.113.0/24. r2, r3 and r4 form AS 65002, with eBGP to r1 on r2 and to r5 (AS 65003) on r4. r3 runs only iBGP. Everything is real BGP over TCP. The one shortcut is that GoBGP without a FIB integration treats every next hop as reachable, so this lab shows the control plane only.[19]
Phase A: a chain r2 - r3 - r4 (no full mesh)
All sessions are Established. r2 receives both prefixes from r1 and passes them to its only iBGP peer, r3. Look at what r3 holds and what it sends on:
$ gobgp global rib -a ipv4 (on r3, phase A)
Network Next Hop AS_PATH Age Attrs
*> 198.51.100.0/24 127.0.2.21 65001 00:00:05 [{Origin: i} {LocalPref: 100}]
*> 203.0.113.0/24 127.0.2.21 65001 00:00:05 [{Origin: i} {LocalPref: 100}]
$ gobgp neighbor 127.0.2.24 adj-out -a ipv4 (on r3: what r3 sends to r4)
Network not in table
$ gobgp global rib -a ipv4 (on r4 and on r5)
Network not in table
Three rules appear in this short output. The next hop on r3 is 127.0.2.21, r1's address, not r2's: NEXT_HOP is kept over iBGP. The AS_PATH is still just 65001: r2 did not prepend 65002 because the peer is internal. LocalPref 100 was added for the iBGP session. Most importantly, r3 has the best routes in its Loc-RIB and still sends nothing to r4. Its Adj-RIB-Out towards r4 is empty, because the routes came from an internal peer and r4 is an internal peer. The rest of AS 65002 and everything behind r4 never learn the prefixes. The routers report no error: every session is Established and the routes are simply missing. This is the scenario from the opening paragraph.
Phase B: add the r2 - r4 session
Same configs plus one iBGP neighbour on r2 and r4. Now r2 tells r4 directly, and r4 passes the routes to its eBGP neighbour, prepending its AS and setting itself as next hop:
$ gobgp neighbor (on r4, phase B)
Peer AS Up/Down State |#Received Accepted
127.0.2.22 65002 00:00:11 Establ | 2 2
127.0.2.23 65002 00:00:11 Establ | 0 0
127.0.2.25 65003 00:00:11 Establ | 0 0
$ gobgp neighbor 127.0.2.25 adj-out -a ipv4 (on r4: what r4 sends to r5)
ID Network Next Hop AS_PATH AttrsFiltered
1 198.51.100.0/24 127.0.2.24 65002 65001 [{Origin: i}]not filtered
1 203.0.113.0/24 127.0.2.24 65002 65001 [{Origin: i}]not filtered
Note the line for r3 on r4: received 0. Even with the full mesh, r3 still never passes the routes to r4. It does not have to, because r4 now hears them from the source of the information, r2. In a full mesh every iBGP speaker learns external routes straight from the border router that learned them. That is the design: no iBGP speaker ever relays for another.
The same route on the wire: iBGP vs eBGP UPDATE bytes
To see the rules in the protocol itself, we configured two passive neighbours on r2 and connected to it from a small Python script, once as AS 65002 (iBGP) and once as AS 65099 (eBGP). The script sends an OPEN and a KEEPALIVE and records every byte it receives.[19] The two UPDATE messages for the same two prefixes:
iBGP, 58 bytes:
ffffffffffffffffffffffffffffffff 003a 02 0000 001b
40 01 01 00 ORIGIN IGP
40 02 06 02 01 0000fde9 AS_PATH AS_SEQUENCE [65001]
40 03 04 7f000215 NEXT_HOP 127.0.2.21
40 05 04 00000064 LOCAL_PREF 100
18 c63364 18 cb0071 198.51.100.0/24, 203.0.113.0/24
eBGP, 55 bytes:
ffffffffffffffffffffffffffffffff 0037 02 0000 0018
40 01 01 00 ORIGIN IGP
40 02 0a 02 02 0000fdea 0000fde9 AS_PATH AS_SEQUENCE [65002 65001]
40 03 04 7f000216 NEXT_HOP 127.0.2.22
18 c63364 18 cb0071 198.51.100.0/24, 203.0.113.0/24
Reading the bytes: every attribute starts with a flags byte (0x40 = well-known, transitive), a type code and a length. The AS_PATH segment type 02 is AS_SEQUENCE, followed by the number of ASes and then 4 bytes per AS. They are 4 bytes because both sides advertised the 4-octet AS capability, so 0000fdea is 65002 and 0000fde9 is 65001.[3] The eBGP version is three bytes shorter. It gains 4 bytes of AS number in AS_PATH and loses the 7-byte LOCAL_PREF attribute, so 58 + 4 - 7 = 55. The NLRI at the end is identical: a prefix length (0x18 = 24) followed by only the significant bytes of the prefix.
One more detail from the same capture: r2's OPEN to the iBGP peer was 85 bytes and its OPEN to the eBGP peer 70 bytes. The difference is capability code 75, Software Version (an IETF draft registered at IANA), carrying the string GoBGP/4.11.0.[21] In our capture GoBGP sent it only on the internal session, which makes sense: you rarely want to tell an external peer which software and version you run. Part 3 decodes all message types.
Why the iBGP full mesh does not scale
The iBGP re-advertisement rule has a direct cost. If no iBGP speaker may relay, every iBGP speaker must hear every external route from the border router that learned it, so every iBGP speaker must peer with every border router. Since in practice any router may become a border router, the result is a full mesh. RFC 4271 puts the assumption in its overview: a consistent view of external routes is provided "by having all BGP speakers within the AS maintain IBGP with each other".[1] Cisco's case-study document gives the same advice: "sustain a full mesh between the iBGP speakers within an AS."[10]
A full mesh of n routers needs n(n-1)/2 sessions: 10 for 5 routers, 190 for 20, 4,950 for 100 and 19,900 for 200. The session count is only part of the cost. Each router has n-1 sessions, each with its own Adj-RIB-In and Adj-RIB-Out. Adding one router means changing the configuration of every existing router. RFC 4456 puts it bluntly: the full mesh requirement "clearly does not scale when there are a large number of IBGP speakers".[6] There are two standard ways out, each with its own part in this series:
- Route reflectors (RFC 4456): a route reflector is allowed to pass iBGP routes to its clients. Loops are prevented with ORIGINATOR_ID and CLUSTER_LIST instead of AS_PATH. In the RFC's words, "The Non-Client peer must be fully meshed but the Client peers need not be fully meshed."[6] See our route reflector test diagram post and parts 14, 15 and 19 of this series.
- Confederations (RFC 5065): split the AS into sub-ASes that use eBGP-like sessions between them, while the outside world still sees one AS. Part 20.[7]
BGP synchronization: what it required and why it is gone
Synchronization is a rule from the time when transit ASes did not run BGP on every router. Picture AS 200 in Figure 8. Border routers RTA and RTB run BGP with each other over an iBGP session between loopbacks, but the core router RTE between them runs only OSPF. RTA learns 172.16.10.0/24 from AS 100 and tells RTB over iBGP. RTB advertises the prefix to AS 400, and AS 400 starts sending traffic. The packets reach RTB, which forwards them towards the next hop through RTE. RTE has never heard of 172.16.10.0/24 and drops them.[10]
RFC 1772, the 1995 companion to BGP-4, describes the problem as a timing window. There is a moment when border gateway A has new BGP information from border gateway B, but the IGP cannot yet route transit traffic to B, "During that time window, either incorrect routing or 'black holes' can occur." Its answer: "interior routing should converge on the proper exit gateway before advertising routes via that exit gateway to external peers."[5] Cisco's version of the rule: "if your AS passes traffic from another AS to a third AS, BGP must not advertise a route before all the routers in your AS have learned about the route via IGP."[10]
How it worked in practice
With synchronization on, Cisco IOS would not consider an iBGP-learned path valid unless the same prefix was in the IP routing table from the IGP. RFC 1772 also describes "tagged" IGPs that carry the exit router's identity. Cisco's version has a twist: "If the route that matches is learned from an Open Shortest Path First (OSPF) neighbor, its OSPF router ID must match the BGP router ID of the iBGP neighbor."[11] So the only way to satisfy the rule was to redistribute BGP routes into the IGP. That was fine for a few hundred prefixes, and impossible for an Internet table that now exceeds a million.[18] Hence the familiar no synchronization line in every 1990s and 2000s configuration.
What replaced it
RFC 1772 already listed the alternatives in 1995. Encapsulation ("no synchronization between BGP and the IGP is required") and pervasive BGP: "If all routers in an AS are BGP speakers, then there is no need to have any interaction between BGP and an IGP." Routers then do a recursive lookup, first the BGP route to find the exit router, then the IGP route to that router.[5] Today's networks use exactly those two answers:
- BGP on every router in the transit path, made practical by route reflectors, so that the core does not need a full mesh.
- An MPLS (or SR, or IP tunnel) core, which is the modern form of RFC 1772's encapsulation. Core routers forward on a label towards the exit PE's loopback and need no external routes at all. This BGP-free core is covered in our MPLS & EVPN series.
Cisco made the change official: "Synchronization is disabled by default in Cisco IOS Software Release 12.2(8)T and later."[11] The same document also lists "paths that are marked as not synchronized" among the paths the best-path algorithm ignores.[11] Cisco's own case study says you can disable it if your AS does not carry transit traffic "or if all routers in your autonomous systems are running BGP".[10] Modern stacks do not have the knob: FRR's BGP documentation contains no synchronization command.[14] If you meet synchronization in an exam question or an old router today, the right reading is: "this AS has a non-BGP core, and the network relies on the IGP carrying the external routes". That design should be fixed, not copied.
Configuration examples: eBGP, iBGP over loopbacks, multihop
These are configuration examples in each vendor's documented syntax, not output from our lab. The addresses are from documentation ranges.
! Cisco IOS / IOS XE: eBGP to a direct neighbour, iBGP to a loopback
router bgp 64500
bgp router-id 192.0.2.1
neighbor 203.0.113.2 remote-as 64511 ! eBGP, directly connected (TTL 1)
neighbor 192.0.2.2 remote-as 64500 ! iBGP, loopback of the other PE
neighbor 192.0.2.2 update-source Loopback0
neighbor 192.0.2.2 next-hop-self ! external next hops not in the IGP
address-family ipv4 unicast
neighbor 203.0.113.2 activate
neighbor 192.0.2.2 activate
neighbor 203.0.113.2 route-map FROM-UPSTREAM in
neighbor 203.0.113.2 route-map TO-UPSTREAM out
exit-address-family
# Junos: one eBGP group, one iBGP group (internal = same AS as routing-options)
routing-options { autonomous-system 64500; router-id 192.0.2.1; }
protocols bgp {
group upstream {
type external;
peer-as 64511;
neighbor 203.0.113.2; # TTL 1 unless 'multihop' is configured
import FROM-UPSTREAM;
export TO-UPSTREAM;
}
group ibgp {
type internal;
local-address 192.0.2.1; # loopback
export NEXT-HOP-SELF; # policy with 'then next-hop self'
neighbor 192.0.2.2;
}
}
! FRR: eBGP between loopbacks of two directly connected routers
router bgp 64500
neighbor 198.51.100.2 remote-as 64511
neighbor 198.51.100.2 update-source lo
neighbor 198.51.100.2 disable-connected-check ! or: ebgp-multihop 2
address-family ipv4 unicast
neighbor 198.51.100.2 route-map IN in ! RFC 8212: required on eBGP
neighbor 198.51.100.2 route-map OUT out
exit-address-family
FRR's disable-connected-check allows "peerings between directly connected eBGP peers using loopback addresses" while keeping TTL 1. ebgp-multihop raises the TTL instead.[14] On Junos, the documentation notes that "A TTL value of 1 is sufficient to enable an EBGP session to the loopback address of a directly connected neighbor" when you use multihop with an explicit ttl 1.[13]
Common mistakes and how to spot them
| Symptom | Likely cause | Check |
|---|---|---|
| iBGP Established, some routers have no external routes | No full mesh and no route reflector: the iBGP rule (RFC 4271 s.9.2) | Adj-RIB-Out on the router in the middle is empty for its iBGP peers, as in our phase A |
| Routes present but not best / not installed | NEXT_HOP of the external peer not in the IGP | show ip bgp <prefix> shows the next hop as inaccessible; add next-hop-self or carry the link in the IGP |
| eBGP between loopbacks stuck in Active/Idle | TTL 1 default | Configure ebgp-multihop / multihop / disable-connected-check; check the route to the peer's loopback |
| iBGP flaps when one link fails | Peering on interface addresses | Use loopbacks and update-source |
| New eBGP session exchanges nothing | RFC 8212 behaviour (no policy) | FRR shows "(Policy)" in the summary; attach route-maps in and out |
| Session refuses to come up, NOTIFICATION about AS | remote-as does not match the peer's OPEN, or a 4-byte ASN towards a 2-byte-only peer | Compare the ASN in the OPEN; look for AS_TRANS 23456 in the peer's view |
| Private ASNs visible upstream | No remove-private-as / AS-path filter on the edge | Filter 64512-65534 and 4200000000-4294967294 outbound; 300 origins in RIS show this happens |
| Legacy IOS: iBGP route marked "not synchronized" | synchronization still on | no synchronization (default since 12.2(8)T), after making sure the core can forward |
For a wider checklist of "Established but missing" problems see BGP Troubleshooting: Established but No Routes. Our much shorter 2013 note BGP eBGP vs iBGP and the 2011 BGP Neighbor States are the older versions of this material. This article replaces them with RFC detail and lab evidence.
FAQ
What is the difference between eBGP and iBGP?
eBGP runs between routers in different autonomous systems, iBGP between routers in the same AS. The protocol and messages are identical, but the rules differ: over eBGP the sender prepends its AS to AS_PATH and sets NEXT_HOP to itself; over iBGP both stay unchanged, LOCAL_PREF is added, and a route learned from one iBGP peer is never passed to another iBGP peer.
Why does iBGP need a full mesh?
RFC 4271 forbids a BGP speaker from re-advertising a route learned from an internal peer to other internal peers (unless it is a route reflector). Inside an AS the AS_PATH does not change, so it cannot detect loops; this rule replaces it. The price is that every iBGP speaker must peer with every other one: n(n-1)/2 sessions.
What was the BGP synchronization rule?
A router must not use or advertise to eBGP peers a route learned via iBGP until the same prefix is also known from the IGP. It protected transit ASes whose core routers did not run BGP from black-holing traffic. Cisco IOS turned it off by default in 12.2(8)T; modern networks run BGP on every router in the transit path or use an MPLS core instead.
Which TCP port does BGP use, and who opens the session?
TCP port 179. Each speaker both listens on 179 and tries to connect to its peer. If both connections succeed at the same time, the collision is resolved by keeping the connection opened by the speaker with the higher BGP Identifier (RFC 4271 section 6.8).
What are Adj-RIB-In, Loc-RIB and Adj-RIB-Out?
Adj-RIB-In holds the routes each peer sent, before inbound policy. Loc-RIB holds the best routes the router selected after policy and the decision process. Adj-RIB-Out holds what the router will advertise to each peer after outbound policy. RFC 4271 says this is a conceptual model; an implementation need not keep three copies.
Which AS numbers are private?
64512 to 65534 in the 2-byte range and 4200000000 to 4294967294 in the 4-byte range (RFC 6996). 64496-64511 and 65536-65551 are for documentation (RFC 5398), 23456 is AS_TRANS (RFC 6793), and 0, 65535 and 4294967295 are reserved.
Why is eBGP TTL 1 by default?
Because eBGP peers are normally directly connected. Cisco, Junos and FRR all expect a directly connected external peer unless you configure ebgp-multihop (Cisco, FRR) or multihop (Junos). GTSM (RFC 5082) inverts the idea: send with TTL 255 and accept only packets that still have 255.
Series hub: BGP Deep Dive: The Complete Guide in 26 Parts (2026)
Previous: BGP History: From EGP and the Napkins to BGP-4 Today
Next: BGP Message Types: OPEN, UPDATE, NOTIFICATION Byte by Byte
References (all read on 28 November 2026)
[1] Y. Rekhter, T. Li, S. Hares (eds.), "RFC 4271: A Border Gateway Protocol 4 (BGP-4)," January 2006: sections 3, 3.2, 5.1.2, 5.1.3, 6.8, 8, 9.1.2.2, 9.2, 10.
[2] J. Hawkinson, T. Bates, "RFC 1930: Guidelines for creation, selection, and registration of an Autonomous System (AS)," March 1996.
[3] Q. Vohra, E. Chen, "RFC 6793: BGP Support for Four-Octet Autonomous System (AS) Number Space," December 2012.
[4] RFC 6996 (Private Use ASNs, 2013), RFC 7300 (last ASNs, 2014), RFC 5398 (documentation ASNs, 2008); IANA AS Numbers (updated 2026-06-01) and Special-Purpose AS Numbers registries.
[5] Y. Rekhter, P. Gross, "RFC 1772: Application of the Border Gateway Protocol in the Internet," March 1995, appendix A.
[6] T. Bates, E. Chen, R. Chandra, "RFC 4456: BGP Route Reflection: An Alternative to Full Mesh Internal BGP (IBGP)," April 2006.
[7] P. Traina, D. McPherson, J. Scudder, "RFC 5065: Autonomous System Confederations for BGP," August 2007.
[8] V. Gill et al., "RFC 5082: The Generalized TTL Security Mechanism (GTSM)," October 2007.
[9] J. Mauch, J. Snijders, G. Hankins, "RFC 8212: Default External BGP (EBGP) Route Propagation Behavior without Policies," July 2017.
[10] Cisco, "Examine Border Gateway Protocol Case Studies," document 26634, updated 8 June 2023 (eBGP and iBGP, ebgp-multihop, full mesh, synchronization).
[11] Cisco, "Select BGP Best-path Algorithm," document 13753.
[12] Cisco, "Understand Administrative Distance," document 15986, updated 20 July 2026.
[13] Juniper Networks / HPE, Junos OS "multihop" statement and "BGP Multihop Sessions".
[14] FRRouting, "BGP" user documentation (latest): ebgp-multihop, disable-connected-check, ttl-security, ebgp-requires-policy, soft-reconfiguration inbound, next-hop-self, route reflectors.
[15] Cisco, "Configuring BGP," Catalyst 9500 IOS XE 16.9 configuration guide (default BGP configuration: keepalive 60 s, hold time 180 s).
[16] G. Malkin, "RFC 2453: RIP Version 2," November 1998; J. Moy, "RFC 2328: OSPF Version 2," April 1998.
[17] RIPE NCC, RIPEstat Data API, ris-asns (originating ASNs, dump of 27 November 2026 16:00 UTC), queried by Network freak on 28 November 2026.
[18] G. Huston, "BGP in 2025," APNIC Blog, 8 January 2026.
[19] Network freak lab: five GoBGP 4.11 routers on loopback addresses 127.0.2.21-25 (phase A partial mesh, phase B full mesh) and a Python socket peer that recorded the OPEN and UPDATE bytes, 28 November 2026, 00:18-00:20 UTC.
[20] K. Lougheed, Y. Rekhter, "RFC 1105: A Border Gateway Protocol (BGP)," June 1989.
[21] IANA, "Capability Codes": 75 = Software Version Capability (draft-abraitis-bgp-version-capability).
Figures 1-8: Network freak, drawn from the sources above and our own lab and RIPEstat queries.
Try it: BGP Route Lookup: origin AS, AS paths and RPKI check - free, runs in your browser. Also try: CIDR to IP Range - free, runs in your browser.
Related reading
- BGP Troubleshooting: Established but No Routes, RIB-Failure and Missing Advertisements
- BGP NEXT_HOP Explained: Next-Hop Reachability, next-hop-self and Troubleshooting
- BGP Route Reflectors: Scaling iBGP with a Simple Test Diagram
- BGP Active State Troubleshooting: TCP 179, Source IP and TTL
- BGP eBGP vs iBGP
Comments
Post a Comment