BGP Professional Lab
Integrate transport, underlay, confederation, address families and focused policy in one staged practice network.
Topology and address plan
R1 connects the regional network to ISP/R10. R2/R3 form AS65023. R4–R7 form confederation 65467, with member AS65045 on R4/R5 and 65067 on R6/R7. R8 forwards transport only; R9 uses private four-byte AS4200000009. All addresses and assignments here are an isolated original lab plan.
| Link | First endpoint | Second endpoint |
|---|---|---|
| R10–R1 | GigabitEthernet1 192.0.2.1/30 | GigabitEthernet1 192.0.2.2/30 |
| R1–R4 | GigabitEthernet2 192.0.2.5/30 | GigabitEthernet1 192.0.2.6/30 |
| R1–R2 | GigabitEthernet3 192.0.2.9/30 | GigabitEthernet1 192.0.2.10/30 |
| R1–R3 | GigabitEthernet4 192.0.2.13/30 | GigabitEthernet1 192.0.2.14/30 |
| R2–R3 | GigabitEthernet2 192.0.2.17/30 | GigabitEthernet2 192.0.2.18/30 |
| R2–R4 | GigabitEthernet3 192.0.2.21/30 | GigabitEthernet2 192.0.2.22/30 |
| R3–R5 | GigabitEthernet3 192.0.2.25/30 | GigabitEthernet1 192.0.2.26/30 |
| R4–R5 | GigabitEthernet3 192.0.2.29/30 | GigabitEthernet2 192.0.2.30/30 |
| R4–R6 | GigabitEthernet4 192.0.2.33/30 | GigabitEthernet1 192.0.2.34/30 |
| R5–R7 | GigabitEthernet3 192.0.2.37/30 | GigabitEthernet1 192.0.2.38/30 |
| R6–R7 | GigabitEthernet2 192.0.2.41/30 | GigabitEthernet2 192.0.2.42/30 |
| R5–R8 | GigabitEthernet4 192.0.2.45/30 | GigabitEthernet1 192.0.2.46/30 |
| R8–R9 | GigabitEthernet2 192.0.2.49/30 | GigabitEthernet1 192.0.2.50/30 |
The long R1–R4 link uses an elbow above the diagram to keep it clear of R2. The table gives every physical interface address; logical sessions and the tunnel are in the solved configurations.
Start without revealing the solution
Open startup interface configurations. Load each device’s block separately. No router images, credentials or proprietary software are included. The startup file intentionally contains no BGP, OSPF, tunnel or routing-policy solution.
Recommended checkpoints: interfaces, underlay, BGP sessions, IPv6 exchange, then one policy experiment at a time. Save a copy before each fault or policy change. The completed core solution is collapsed below so you can attempt the tasks first.
Task list
| Area | Required result |
|---|---|
| Underlay | Build OSPF in AS65023 and across the confederation; resolve all internal loopbacks. |
| BGP transport | Use loopbacks for internal sessions and direct addresses externally, except the tunneled R5–R9 session. |
| Confederation | Use member 65045 for R4/R5 and 65067 for R6/R7; present 65467 externally. |
| Tunnel | Carry R5–R9 data across BGP-free R8 with GRE, avoiding recursive tunnel endpoints. |
| Address families | Exchange IPv6 with the ISP on IPv6 TCP, and carry IPv6 over IPv4 TCP into AS65023 only. |
| Origination | Advertise each BGP router’s Loopback0 plus the four ISP documentation /26s, using exact statements. |
| Weight | On R4, prefer the AS65023 route for 198.51.100.0/26 only. |
| Local preference | Inside AS65023, prefer R2’s exit for 198.51.100.64/26 only. |
| Path scope | Tag 198.51.100.128/26 No Advertise on export from R1 to R2/R3/R4. |
| Export safety | Allow only regional loopback /32s toward the ISP; do not offer transit for received ISP routes. |
| Filtering | On R9, temporarily reject the first /26; demonstrate removal and restoration without changing its ASN. |
| Convergence | Remove one redundant external link, observe an alternate, restore it, and distinguish expected route changes from measured outage time. |
For an optional historical exercise, inspect the Auto-summary lesson rather than enabling classful behavior in this addressed lab. For aggregation, use current summaries without AS_SET. The focused lessons provide additional dampening, peer-group, Add-Path and PIC experiments with their own prerequisites.
Core solution and transport explanation
Complete baseline configurations
R10
hostname R10
ip cef
ipv6 unicast-routing
interface Loopback0
ipv6 address 2001:db8:ffff::10/128
ip address 10.255.0.10 255.255.255.255
exit
interface Loopback11
ip address 198.51.100.1 255.255.255.192
exit
interface Loopback12
ip address 198.51.100.65 255.255.255.192
exit
interface Loopback13
ip address 198.51.100.129 255.255.255.192
exit
interface Loopback14
ip address 198.51.100.193 255.255.255.192
exit
interface GigabitEthernet1
ipv6 address 2001:db8:0:10::2/64
ip address 192.0.2.1 255.255.255.252
no shutdown
exit
router bgp 64496
bgp router-id 10.255.0.10
no bgp default ipv4-unicast
neighbor 192.0.2.2 remote-as 65001
neighbor 2001:db8:0:10::1 remote-as 65001
address-family ipv4 unicast
no auto-summary
neighbor 192.0.2.2 activate
network 10.255.0.10 mask 255.255.255.255
network 198.51.100.0 mask 255.255.255.192
network 198.51.100.64 mask 255.255.255.192
network 198.51.100.128 mask 255.255.255.192
network 198.51.100.192 mask 255.255.255.192
exit-address-family
address-family ipv6 unicast
neighbor 2001:db8:0:10::1 activate
network 2001:db8:ffff::10/128
exit-address-family
endR1
hostname R1
ip cef
ipv6 unicast-routing
interface Loopback0
ipv6 address 2001:db8:ffff::1/128
ip address 10.255.0.1 255.255.255.255
exit
interface GigabitEthernet1
ipv6 address 2001:db8:0:10::1/64
ip address 192.0.2.2 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.5 255.255.255.252
no shutdown
exit
interface GigabitEthernet3
ipv6 address 2001:db8:0:12::1/64
ip address 192.0.2.9 255.255.255.252
no shutdown
exit
interface GigabitEthernet4
ipv6 address 2001:db8:0:13::1/64
ip address 192.0.2.13 255.255.255.252
no shutdown
exit
router bgp 65001
bgp router-id 10.255.0.1
no bgp default ipv4-unicast
neighbor 192.0.2.1 remote-as 64496
neighbor 192.0.2.10 remote-as 65023
neighbor 192.0.2.14 remote-as 65023
neighbor 192.0.2.6 remote-as 65467
neighbor 2001:db8:0:10::2 remote-as 64496
address-family ipv4 unicast
no auto-summary
neighbor 192.0.2.1 activate
neighbor 192.0.2.10 activate
neighbor 192.0.2.14 activate
neighbor 192.0.2.6 activate
network 10.255.0.1 mask 255.255.255.255
exit-address-family
address-family ipv6 unicast
neighbor 2001:db8:0:10::2 activate
network 2001:db8:ffff::1/128
exit-address-family
router bgp 65001
address-family ipv6 unicast
neighbor 192.0.2.10 activate
neighbor 192.0.2.10 route-map V6-12-1 out
exit-address-family
route-map V6-12-1 permit 10
set ipv6 next-hop 2001:db8:0:12::1
exit
router bgp 65001
address-family ipv6 unicast
neighbor 192.0.2.14 activate
neighbor 192.0.2.14 route-map V6-13-1 out
exit-address-family
route-map V6-13-1 permit 10
set ipv6 next-hop 2001:db8:0:13::1
exit
endR2
hostname R2
ip cef
ipv6 unicast-routing
interface Loopback0
ipv6 address 2001:db8:ffff::2/128
ip address 10.255.0.2 255.255.255.255
exit
interface GigabitEthernet1
ipv6 address 2001:db8:0:12::2/64
ip address 192.0.2.10 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.17 255.255.255.252
no shutdown
exit
interface GigabitEthernet3
ip address 192.0.2.21 255.255.255.252
no shutdown
exit
router ospf 1
router-id 10.255.0.2
network 10.255.0.2 0.0.0.0 area 0
passive-interface Loopback0
network 192.0.2.17 0.0.0.0 area 0
exit
router bgp 65023
bgp router-id 10.255.0.2
no bgp default ipv4-unicast
neighbor 192.0.2.9 remote-as 65001
neighbor 10.255.0.3 remote-as 65023
neighbor 10.255.0.3 update-source Loopback0
neighbor 192.0.2.22 remote-as 65467
address-family ipv4 unicast
no auto-summary
neighbor 192.0.2.9 activate
neighbor 10.255.0.3 activate
neighbor 10.255.0.3 next-hop-self
neighbor 192.0.2.22 activate
network 10.255.0.2 mask 255.255.255.255
exit-address-family
router bgp 65023
address-family ipv6 unicast
neighbor 192.0.2.9 activate
neighbor 192.0.2.9 route-map V6-12-2 out
exit-address-family
route-map V6-12-2 permit 10
set ipv6 next-hop 2001:db8:0:12::2
exit
endR3
hostname R3
ip cef
ipv6 unicast-routing
interface Loopback0
ipv6 address 2001:db8:ffff::3/128
ip address 10.255.0.3 255.255.255.255
exit
interface GigabitEthernet1
ipv6 address 2001:db8:0:13::2/64
ip address 192.0.2.14 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.18 255.255.255.252
no shutdown
exit
interface GigabitEthernet3
ip address 192.0.2.25 255.255.255.252
no shutdown
exit
router ospf 1
router-id 10.255.0.3
network 10.255.0.3 0.0.0.0 area 0
passive-interface Loopback0
network 192.0.2.18 0.0.0.0 area 0
exit
router bgp 65023
bgp router-id 10.255.0.3
no bgp default ipv4-unicast
neighbor 192.0.2.13 remote-as 65001
neighbor 10.255.0.2 remote-as 65023
neighbor 10.255.0.2 update-source Loopback0
neighbor 192.0.2.26 remote-as 65467
address-family ipv4 unicast
no auto-summary
neighbor 192.0.2.13 activate
neighbor 10.255.0.2 activate
neighbor 10.255.0.2 next-hop-self
neighbor 192.0.2.26 activate
network 10.255.0.3 mask 255.255.255.255
exit-address-family
router bgp 65023
address-family ipv6 unicast
neighbor 192.0.2.13 activate
neighbor 192.0.2.13 route-map V6-13-3 out
exit-address-family
route-map V6-13-3 permit 10
set ipv6 next-hop 2001:db8:0:13::2
exit
endR4
hostname R4
ip cef
interface Loopback0
ip address 10.255.0.4 255.255.255.255
exit
interface GigabitEthernet1
ip address 192.0.2.6 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.22 255.255.255.252
no shutdown
exit
interface GigabitEthernet3
ip address 192.0.2.29 255.255.255.252
no shutdown
exit
interface GigabitEthernet4
ip address 192.0.2.33 255.255.255.252
no shutdown
exit
router ospf 1
router-id 10.255.0.4
network 10.255.0.4 0.0.0.0 area 0
passive-interface Loopback0
network 192.0.2.29 0.0.0.0 area 0
network 192.0.2.33 0.0.0.0 area 0
exit
router bgp 65045
bgp router-id 10.255.0.4
bgp confederation identifier 65467
bgp confederation peers 65067
no bgp default ipv4-unicast
neighbor 192.0.2.5 remote-as 65001
neighbor 192.0.2.21 remote-as 65023
neighbor 10.255.0.5 remote-as 65045
neighbor 10.255.0.5 update-source Loopback0
neighbor 10.255.0.6 remote-as 65067
neighbor 10.255.0.6 update-source Loopback0
neighbor 10.255.0.6 ebgp-multihop 2
address-family ipv4 unicast
no auto-summary
neighbor 192.0.2.5 activate
neighbor 192.0.2.21 activate
neighbor 10.255.0.5 activate
neighbor 10.255.0.5 next-hop-self
neighbor 10.255.0.6 activate
neighbor 10.255.0.6 next-hop-self
network 10.255.0.4 mask 255.255.255.255
exit-address-family
endR5
hostname R5
ip cef
interface Loopback0
ip address 10.255.0.5 255.255.255.255
exit
interface GigabitEthernet1
ip address 192.0.2.26 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.30 255.255.255.252
no shutdown
exit
interface GigabitEthernet3
ip address 192.0.2.37 255.255.255.252
no shutdown
exit
interface GigabitEthernet4
ip address 192.0.2.45 255.255.255.252
no shutdown
exit
ip route 192.0.2.50 255.255.255.255 192.0.2.46
ip route 10.255.0.9 255.255.255.255 Tunnel0
interface Tunnel0
ip address 192.0.2.201 255.255.255.252
tunnel source GigabitEthernet4
tunnel destination 192.0.2.50
exit
router ospf 1
router-id 10.255.0.5
network 10.255.0.5 0.0.0.0 area 0
passive-interface Loopback0
network 192.0.2.30 0.0.0.0 area 0
network 192.0.2.37 0.0.0.0 area 0
exit
router bgp 65045
bgp router-id 10.255.0.5
bgp confederation identifier 65467
bgp confederation peers 65067
no bgp default ipv4-unicast
neighbor 192.0.2.25 remote-as 65023
neighbor 10.255.0.4 remote-as 65045
neighbor 10.255.0.4 update-source Loopback0
neighbor 10.255.0.7 remote-as 65067
neighbor 10.255.0.7 update-source Loopback0
neighbor 10.255.0.7 ebgp-multihop 2
neighbor 10.255.0.9 remote-as 4200000009
neighbor 10.255.0.9 update-source Loopback0
neighbor 10.255.0.9 ebgp-multihop 2
address-family ipv4 unicast
no auto-summary
neighbor 192.0.2.25 activate
neighbor 10.255.0.4 activate
neighbor 10.255.0.4 next-hop-self
neighbor 10.255.0.7 activate
neighbor 10.255.0.7 next-hop-self
neighbor 10.255.0.9 activate
neighbor 10.255.0.9 next-hop-self
network 10.255.0.5 mask 255.255.255.255
exit-address-family
endR6
hostname R6
ip cef
interface Loopback0
ip address 10.255.0.6 255.255.255.255
exit
interface GigabitEthernet1
ip address 192.0.2.34 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.41 255.255.255.252
no shutdown
exit
router ospf 1
router-id 10.255.0.6
network 10.255.0.6 0.0.0.0 area 0
passive-interface Loopback0
network 192.0.2.34 0.0.0.0 area 0
network 192.0.2.41 0.0.0.0 area 0
exit
router bgp 65067
bgp router-id 10.255.0.6
bgp confederation identifier 65467
bgp confederation peers 65045
no bgp default ipv4-unicast
neighbor 10.255.0.4 remote-as 65045
neighbor 10.255.0.4 update-source Loopback0
neighbor 10.255.0.4 ebgp-multihop 2
neighbor 10.255.0.7 remote-as 65067
neighbor 10.255.0.7 update-source Loopback0
address-family ipv4 unicast
no auto-summary
neighbor 10.255.0.4 activate
neighbor 10.255.0.4 next-hop-self
neighbor 10.255.0.7 activate
neighbor 10.255.0.7 next-hop-self
network 10.255.0.6 mask 255.255.255.255
exit-address-family
endR7
hostname R7
ip cef
interface Loopback0
ip address 10.255.0.7 255.255.255.255
exit
interface GigabitEthernet1
ip address 192.0.2.38 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.42 255.255.255.252
no shutdown
exit
router ospf 1
router-id 10.255.0.7
network 10.255.0.7 0.0.0.0 area 0
passive-interface Loopback0
network 192.0.2.38 0.0.0.0 area 0
network 192.0.2.42 0.0.0.0 area 0
exit
router bgp 65067
bgp router-id 10.255.0.7
bgp confederation identifier 65467
bgp confederation peers 65045
no bgp default ipv4-unicast
neighbor 10.255.0.5 remote-as 65045
neighbor 10.255.0.5 update-source Loopback0
neighbor 10.255.0.5 ebgp-multihop 2
neighbor 10.255.0.6 remote-as 65067
neighbor 10.255.0.6 update-source Loopback0
address-family ipv4 unicast
no auto-summary
neighbor 10.255.0.5 activate
neighbor 10.255.0.5 next-hop-self
neighbor 10.255.0.6 activate
neighbor 10.255.0.6 next-hop-self
network 10.255.0.7 mask 255.255.255.255
exit-address-family
endR8
hostname R8
ip cef
interface Loopback0
ip address 10.255.0.8 255.255.255.255
exit
interface GigabitEthernet1
ip address 192.0.2.46 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.49 255.255.255.252
no shutdown
exit
ip route 10.255.0.5 255.255.255.255 192.0.2.45
ip route 10.255.0.9 255.255.255.255 192.0.2.50
endR9
hostname R9
ip cef
interface Loopback0
ip address 10.255.0.9 255.255.255.255
exit
interface GigabitEthernet1
ip address 192.0.2.50 255.255.255.252
no shutdown
exit
ip route 192.0.2.45 255.255.255.255 192.0.2.49
ip route 10.255.0.5 255.255.255.255 Tunnel0
interface Tunnel0
ip address 192.0.2.202 255.255.255.252
tunnel source GigabitEthernet1
tunnel destination 192.0.2.45
exit
router bgp 4200000009
bgp router-id 10.255.0.9
no bgp default ipv4-unicast
neighbor 10.255.0.5 remote-as 65467
neighbor 10.255.0.5 update-source Loopback0
neighbor 10.255.0.5 ebgp-multihop 2
address-family ipv4 unicast
no auto-summary
neighbor 10.255.0.5 activate
network 10.255.0.9 mask 255.255.255.255
exit-address-family
endThe physical outer GRE endpoints are R5 192.0.2.45 and R9 192.0.2.50. Their static /32 routes resolve through R8, so tunnel recursion does not point back into Tunnel0. Inner loopbacks 10.255.0.5 and .9 use the tunnel; BGP is sourced from those loopbacks with multihop 2. Tunnel0 uses 192.0.2.201/30 on R5 and .202/30 on R9. R8 has only connected forwarding and two loopback static routes, never BGP.
The saved solution advertises each internal loopback through its own BGP network statement. OSPF supplies recursive underlay reachability. Border next-hop-self prevents inaccessible external link addresses from becoming hidden forwarding dependencies across the confederation. IPv6 is activated only on ISP/R1 and R1’s AS65023-facing sessions.
Policy solutions in separate stages
Solution: prefix-specific attribute changes
R4: weight on AS65023 imports
ip prefix-list WEIGHT-TARGET seq 5 permit 198.51.100.0/26
route-map REGION-IN permit 10
match ip address prefix-list WEIGHT-TARGET
set weight 500
exit
route-map REGION-IN permit 20
exitrouter bgp 65045
address-family ipv4 unicast
neighbor 192.0.2.21 route-map REGION-IN in
exit-address-familyR2: local preference on the R1 import
ip prefix-list LP-TARGET seq 5 permit 198.51.100.64/26
route-map PREFER-R2 permit 10
match ip address prefix-list LP-TARGET
set local-preference 200
exit
route-map PREFER-R2 permit 20
exitrouter bgp 65023
address-family ipv4 unicast
neighbor 192.0.2.9 route-map PREFER-R2 in
exit-address-familyR4# clear ip bgp 192.0.2.21 soft in
R2# clear ip bgp 192.0.2.9 soft inEach route map has a passthrough clause so unrelated prefixes remain. R4’s weight is local; R2’s LOCAL_PREF travels inside AS65023. The route maps target different routers and do not overwrite each other.
Solution: community scope and upstream allowlist
R1
ip prefix-list SCOPED seq 5 permit 198.51.100.128/26
route-map SCOPE-OUT permit 10
match ip address prefix-list SCOPED
set community no-advertise additive
exit
route-map SCOPE-OUT permit 20
exit
ip prefix-list REGIONAL-ONLY seq 5 permit 10.255.0.0/24 ge 32 le 32router bgp 65001
address-family ipv4 unicast
neighbor 192.0.2.10 send-community
neighbor 192.0.2.14 send-community
neighbor 192.0.2.6 send-community
neighbor 192.0.2.10 route-map SCOPE-OUT out
neighbor 192.0.2.14 route-map SCOPE-OUT out
neighbor 192.0.2.6 route-map SCOPE-OUT out
neighbor 192.0.2.1 prefix-list REGIONAL-ONLY out
exit-address-familyR1# clear ip bgp 192.0.2.10 soft out
R1# clear ip bgp 192.0.2.14 soft out
R1# clear ip bgp 192.0.2.6 soft out
R1# clear ip bgp 192.0.2.1 soft outR1 uses .10 toward R2, .14 toward R3, .6 toward R4 and .1 toward the ISP. The sample regional /32s are private lab infrastructure; a real public boundary would use authorized public customer space instead.
Solution: a reversible route filter on R9
ip prefix-list R9-IN seq 5 deny 198.51.100.0/26
ip prefix-list R9-IN seq 10 permit 0.0.0.0/0 le 32router bgp 4200000009
address-family ipv4 unicast
neighbor 10.255.0.5 prefix-list R9-IN in
exit-address-familyR9# clear ip bgp 10.255.0.5 soft inR9# show ip bgp 198.51.100.0/26
% Network not in tablerouter bgp 4200000009
address-family ipv4 unicast
no neighbor 10.255.0.5 prefix-list R9-IN in
exit-address-familyR9# clear ip bgp 10.255.0.5 soft inDetach the filter to restore the prefix. The four-byte ASN and tunnel transport do not need changing.
Apply the scope change after checking the attribute exercises: No Advertise intentionally removes its /26 beyond R2/R3/R4. A later absent route must be interpreted in light of that deliberate policy.
Acceptance checks and expected evidence
R9# show ip bgp summary
BGP router identifier 10.255.0.9, local AS number 4200000009
Neighbor V AS State/PfxRcd
10.255.0.5 4 65467 12The count is illustrative and changes with policy; the acceptance condition is an established session and the intended route set, not a fixed number.
R4# show ip bgp 198.51.100.0/26
BGP routing table entry for 198.51.100.0/26
65023 65001 64496 via 192.0.2.21
weight 500, valid, external, best
65001 64496 via 192.0.2.5
weight 0, valid, externalR3# show ip bgp 198.51.100.64/26
BGP routing table entry for 198.51.100.64/26
65001 64496 via 10.255.0.2
localpref 200, valid, internal, best
65001 64496 via 192.0.2.13
localpref 100, valid, externalR1# show bgp ipv6 unicast 2001:db8:ffff::10/128
BGP routing table entry for 2001:db8:ffff::10/128
64496 via 2001:db8:0:10::2, valid, external, bestAlso test return traffic using explicit sources, inspect the IP forwarding table and verify that the scoped prefix reaches R2/R3/R4 but not R9. R4’s weight and R2’s LOCAL_PREF affect different decisions.
Faults, diagnosis and restoration
| Independent fault | Evidence to inspect | Restore |
|---|---|---|
| Remove R5’s static outer endpoint route | Tunnel recursion and endpoint reachability. | Restore the saved /32 via R8, not via Tunnel0. |
| Remove a confederation peer declaration | OPEN remote-AS expectation and session state. | Restore identifier/member settings consistently. |
| Withdraw one redundant R1 regional link | Remaining BGP path and IP route; actual traffic loss. | Restore interface and wait for convergence. |
| Remove next-hop-self at one border | Received path versus recursive reachability. | Restore the neighbor’s next-hop treatment. |
| Deny a prefix on R9 | Accepted BGP table versus upstream advertisements. | Detach that filter and refresh the one peer. |
Restore the solved core or your saved checkpoint after each independent fault. The pages and consistency checks do not certify a live router run. Record image versions, exact outputs and packet loss when you execute the lab.
Key Takeaways
- Build and verify underlay before BGP policy.
- The confederation identifier differs from member ASNs.
- Tunnel endpoints must not recurse into their own tunnel.
- Weight, LOCAL_PREF and communities have different scopes.
- Accept a lab result only after checking routes and forwarding in both directions.
Protocol and command references
BGP specification · Confederations · Multiprotocol extensions · Router-symbol attribution.