BGP · Topic 4 of 7
Multihop Sessions and Loopback Peering
Learn when iBGP and eBGP peers use loopback addresses, how multihop and update source work, and why parallel links need routes to the loopback.
- 4 min
- Loopback peering keeps a session up if one of several links fails.
- A loopback is often a /32 address on a bridge with no ports.
- Each side needs a route to the other loopback.
What it is
A loopback session is a BGP session between addresses that are not tied to one physical link.
Peering between loopbacks lets the session survive the failure of any single link, as long as another path to the loopback exists. It also lets traffic use several links at once.
For eBGP, loopback peers are usually more than one hop apart, so the session must be allowed to cross routers. That option is called multihop.
How it works
The loopback address must exist, be reachable, and be used as the source of the session on both sides.
Creating a loopback address
A common method on RouterOS is a bridge with no ports, which stays up, and a host address on it.
/interface bridge add name=lo
/ip address add address=10.255.255.1/32 interface=lo
A /32 prefix is used because only one address is needed. The router ID is often set to this same address.
Reachability of the loopback
The loopback of the remote router is not a connected network. Each side needs a route to it.
- Inside one AS, an interior protocol such as OSPF normally carries the loopbacks.
- Between two ASes, static routes to the remote loopback are used, one for each link.
With two static routes of the same distance toward the remote loopback, traffic can be shared across both links. If one link fails, the remaining route keeps the session up.
/ip route add dst-address=10.255.255.2/32 gateway=192.0.2.2
/ip route add dst-address=10.255.255.2/32 gateway=198.51.100.2
Update source
When a router opens a BGP connection, it picks a source address. For a loopback session, that address must be the loopback, otherwise the remote peer sees an unexpected source and rejects the session.
/routing bgp peer add name=ebgp-b remote-address=10.255.255.2 remote-as=200 multihop=yes update-source=lo
remote-addressis the loopback of the other router.update-sourcenames the interface or address used as the local source.multihop=yesallows an eBGP peer that is not directly connected.
The other router needs the mirror image. Its remote-address is your loopback, and its update-source is its own loopback. If one side is missing the setting, the session stays in Connect or Active.
Why eBGP needs multihop
By default, eBGP packets are sent with a TTL of 1, so they die after one router. This is correct for directly connected peers, and it protects against remote spoofing.
A loopback peer is not on the connected subnet, so the packet would have to cross a router, and the TTL would stop it. With multihop=yes the session is allowed to travel further.
iBGP does not have this limit. Its packets already travel across the AS, so iBGP loopback peering needs no multihop option, only reachability and an update source.
| Peer type | Directly connected | Loopback peering |
|---|---|---|
| iBGP | No special setting | Route to loopback and update source |
| eBGP | No special setting | Multihop, route to loopback and update source |
If a loopback session sits in Connect, test with ping from the loopback as the source address before changing BGP settings.
What to remember for the exam
Seven facts cover most questions here.
- Loopback peering keeps a session up if one of several links fails.
- A loopback is often a /32 address on a bridge with no ports.
- Each side needs a route to the other loopback.
update-sourcesets the local source address of the session.- Both ends must use matching loopback addresses.
- eBGP uses TTL 1 by default, so peers that are not directly connected need
multihop=yes. - iBGP loopback peering needs reachability and an update source, but not multihop.
A session between loopbacks has no connected route. Without a route to the remote loopback, it will never establish.
Common mistakes
These four errors are the usual ones.
No route to the remote loopback. The ping fails, and the session stays in Connect.
Forgetting update-source. The packets leave with the address of the exit interface, and the remote peer does not recognise them.
Setting multihop on only one side. Both routers must allow the session to cross routers.
Using multihop on a directly connected eBGP session out of habit. It is not needed there, and it removes the one hop protection.
Check yourself
Work through these three questions.
Why does an eBGP loopback session need
multihop=yes?eBGP packets are sent with a TTL of 1 by default, so they would not survive a router between the loopbacks. Multihop lets the session cross routers.
What does
update-sourcedo?It sets the interface or address that the router uses as the source of the BGP session. For loopback peering it must be the loopback.
How can two parallel links be used for one eBGP loopback session?
Add a static route to the remote loopback over each link. Traffic can then use both links, and the session survives if one fails.
Topic 4 of 7 in BGP
Test yourself on BGP
The full MikroTik MTCINE question bank has 475 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by MikroTik. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.