Juniper Labs Routing iBGP (lrc,lr1,lr2)
Explanation
Here we should have some explanation in order to understand the whole config.
Please check here for routing topology.
LR1 and LR2 configuration is very straightforward; we added them to AS65501 iBGP with a BGP group and exported loopback networks via prefix-list and policy-statement.
LRC is our “hero” and some important configurations happen here. Let’s see them:
- Route Reflector (RR): LRC will act as iBGP Route Reflector. The key setting is
cluster cluster_id
; the rest of its iBGP group config mirrors LR1 and LR2. - Pure iBGP: We use a
prefix-list ibgp-export
to keep AS 65501 pure iBGP (no OSPF between iBGP neighbors). - Export Connected Networks: That prefix-list exports all connected networks from the other logical systems into iBGP so LR1 and LR2 learn next-hops for loopbacks via iBGP (via
policy-statement ibgp-export term export-lo
) plus the LRC loopback. - Route Exchange:
policy-statement ibgp-export
andpolicy-statement ospf-export
exchange routes between OSPF and iBGP.- ACX1100 receives LR1/LR2 loopbacks via OSPF externals and vice versa.
- Direct Networks to OSPF: We filter and export direct-connected networks from LRC into OSPF (
protocol direct
+route-filter
) so ACX1100 knows how to reach LR1/LR2 loopbacks.
If everything is configured correctly:
- ACX1100 will know all AS 65501 networks and how to reach them.
- LR1 & LR2 will know all AS 65501 networks and ACX1100 networks (learned via OSPF).
- All nodes will have full Internet access (via NAT).
iBGP Configuration: LR1, LR2 & LRC Route Reflector
Here we explain the key configuration steps for iBGP in AS 65501.
1. LR1 & LR2 Configuration
LR1
# Set local AS and create iBGP group
set protocols bgp local-as 65501
set protocols bgp group iBGP-peers type internal
set protocols bgp group iBGP-peers neighbor 10.0.1.2
set protocols bgp group iBGP-peers export ibgp-export
# Advertise LR1 loopback
set policy-options prefix-list ibgp-export 100.1.1.1/32
set policy-options policy-statement ibgp-export term export-lo from prefix-list ibgp-export
set policy-options policy-statement ibgp-export term export-lo then accept
LR2
# Set local AS and create iBGP group
set protocols bgp local-as 65501
set protocols bgp group iBGP-peers type internal
set protocols bgp group iBGP-peers neighbor 10.0.2.2
set protocols bgp group iBGP-peers export ibgp-export
# Advertise LR2 loopback
set policy-options prefix-list ibgp-export 100.2.2.2/32
set policy-options policy-statement ibgp-export term export-lo from prefix-list ibgp-export
set policy-options policy-statement ibgp-export term export-lo then accept
2. LRC: iBGP Route Reflector
# 2.1. BGP & Route Reflector
set protocols bgp local-as 65501
set protocols bgp group iBGP-peers type internal
set protocols bgp group iBGP-peers neighbor 10.0.1.1
set protocols bgp group iBGP-peers neighbor 10.0.2.1
set protocols bgp group iBGP-peers export ibgp-export
set protocols bgp group iBGP-peers cluster 100.1.2.3 # RR cluster-ID
# 2.2. Prefix-list for local & connected networks
set policy-options prefix-list ibgp-export 10.0.0.0/30
set policy-options prefix-list ibgp-export 10.0.1.0/30
set policy-options prefix-list ibgp-export 10.0.2.0/30
set policy-options prefix-list ibgp-export 100.1.2.3/32
# 2.3. Export local & connected to iBGP
set policy-options policy-statement ibgp-export term export-lo from prefix-list ibgp-export
set policy-options policy-statement ibgp-export term export-lo then accept
# 2.4. Import OSPF into iBGP
set policy-options policy-statement ibgp-export term from-ospf from protocol ospf
set policy-options policy-statement ibgp-export term from-ospf then accept
# 2.5. Export BGP into OSPF
set policy-options policy-statement ospf-export term from-bgp from protocol bgp
set policy-options policy-statement ospf-export term from-bgp then accept
# 2.6. Export direct-connected into OSPF
set policy-options policy-statement ospf-export term from-direct from protocol direct
set policy-options policy-statement ospf-export term from-direct from route-filter 10.0.1.0/30 exact
set policy-options policy-statement ospf-export term from-direct from route-filter 10.0.2.0/30 exact
set policy-options policy-statement ospf-export term from-direct then accept
# 2.7. Apply OSPF export policy
set protocols ospf export ospf-export
3. Validation on ACX1100
3.1. OSPF Database
root@acx1100> show ospf database
OSPF database, Area 0.0.0.0
Type ID Adv Rtr Seq Age Opt Cksum Len
Router *100.0.1.1 100.0.1.1 0x80000046 2428 0x22 0x8908 48
Router 100.1.2.3 100.1.2.3 0x8000004b 221 0x22 0x9ce2 48
Network 10.0.0.2 100.1.2.3 0x80000044 1221 0x22 0x238f 32
OSPF AS SCOPE link state database
Type ID Adv Rtr Seq Age Opt Cksum Len
Extern *0.0.0.0 100.0.1.1 0x80000043 2489 0x22 0xe722 36
Extern 10.0.1.0 100.1.2.3 0x80000040 2221 0x22 0x33cd 36
Extern 10.0.2.0 100.1.2.3 0x80000040 1721 0x22 0x28d7 36
Extern 100.1.1.1 100.1.2.3 0x80000041 721 0x22 0x960a 36
Extern 100.2.2.2 100.1.2.3 0x80000040 2721 0x22 0x7727 36
3.2. OSPF Routes
root@acx1100> show route protocol ospf
inet.0: 14 destinations, 14 routes (14 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.0.1.0/30 *[OSPF/150] 2d 04:59:38, metric 0, tag 0
> to 10.0.0.2 via ge-0/1/0.0
10.0.2.0/30 *[OSPF/150] 2d 04:59:39, metric 0, tag 0
> to 10.0.0.2 via ge-0/1/0.0
100.1.1.1/32 *[OSPF/150] 2d 05:03:03, metric 0, tag 0
> to 10.0.0.2 via ge-0/1/0.0
100.1.2.3/32 *[OSPF/10] 2d 05:20:51, metric 1
> to 10.0.0.2 via ge-0/1/0.0
100.2.2.2/32 *[OSPF/150] 2d 05:03:03, metric 0, tag 0
> to 10.0.0.2 via ge-0/1/0.0
224.0.0.5/32 *[OSPF/10] 2d 07:42:34, metric 1
MultiRecv
3.3. Ping Tests
root@acx1100> ping count 3 100.1.2.3
PING 100.1.2.3 (100.1.2.3): 56 data bytes
64 bytes from 100.1.2.3: icmp_seq=0 ttl=64 time=0.984 ms
64 bytes from 100.1.2.3: icmp_seq=1 ttl=64 time=0.979 ms
64 bytes from 100.1.2.3: icmp_seq=2 ttl=64 time=1.068 ms
--- 100.1.2.3 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.979/1.010/1.068/0.041 ms
root@acx1100> ping count 3 100.1.1.1
PING 100.1.1.1 (100.1.1.1): 56 data bytes
64 bytes from 100.1.1.1: icmp_seq=0 ttl=63 time=1.008 ms
64 bytes from 100.1.1.1: icmp_seq=1 ttl=63 time=1.018 ms
64 bytes from 100.1.1.1: icmp_seq=2 ttl=63 time=1.064 ms
--- 100.1.1.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev = 1.008/1.030/1.064/0.024 ms
root@acx1100> ping count 3 100.2.2.2
PING 100.2.2.2 (100.2.2.2): 56 data bytes
64 bytes from 100.2.2.2: icmp_seq=0 ttl=63 time=0.992 ms
64 bytes from 100.2.2.2: icmp_seq=1 ttl=63 time=0.980 ms
64 bytes from 100.2.2.2: icmp_seq=2 ttl=63 time=1.037 ms
--- 100.2.2.2 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.980/1.003/1.037/0.025 ms
3.4. Traceroute
root@acx1100> traceroute 100.2.2.2 no-resolve
traceroute to 100.2.2.2 (100.2.2.2), 30 hops max, 40 byte packets
1 10.0.0.2 1.138 ms 0.932 ms 0.852 ms
2 100.2.2.2 1.057 ms 0.896 ms 0.853 ms