Why do we peer iBGP between loopbacks, and what does that need?
Show the answer
Say this first
A loopback interface never goes down while the router has any path to it, so an iBGP session between
loopbacks survives the loss of a single link as long as the IGP finds another way. It needs three things:
the loopbacks advertised in the IGP, neighbor x update-source Loopback0 so TCP is sourced from the loopback,
and each side's neighbor statement pointing at the other side's loopback address.
Go deeper
interface Loopback0
ip address 10.255.0.1 255.255.255.255
!
router ospf 1
router-id 10.255.0.1
network 10.255.0.1 0.0.0.0 area 0
network 10.0.0.0 0.0.255.255 area 0
!
router bgp 64500
bgp router-id 10.255.0.1
neighbor 10.255.0.2 remote-as 64500
neighbor 10.255.0.2 update-source Loopback0R2 mirrors this with its own loopback 10.255.0.2 and neighbor 10.255.0.1.
Why it fails without update-source
TCP takes its source address from the outgoing interface, say 10.0.12.1. R2 only has a neighbor statement for 10.255.0.1, so it treats the SYN as coming from a stranger and resets it.
eBGP is different
eBGP between loopbacks also needs ebgp-multihop 2 or disable-connected-check, and a static route to the
peer's loopback, because you do not share an IGP with another AS.
They will ask next
How does BGP choose its router ID?
On IOS: the configured
bgp router-id, otherwise the highest IP on a loopback, otherwise the highest IP on an active interface. Always set it explicitly, so it never changes when interfaces change.Do loopbacks remove the need for next-hop-self?
No, they solve a different problem. Loopbacks keep the session up; next-hop-self fixes the external next hop on eBGP-learned routes. Edge routers usually need both.
Traps
- Forgetting to advertise the loopback in the IGP. The session cannot come up without a route to it.