iBGP between loopbacks
With the loopbacks reachable, each router opens an Internal BGP (iBGP) session to the loopback of every other router: a full mesh. Three routers need three sessions. The mesh is needed because an iBGP router never passes a route learnt from one iBGP peer on to another (that's iBGP's loop prevention, since the AS path doesn't change inside your AS). So every router has to hear every route first-hand.
A peer group keeps the configuration short. Settings shared by every internal neighbor live on the group, and each neighbor just joins it:
remote-as internal: the neighbor is in our own AS, so this is iBGP.update-source: open the session from our loopback. The neighbor is configured to expect our loopback address, and would reject a connection from a link address.soft-reconfiguration inbound, as before.
core1 originates our prefixes. It has the blackhole for the /24 aggregate and the connected /25, and announces both into iBGP. The edges will pass the aggregate to the outside world, and use the /25 to send inbound traffic to core1. Originating the aggregate at the core has a useful side effect: if an edge loses every path to the core, the aggregate disappears from that edge and it stops attracting traffic it couldn't deliver.
set protocols bgp system-as '64500'
set protocols bgp parameters router-id '198.51.100.241'
set protocols bgp peer-group IBGP remote-as 'internal'
set protocols bgp peer-group IBGP update-source '198.51.100.241'
set protocols bgp peer-group IBGP address-family ipv4-unicast soft-reconfiguration inbound
set protocols bgp neighbor 198.51.100.242 peer-group 'IBGP'
set protocols bgp neighbor 198.51.100.242 description 'edge1'
set protocols bgp neighbor 198.51.100.243 peer-group 'IBGP'
set protocols bgp neighbor 198.51.100.243 description 'edge2'
set protocols static route 198.51.100.0/24 blackhole
set protocols static route 198.51.100.0/24 description 'Anchor our aggregate; discard unused space'
set protocols bgp address-family ipv4-unicast network 198.51.100.0/24
set protocols bgp address-family ipv4-unicast network 198.51.100.0/25- Lines 3–5: The peer group: everything every internal neighbor has in common.
- Line 3:
internal= same AS as ours, so iBGP. - Line 4: Source the session from our loopback.
- Lines 6–9: Each neighbor is a loopback address, joined to the group.
- Lines 10–13: The blackhole for the aggregate moves to core1, with the network statements.
set protocols bgp system-as '64500'
set protocols bgp parameters router-id '198.51.100.242'
set protocols bgp peer-group IBGP remote-as 'internal'
set protocols bgp peer-group IBGP update-source '198.51.100.242'
set protocols bgp peer-group IBGP address-family ipv4-unicast soft-reconfiguration inbound
set protocols bgp neighbor 198.51.100.241 peer-group 'IBGP'
set protocols bgp neighbor 198.51.100.241 description 'core1'
set protocols bgp neighbor 198.51.100.243 peer-group 'IBGP'
set protocols bgp neighbor 198.51.100.243 description 'edge2'- Line 4: The same pattern, with edge1's own loopback as the source.
- Lines 6–9: Sessions to core1 and to edge2: every router peers with every other.
Check your understanding
edge1 learns the default route from the upstream. Without a route reflector, can edge2 learn it from core1?
- Yes, core1 passes it on
- No; edge2 must learn it directly from edge1 over their own iBGP session
- Only if core1 has next-hop-self
- Only through OSPF