Day 33 --- AS-Path Prepending as Inbound Traffic Engineering

1. Opening

AS-path prepending makes one advertisement appear longer by repeating the local ASN. It can influence remote path selection, but only after higher-priority policy such as remote LOCAL_PREF. It is therefore a signal, not a guarantee.

The operational objective is not simply to make BGP choose a route. It is to make the intended behavior predictable during the normal state, degraded state, and rollback state.


AS-Path Prepending as Inbound Traffic Engineering
AS-Path Prepending as Inbound Traffic Engineering


2. Concept and standards behavior

RFC 4271 uses AS_PATH both for loop detection and as an input to path selection. Cisco route policy can prepend the local AS on selected exports. Remote networks may ignore the intended preference because of LOCAL_PREF, peering relationships, more-specific routes or their own policy.

BGP remains a policy protocol. RFC 4271 provides the protocol framework, while several practical traffic-engineering controls are Cisco or operator-policy mechanisms. Evaluate each design at three layers: protocol behavior, IOS XE implementation, and neighboring-AS policy.

Separate route eligibility, route selection, and route export. Eligibility asks whether a path is usable. Selection determines the local best path. Export policy determines what a neighbor is permitted to learn.

3. Scenario

AS 65010 is dual-homed to ISP-A AS 65020 and ISP-B AS 65030. The enterprise service prefix is 203.0.113.0/24. Transit links use 192.0.2.0/30 and 198.51.100.0/30.

Success criteria 1. Primary and backup behavior is explicit. 2. No route is exported merely because it exists locally. 3. Failure behavior is observable in BGP and advertised-route evidence. 4. Rollback is independent of session redesign. 5. A negative test proves unintended advertisement is absent.

4. Topology

ISP-A AS65020 --- 192.0.2.0/30 --- EDGE1/AS65010
                                      |
                               203.0.113.0/24
                                      |
ISP-B AS65030 --- 198.51.100.0/30 --- EDGE2/AS65010

5. Prerequisites

  • IOS XE 17.18.x documentation baseline.
  • IPv4 unicast activated for both eBGP peers.
  • Service prefix valid for origination.
  • Independent management access.
  • Pre-change capture of BGP state and advertised routes.

6. Baseline configuration

Topic-specific configuration excerpt --- not a complete device configuration.

ip prefix-list PL-SERVICE permit 203.0.113.0/24
route-map PREPEND-ISP-B permit 10
 match ip address prefix-list PL-SERVICE
 set as-path prepend 65010 65010 65010

router bgp 65010
 address-family ipv4
  neighbor 198.51.100.1 route-map PREPEND-ISP-B out
 exit-address-family

7. Verification before modification

show bgp ipv4 unicast
show bgp ipv4 unicast 203.0.113.0/24
show bgp ipv4 unicast neighbors
show bgp ipv4 unicast neighbors 192.0.2.1 advertised-routes
show bgp ipv4 unicast neighbors 198.51.100.1 advertised-routes
show route-map
show ip prefix-list

The question is not whether the policy object exists; it is whether the intended route is selected, matched and actually exported to the intended neighbor.

8. Controlled modification

Apply three additional copies of AS65010 only toward ISP-B. Verify the local advertised path. Use an authorized external looking glass or lab remote AS to test whether ISP-A becomes preferred.

Predict Adj-RIB-Out behavior before applying the change. Re-evaluate policy using the least disruptive supported mechanism.

9. Fault injection

Illustrative lab — not a real incident.

Set a high LOCAL_PREF inside a simulated remote AS for the ISP-B path. The remote AS should still prefer that path despite the longer AS_PATH, demonstrating why prepending is not deterministic.

Change one variable only, capture the changed state, and compare it with the baseline.

10. Troubleshooting

  1. Confirm affected prefix and traffic direction.
  2. Confirm eBGP sessions are Established.
  3. Confirm local route eligibility/origination.
  4. Inspect selected BGP route.
  5. Inspect match objects.
  6. Inspect route-map sequence and implicit deny.
  7. Inspect advertised routes per provider.
  8. Confirm policy direction.
  9. Determine whether route refresh is required.
  10. Run positive traffic test.
  11. Run negative/containment test.
  12. Correct the smallest proven cause and repeat the same evidence set.

11. Root cause and correction

The mistaken assumption is that shortest AS_PATH is globally the first decision. Correct the design expectation: remote business policy may precede AS-path length.

12. Post-fix verification

Verify session state, route acceptance, selected path, exported attributes, advertised routes, forwarding and the negative test. Local advertisement does not prove remote selection.

13. Rollback

Revert only the new policy action, re-evaluate policy with the least disruptive supported method, and confirm both providers return to baseline. Roll back immediately for loss of all reachability, unintended transit, unapproved deaggregation or export outside the approved prefix set.

14. Production lessons

Prepending is most defensible when measured, limited to specific prefixes, and paired with failure testing. Excessive prepends add path noise without creating contractual control.

15. Knowledge check

map?

policy?

leaking?

  1. Why is advertised-routes stronger evidence than displaying a route
  2. Which parts are controlled locally and which depend on upstream
  3. What negative test proves the restricted/backup advertisement is not

Answers

inbound selection are remote policy.

routes in the healthy state.

  1. It validates resulting per-neighbor export state.
  2. Local selection/export are local; remote LOCAL_PREF, propagation and
  3. Verify the protected prefix is absent from the neighbor's advertised

16. Sources

  • RFC 4271 --- AS_PATH selection/loop prevention
  • Cisco IOS XE 17.x --- BGP path manipulation guidance

Day 32 --- Selective Advertisement and More-Specific Traffic Engineering

1. Opening

Selective advertisement controls which prefixes each provider receives. Advertising a more-specific route can attract traffic because forwarding follows longest-prefix match before BGP attributes are compared. That power makes deaggregation effective---and potentially harmful if used casually.

The operational objective is not simply to make BGP choose a route. It is to make the intended behavior predictable during the normal state, degraded state, and rollback state.


Selective Advertisement and More-Specific Traffic Engineering
Selective Advertisement and More-Specific Traffic Engineering


2. Concept and standards behavior

An aggregate and a more-specific are different NLRI. If both are globally visible, routers normally forward destinations covered by the more-specific toward that route regardless of the aggregate's AS-path. The design must therefore distinguish intentional TE from unnecessary contribution to global routing-table growth.

BGP remains a policy protocol. RFC 4271 provides the protocol framework, while several practical traffic-engineering controls are Cisco or operator-policy mechanisms. Evaluate each design at three layers: protocol behavior, IOS XE implementation, and neighboring-AS policy.

Separate route eligibility, route selection, and route export. Eligibility asks whether a path is usable. Selection determines the local best path. Export policy determines what a neighbor is permitted to learn.

3. Scenario

AS 65010 is dual-homed to ISP-A AS 65020 and ISP-B AS 65030. The enterprise service prefix is 203.0.113.0/24. Transit links use 192.0.2.0/30 and 198.51.100.0/30.

Success criteria 1. Primary and backup behavior is explicit. 2. No route is exported merely because it exists locally. 3. Failure behavior is observable in BGP and advertised-route evidence. 4. Rollback is independent of session redesign. 5. A negative test proves unintended advertisement is absent.

4. Topology


Selective Advertisement and More-Specific Traffic Engineering
Selective Advertisement and More-Specific Traffic Engineering

ISP-A AS65020 --- 192.0.2.0/30 --- EDGE1/AS65010
                                      |
                               203.0.113.0/24
                                      |
ISP-B AS65030 --- 198.51.100.0/30 --- EDGE2/AS65010

5. Prerequisites

  • IOS XE 17.18.x documentation baseline.
  • IPv4 unicast activated for both eBGP peers.
  • Service prefix valid for origination.
  • Independent management access.
  • Pre-change capture of BGP state and advertised routes.

6. Baseline configuration

Topic-specific configuration excerpt --- not a complete device configuration.

ip prefix-list PL-AGG permit 203.0.113.0/24
ip prefix-list PL-MORE-SPEC permit 203.0.113.0/25

route-map TO-ISP-A permit 10
 match ip address prefix-list PL-AGG
route-map TO-ISP-A permit 20
 match ip address prefix-list PL-MORE-SPEC

route-map TO-ISP-B permit 10
 match ip address prefix-list PL-AGG

router bgp 65010
 address-family ipv4
  neighbor 192.0.2.1 route-map TO-ISP-A out
  neighbor 198.51.100.1 route-map TO-ISP-B out
 exit-address-family

7. Verification before modification

show bgp ipv4 unicast
show bgp ipv4 unicast 203.0.113.0/24
show bgp ipv4 unicast neighbors
show bgp ipv4 unicast neighbors 192.0.2.1 advertised-routes
show bgp ipv4 unicast neighbors 198.51.100.1 advertised-routes
show route-map
show ip prefix-list

The question is not whether the policy object exists; it is whether the intended route is selected, matched and actually exported to the intended neighbor.

8. Controlled modification

Advertise the /25 only to ISP-A while retaining the /24 to both providers. Predict that destinations in the /25 can prefer ISP-A because of longest-prefix match, assuming upstream acceptance.

Predict Adj-RIB-Out behavior before applying the change. Re-evaluate policy using the least disruptive supported mechanism.

9. Fault injection

Illustrative lab — not a real incident.

Accidentally permit the /25 toward both providers. Observe that the intended directional signal disappears because both upstreams now receive the same more-specific.

Change one variable only, capture the changed state, and compare it with the baseline.

10. Troubleshooting

  1. Confirm affected prefix and traffic direction.
  2. Confirm eBGP sessions are Established.
  3. Confirm local route eligibility/origination.
  4. Inspect selected BGP route.
  5. Inspect match objects.
  6. Inspect route-map sequence and implicit deny.
  7. Inspect advertised routes per provider.
  8. Confirm policy direction.
  9. Determine whether route refresh is required.
  10. Run positive traffic test.
  11. Run negative/containment test.
  12. Correct the smallest proven cause and repeat the same evidence set.

11. Root cause and correction

The root cause is export-policy scope, not best-path selection. Correct the ISP-B prefix list so only the approved aggregate is exported.

12. Post-fix verification

Verify session state, route acceptance, selected path, exported attributes, advertised routes, forwarding and the negative test. Local advertisement does not prove remote selection.

13. Rollback

Revert only the new policy action, re-evaluate policy with the least disruptive supported method, and confirm both providers return to baseline. Roll back immediately for loss of all reachability, unintended transit, unapproved deaggregation or export outside the approved prefix set.

14. Production lessons

Deaggregation is a routing-table and operational cost, not a free TE knob. Use it only with prefix-ownership, RPKI/IRR, provider prefix-length acceptance and rollback implications understood.

15. Knowledge check


  1. Why is advertised-routes stronger evidence than displaying a route
  2. Which parts are controlled locally and which depend on upstream
  3. What negative test proves the restricted/backup advertisement is not

Answers

inbound selection are remote policy.

routes in the healthy state.

  1. It validates resulting per-neighbor export state.
  2. Local selection/export are local; remote LOCAL_PREF, propagation and
  3. Verify the protected prefix is absent from the neighbor's advertised

16. Sources

  • RFC 4271 --- export policy and NLRI
  • Cisco IOS XE 17.x --- BGP configuration and policy guidance

Day 31 --- Conditional Advertisement with advertise-map, exist-map and non-exist-map

1. Opening

Conditional advertisement is useful when a route should be announced only while another BGP condition exists---or only while it does not. It is particularly valuable for backup advertisements in multihomed networks, but it is also easy to misuse because the condition is evaluated from BGP table state, not from an arbitrary business notion of 'the primary circuit is healthy.'

The operational objective is not simply to make BGP choose a route. It is to make the intended behavior predictable during the normal state, degraded state, and rollback state.


Conditional Advertisement with advertise-map, exist-map and non-exist-map
Conditional Advertisement with advertise-map, exist-map and non-exist-map


2. Concept and standards behavior

Cisco conditional advertisement uses an advertise-map to identify what may be announced and an exist-map or non-exist-map to define the BGP-table condition. With non-exist-map, the advertised route becomes eligible when the condition route is absent. With exist-map, it becomes eligible when the condition route is present. This is Cisco implementation behavior; it is not a generic RFC 4271 primitive.

BGP remains a policy protocol. RFC 4271 provides the protocol framework, while several practical traffic-engineering controls are Cisco or operator-policy mechanisms. Evaluate each design at three layers: protocol behavior, IOS XE implementation, and neighboring-AS policy.

Separate route eligibility, route selection, and route export. Eligibility asks whether a path is usable. Selection determines the local best path. Export policy determines what a neighbor is permitted to learn.

3. Scenario

AS 65010 is dual-homed to ISP-A AS 65020 and ISP-B AS 65030. The enterprise service prefix is 203.0.113.0/24. Transit links use 192.0.2.0/30 and 198.51.100.0/30.

Success criteria 1. Primary and backup behavior is explicit. 2. No route is exported merely because it exists locally. 3. Failure behavior is observable in BGP and advertised-route evidence. 4. Rollback is independent of session redesign. 5. A negative test proves unintended advertisement is absent.

4. Topology


Conditional Advertisement with advertise-map, exist-map and non-exist-map
Conditional Advertisement with advertise-map, exist-map and non-exist-map

ISP-A AS65020 --- 192.0.2.0/30 --- EDGE1/AS65010
                                      |
                               203.0.113.0/24
                                      |
ISP-B AS65030 --- 198.51.100.0/30 --- EDGE2/AS65010

5. Prerequisites

  • IOS XE 17.18.x documentation baseline.
  • IPv4 unicast activated for both eBGP peers.
  • Service prefix valid for origination.
  • Independent management access.
  • Pre-change capture of BGP state and advertised routes.

6. Baseline configuration

Topic-specific configuration excerpt --- not a complete device configuration.

router bgp 65010
 address-family ipv4
  network 203.0.113.0 mask 255.255.255.0
  neighbor 192.0.2.1 remote-as 65020
  neighbor 198.51.100.1 remote-as 65030
  neighbor 198.51.100.1 advertise-map ADV-BACKUP non-exist-map PRIMARY-HEALTH
 exit-address-family

ip prefix-list PL-SERVICE permit 203.0.113.0/24
route-map ADV-BACKUP permit 10
 match ip address prefix-list PL-SERVICE

ip prefix-list PL-PRIMARY-HEALTH permit 192.0.2.0/30
route-map PRIMARY-HEALTH permit 10
 match ip address prefix-list PL-PRIMARY-HEALTH

7. Verification before modification

show bgp ipv4 unicast
show bgp ipv4 unicast 203.0.113.0/24
show bgp ipv4 unicast neighbors
show bgp ipv4 unicast neighbors 192.0.2.1 advertised-routes
show bgp ipv4 unicast neighbors 198.51.100.1 advertised-routes
show route-map
show ip prefix-list

The question is not whether the policy object exists; it is whether the intended route is selected, matched and actually exported to the intended neighbor.

8. Controlled modification

Withdraw the route used by PRIMARY-HEALTH and predict that the backup service advertisement becomes eligible toward ISP-B. Then restore it and verify withdrawal of the conditional advertisement.

Predict Adj-RIB-Out behavior before applying the change. Re-evaluate policy using the least disruptive supported mechanism.

9. Fault injection

Illustrative lab — not a real incident.

Remove the condition route while leaving both BGP sessions up. The symptom should be a change in advertisement state rather than a session reset.

Change one variable only, capture the changed state, and compare it with the baseline.

10. Troubleshooting

  1. Confirm affected prefix and traffic direction.
  2. Confirm eBGP sessions are Established.
  3. Confirm local route eligibility/origination.
  4. Inspect selected BGP route.
  5. Inspect match objects.
  6. Inspect route-map sequence and implicit deny.
  7. Inspect advertised routes per provider.
  8. Confirm policy direction.
  9. Determine whether route refresh is required.
  10. Run positive traffic test.
  11. Run negative/containment test.
  12. Correct the smallest proven cause and repeat the same evidence set.

11. Root cause and correction

The usual failure is matching the wrong route in the condition map or assuming interface state is directly tracked. Correct the condition so it represents the BGP reachability signal the design actually intends to use.

12. Post-fix verification

Verify session state, route acceptance, selected path, exported attributes, advertised routes, forwarding and the negative test. Local advertisement does not prove remote selection.

13. Rollback

Revert only the new policy action, re-evaluate policy with the least disruptive supported method, and confirm both providers return to baseline. Roll back immediately for loss of all reachability, unintended transit, unapproved deaggregation or export outside the approved prefix set.

14. Production lessons

Conditional advertisement is a policy-state machine. Document exactly what route constitutes the condition, how quickly it changes, and what false positives could trigger the backup advertisement.

15. Knowledge check

map?

policy?

leaking?

  1. Why is advertised-routes stronger evidence than displaying a route
  2. Which parts are controlled locally and which depend on upstream
  3. What negative test proves the restricted/backup advertisement is not

Answers

inbound selection are remote policy.

routes in the healthy state.

  1. It validates resulting per-neighbor export state.
  2. Local selection/export are local; remote LOCAL_PREF, propagation and
  3. Verify the protected prefix is absent from the neighbor's advertised

16. Sources

  • RFC 4271 --- BGP-4 base behavior
  • Cisco IOS XE 17.x --- BGP VRF-Aware Conditional Advertisement

RETICUX BGP Mastery — Day 30 BGP Policy Changes Without Flapping: Route Refresh, Soft Reset and Safe Rollback



BGP Policy Changes Without Flapping: Route Refresh, Soft Reset and Safe Rollback

Opening

A policy change should not automatically become a routing outage. Modern BGP provides mechanisms for re-evaluating routes without tearing down an established session, but each mechanism has different state, memory and interoperability implications.

Learning objectives

  • Explain the protocol mechanism precisely.
  • Distinguish standards behavior from Cisco implementation behavior.
  • Build a deterministic policy with explicit match and action logic.
  • Verify both received and advertised routing information.
  • Diagnose the failure mode and roll back safely.


BGP Policy Changes Without Flapping: Route Refresh, Soft Reset and Safe Rollback
BGP Policy Changes Without Flapping: Route Refresh, Soft Reset and Safe Rollback


Concept and standards behavior

Policy changes should not require unnecessary session resets. Route Refresh allows a speaker to request re-advertisement from a peer, while Cisco soft-reset mechanisms provide operational alternatives with different memory and interoperability implications. The lab changes a community policy, refreshes inbound routes, verifies the result and rolls back safely.

Implementation boundary: the standard defines the wire attribute and semantics; Cisco IOS XE syntax, defaults and verification commands must be checked against the selected 17.18.x platform documentation before claiming exact execution behavior.

Engineering scenario

The lab uses three documentation-safe routers: EDGE-A (AS 65001), TRANSIT-A (AS 65002) and EDGE-B (AS 65003). EDGE-A originates 192.0.2.0/24 and 198.51.100.0/24; EDGE-B provides a second policy domain. Loopbacks and point-to-point links use TEST-NET values. No production prefixes, credentials or real ASNs are used.

The engineering requirement is to express policy using reusable metadata and precise filters, then prove that the resulting Adj-RIB-In, best path and Adj-RIB-Out behavior match the intended policy.

Topology


Conditional Advertisement with advertise-map, exist-map and non-exist-map
Conditional Advertisement with advertise-map, exist-map and non-exist-map

        AS 65002 TRANSIT-A
       /                   \
  AS 65001 EDGE-A ---- AS 65003 EDGE-B
  192.0.2.0/24
  198.51.100.0/24

Prerequisites

  • Cisco IOS XE 17.18.x or a release with equivalent documented commands.
  • Working eBGP sessions.
  • Reachability between BGP next hops.
  • Address family ipv4 unicast enabled.
  • Console/out-of-band access for rollback.

Baseline configuration

The lab uses a minimal BGP baseline and then introduces only the policy feature under study. Representative configuration is shown below; exact interface names may differ by image.

router bgp 65001
 bgp router-id 10.255.1.1
 neighbor 192.0.2.2 remote-as 65002
 address-family ipv4
  neighbor 192.0.2.2 activate
  network 192.0.2.0 mask 255.255.255.0
 exit-address-family

Verification before modification

Use evidence rather than assumptions:

show ip bgp summary
show ip bgp
show ip bgp neighbors 192.0.2.2 advertised-routes
show ip bgp neighbors 192.0.2.2 received-routes
show ip bgp 192.0.2.0/24

Record the session state, prefix counts, selected path, relevant attributes and advertisement state before changing policy.

Controlled modification

Change an inbound community policy, request a route refresh from the peer, and compare the result with a disruptive session reset. Document when route refresh is available, what information is re-requested, and why stored soft-reconfiguration state can have memory implications.

Fault injection

Illustrative lab — not a real incident. Inject one deliberate policy error: either omit the required send-community capability, invert a permit/deny condition, or apply the policy in the wrong direction. The fault must be introduced independently from the baseline so the learner can prove causality.

Expected symptoms include a route missing a tag, a prefix unexpectedly accepted or rejected, an attribute not being propagated, or an advertisement disappearing from Adj-RIB-Out.

Troubleshooting

  1. Define the affected prefix and peer.
  2. Confirm the BGP session is Established.
  3. Inspect the route in Adj-RIB-In.
  4. Inspect the relevant attribute/community state.
  5. Verify the policy match condition.
  6. Verify the policy direction.
  7. Inspect the selected best path.
  8. Inspect Adj-RIB-Out toward the affected neighbor.
  9. Check whether the capability required for attribute exchange is enabled.
  10. Apply the smallest correction and re-check both control-plane and forwarding results.

Root cause

The smallest proven root cause should be stated only after the evidence chain identifies where the expected policy state diverged from the observed state. Do not blame “BGP” when the evidence points to a policy predicate, attribute propagation rule, address-family activation or missing capability.

Post-fix verification

Verify the peer, prefix, attribute state, selected path, advertised path and traffic behavior. For policy-only changes, also verify that the session did not flap unnecessarily.

Rollback

Remove the new policy or restore the previous sequence, then re-verify the same evidence points used before the change. If the change affects an Internet edge, use out-of-band access and a predefined rollback trigger.

Production lessons

  • Treat BGP policy as code: explicit inputs, deterministic predicates and observable outputs.
  • Prefer reusable metadata over repeated prefix-specific rules where the architecture supports it.
  • Keep import and export intent separate.
  • Verify both sides of a policy boundary.
  • Never assume an attribute is being exchanged merely because it exists locally.

Knowledge check

  1. What is the difference between a route tag and a route decision attribute?
  2. What evidence proves that an outbound policy actually changed Adj-RIB-Out?
  3. Why is a policy change safer when it can be refreshed without tearing down the BGP session?

Answers

  1. A tag such as a community carries policy metadata; a decision attribute such as LOCAL_PREF directly influences selection.
  2. The neighbor’s advertised-route view, combined with the route’s attribute state, proves the outbound result.
  3. Avoiding an unnecessary session reset reduces convergence disruption and preserves established control-plane state.

Sources

  • Cisco command reference: https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/iproute_bgp/command/irg-cr-book/bgp-c1.html
  • Cisco route refresh: https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9600/software/release/17-18/command_reference/b_1718_9600_cr/ip_routing_commands.html

Publishing assets

  • Excerpt: A policy change should not automatically become a routing outage. Modern BGP provides mechanisms for re-evaluating routes without tearing down an established se
  • Social caption: BGP policy becomes safer when intent is explicit, metadata is reusable and every change is observable.
  • Hashtags: #BGP #Networking #Routing #Cisco #NetworkEngineering #NetOps
  • Diagram alt text: Day 30: BGP Policy Changes Without Flapping: Route Refresh, Soft Reset and Safe Rollback shown across a three-router BGP policy topology.

RETICUX BGP Mastery Day 29- BGP Import and Export Policy: The RFC 8212 Safety Boundary

BGP Import and Export Policy: The RFC 8212 Safety Boundary

Opening

An EBGP session is a routing boundary between administrative domains. Treating that boundary as an implicit “send everything, accept everything” relationship is a preventable operational risk. RFC 8212 formalizes explicit import and export policy as the safer model.


BGP Import and Export Policy: The RFC 8212 Safety Boundary
BGP Import and Export Policy: The RFC 8212 Safety Boundary


Learning objectives

  • Explain the protocol mechanism precisely.
  • Distinguish standards behavior from Cisco implementation behavior.
  • Build a deterministic policy with explicit match and action logic.
  • Verify both received and advertised routing information.
  • Diagnose the failure mode and roll back safely.

Concept and standards behavior

A production BGP session needs an explicit statement of what may be accepted and what may be advertised. RFC 8212 updates RFC 4271 so routes on an EBGP session without explicit import/export policy are not eligible for decision or advertisement. The lab builds a default-deny edge and then adds narrowly scoped policy.

Implementation boundary: the standard defines the wire attribute and semantics; Cisco IOS XE syntax, defaults and verification commands must be checked against the selected 17.18.x platform documentation before claiming exact execution behavior.

Engineering scenario

The lab uses three documentation-safe routers: EDGE-A (AS 65001), TRANSIT-A (AS 65002) and EDGE-B (AS 65003). EDGE-A originates 192.0.2.0/24 and 198.51.100.0/24; EDGE-B provides a second policy domain. Loopbacks and point-to-point links use TEST-NET values. No production prefixes, credentials or real ASNs are used.

The engineering requirement is to express policy using reusable metadata and precise filters, then prove that the resulting Adj-RIB-In, best path and Adj-RIB-Out behavior match the intended policy.

Topology


BGP Import and Export Policy: The RFC 8212 Safety Boundary
BGP Import and Export Policy: The RFC 8212 Safety Boundary

        AS 65002 TRANSIT-A
       /                   \
  AS 65001 EDGE-A ---- AS 65003 EDGE-B
  192.0.2.0/24
  198.51.100.0/24

Prerequisites

  • Cisco IOS XE 17.18.x or a release with equivalent documented commands.
  • Working eBGP sessions.
  • Reachability between BGP next hops.
  • Address family ipv4 unicast enabled.
  • Console/out-of-band access for rollback.

Baseline configuration

The lab uses a minimal BGP baseline and then introduces only the policy feature under study. Representative configuration is shown below; exact interface names may differ by image.

router bgp 65001
 bgp router-id 10.255.1.1
 neighbor 192.0.2.2 remote-as 65002
 address-family ipv4
  neighbor 192.0.2.2 activate
  network 192.0.2.0 mask 255.255.255.0
 exit-address-family

Verification before modification

Use evidence rather than assumptions:

show ip bgp summary
show ip bgp
show ip bgp neighbors 192.0.2.2 advertised-routes
show ip bgp neighbors 192.0.2.2 received-routes
show ip bgp 192.0.2.0/24

Record the session state, prefix counts, selected path, relevant attributes and advertisement state before changing policy.

Controlled modification

Start with no EBGP import/export policy, then explicitly permit only 192.0.2.0/24 inbound and only 198.51.100.0/24 outbound. Show how the explicit policy changes the eligible routes and advertisements, and explain the RFC 8212 model separately from platform-specific defaults.

Fault injection

Illustrative lab — not a real incident. Inject one deliberate policy error: either omit the required send-community capability, invert a permit/deny condition, or apply the policy in the wrong direction. The fault must be introduced independently from the baseline so the learner can prove causality.

Expected symptoms include a route missing a tag, a prefix unexpectedly accepted or rejected, an attribute not being propagated, or an advertisement disappearing from Adj-RIB-Out.

Troubleshooting

  1. Define the affected prefix and peer.
  2. Confirm the BGP session is Established.
  3. Inspect the route in Adj-RIB-In.
  4. Inspect the relevant attribute/community state.
  5. Verify the policy match condition.
  6. Verify the policy direction.
  7. Inspect the selected best path.
  8. Inspect Adj-RIB-Out toward the affected neighbor.
  9. Check whether the capability required for attribute exchange is enabled.
  10. Apply the smallest correction and re-check both control-plane and forwarding results.

Root cause

The smallest proven root cause should be stated only after the evidence chain identifies where the expected policy state diverged from the observed state. Do not blame “BGP” when the evidence points to a policy predicate, attribute propagation rule, address-family activation or missing capability.

Post-fix verification

Verify the peer, prefix, attribute state, selected path, advertised path and traffic behavior. For policy-only changes, also verify that the session did not flap unnecessarily.

Rollback

Remove the new policy or restore the previous sequence, then re-verify the same evidence points used before the change. If the change affects an Internet edge, use out-of-band access and a predefined rollback trigger.

Production lessons

  • Treat BGP policy as code: explicit inputs, deterministic predicates and observable outputs.
  • Prefer reusable metadata over repeated prefix-specific rules where the architecture supports it.
  • Keep import and export intent separate.
  • Verify both sides of a policy boundary.
  • Never assume an attribute is being exchanged merely because it exists locally.

Knowledge check

  1. What is the difference between a route tag and a route decision attribute?
  2. What evidence proves that an outbound policy actually changed Adj-RIB-Out?
  3. Why is a policy change safer when it can be refreshed without tearing down the BGP session?

Answers

  1. A tag such as a community carries policy metadata; a decision attribute such as LOCAL_PREF directly influences selection.
  2. The neighbor’s advertised-route view, combined with the route’s attribute state, proves the outbound result.
  3. Avoiding an unnecessary session reset reduces convergence disruption and preserves established control-plane state.

Sources

  • RFC 8212: https://www.rfc-editor.org/rfc/rfc8212
  • Cisco communities: https://www.cisco.com/c/en/us/td/docs/routers/ios/config/17-x/ip-routing/b-ip-routing/m_irg-external-sp-0.html

Publishing assets

  • Excerpt: An EBGP session is a routing boundary between administrative domains. Treating that boundary as an implicit “send everything, accept everything” relationship is
  • Social caption: BGP policy becomes safer when intent is explicit, metadata is reusable and every change is observable.
  • Hashtags: #BGP #Networking #Routing #Cisco #NetworkEngineering #NetOps
  • Diagram alt text: Day 29: BGP Import and Export Policy: The RFC 8212 Safety Boundary shown across a three-router BGP policy topology.

RETICUX BGP Mastery Day 28- BGP Policy Match Tools: Prefix Lists, AS-Path ACLs and Community Lists —

BGP Policy Match Tools: Prefix Lists, AS-Path ACLs and Community Lists


BGP Policy Match Tools: Prefix Lists, AS-Path ACLs and Community Lists
BGP Policy Match Tools: Prefix Lists, AS-Path ACLs and Community Lists


Opening

BGP policy becomes dangerous when every decision is encoded as a long list of unrelated exceptions. The safer approach is to separate matching primitives from policy actions and make every permit and deny explainable.

Learning objectives

  • Explain the protocol mechanism precisely.
  • Distinguish standards behavior from Cisco implementation behavior.
  • Build a deterministic policy with explicit match and action logic.
  • Verify both received and advertised routing information.
  • Diagnose the failure mode and roll back safely.

Concept and standards behavior

Reliable BGP policy begins with precise match conditions. Prefix lists answer “which prefixes?”, AS-path filters answer “which path identities?”, and community lists answer “which policy tags?”. Route maps combine these predicates with attribute-setting and permit/deny behavior. This post teaches the tools as composable policy primitives.

Implementation boundary: the standard defines the wire attribute and semantics; Cisco IOS XE syntax, defaults and verification commands must be checked against the selected 17.18.x platform documentation before claiming exact execution behavior.

Engineering scenario

The lab uses three documentation-safe routers: EDGE-A (AS 65001), TRANSIT-A (AS 65002) and EDGE-B (AS 65003). EDGE-A originates 192.0.2.0/24 and 198.51.100.0/24; EDGE-B provides a second policy domain. Loopbacks and point-to-point links use TEST-NET values. No production prefixes, credentials or real ASNs are used.

The engineering requirement is to express policy using reusable metadata and precise filters, then prove that the resulting Adj-RIB-In, best path and Adj-RIB-Out behavior match the intended policy.

Topology


BGP Policy Match Tools: Prefix Lists, AS-Path ACLs and Community Lists
BGP Policy Match Tools: Prefix Lists, AS-Path ACLs and Community Lists

        AS 65002 TRANSIT-A
       /                   \
  AS 65001 EDGE-A ---- AS 65003 EDGE-B
  192.0.2.0/24
  198.51.100.0/24

Prerequisites

  • Cisco IOS XE 17.18.x or a release with equivalent documented commands.
  • Working eBGP sessions.
  • Reachability between BGP next hops.
  • Address family ipv4 unicast enabled.
  • Console/out-of-band access for rollback.

Baseline configuration

The lab uses a minimal BGP baseline and then introduces only the policy feature under study. Representative configuration is shown below; exact interface names may differ by image.

router bgp 65001
 bgp router-id 10.255.1.1
 neighbor 192.0.2.2 remote-as 65002
 address-family ipv4
  neighbor 192.0.2.2 activate
  network 192.0.2.0 mask 255.255.255.0
 exit-address-family

Verification before modification

Use evidence rather than assumptions:

show ip bgp summary
show ip bgp
show ip bgp neighbors 192.0.2.2 advertised-routes
show ip bgp neighbors 192.0.2.2 received-routes
show ip bgp 192.0.2.0/24

Record the session state, prefix counts, selected path, relevant attributes and advertisement state before changing policy.

Controlled modification

Build a policy with three predicates: prefix-list selects 192.0.2.0/24, AS-path access-list rejects an unwanted transit path, and community-list selects tagged routes. Combine them in route-map sequences and demonstrate implicit deny behavior.

Fault injection

Illustrative lab — not a real incident. Inject one deliberate policy error: either omit the required send-community capability, invert a permit/deny condition, or apply the policy in the wrong direction. The fault must be introduced independently from the baseline so the learner can prove causality.

Expected symptoms include a route missing a tag, a prefix unexpectedly accepted or rejected, an attribute not being propagated, or an advertisement disappearing from Adj-RIB-Out.

Troubleshooting

  1. Define the affected prefix and peer.
  2. Confirm the BGP session is Established.
  3. Inspect the route in Adj-RIB-In.
  4. Inspect the relevant attribute/community state.
  5. Verify the policy match condition.
  6. Verify the policy direction.
  7. Inspect the selected best path.
  8. Inspect Adj-RIB-Out toward the affected neighbor.
  9. Check whether the capability required for attribute exchange is enabled.
  10. Apply the smallest correction and re-check both control-plane and forwarding results.

Root cause

The smallest proven root cause should be stated only after the evidence chain identifies where the expected policy state diverged from the observed state. Do not blame “BGP” when the evidence points to a policy predicate, attribute propagation rule, address-family activation or missing capability.

Post-fix verification

Verify the peer, prefix, attribute state, selected path, advertised path and traffic behavior. For policy-only changes, also verify that the session did not flap unnecessarily.

Rollback

Remove the new policy or restore the previous sequence, then re-verify the same evidence points used before the change. If the change affects an Internet edge, use out-of-band access and a predefined rollback trigger.

Production lessons

  • Treat BGP policy as code: explicit inputs, deterministic predicates and observable outputs.
  • Prefer reusable metadata over repeated prefix-specific rules where the architecture supports it.
  • Keep import and export intent separate.
  • Verify both sides of a policy boundary.
  • Never assume an attribute is being exchanged merely because it exists locally.

Knowledge check

  1. What is the difference between a route tag and a route decision attribute?
  2. What evidence proves that an outbound policy actually changed Adj-RIB-Out?
  3. Why is a policy change safer when it can be refreshed without tearing down the BGP session?

Answers

  1. A tag such as a community carries policy metadata; a decision attribute such as LOCAL_PREF directly influences selection.
  2. The neighbor’s advertised-route view, combined with the route’s attribute state, proves the outbound result.
  3. Avoiding an unnecessary session reset reduces convergence disruption and preserves established control-plane state.

Sources

  • Cisco command reference: https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/iproute_bgp/command/irg-cr-book/bgp-c1.html
  • Cisco route-map continue: https://www.cisco.com/c/en/us/td/docs/routers/ios/config/17-x/ip-routing/b-ip-routing/m_irg-route-map-continue.html

Publishing assets

  • Excerpt: BGP policy becomes dangerous when every decision is encoded as a long list of unrelated exceptions. The safer approach is to separate matching primitives from p
  • Social caption: BGP policy becomes safer when intent is explicit, metadata is reusable and every change is observable.
  • Hashtags: #BGP #Networking #Routing #Cisco #NetworkEngineering #NetOps
  • Diagram alt text: Day 28: BGP Policy Match Tools: Prefix Lists, AS-Path ACLs and Community Lists shown across a three-router BGP policy topology.

RETICUX BGP Mastery -Day 27 - BGP Large Communities: Policy That Survives Four-Byte ASNs —

BGP Large Communities: Policy That Survives Four-Byte ASNs

Opening

The original community format was designed around two-octet ASNs. Modern routing uses four-octet ASNs, and operators still need compact, transitive policy metadata. Large Communities were designed for that exact operational gap.


BGP Large Communities: Policy That Survives Four-Byte ASNs
BGP Large Communities: Policy That Survives Four-Byte ASNs 


Learning objectives

  • Explain the protocol mechanism precisely.
  • Distinguish standards behavior from Cisco implementation behavior.
  • Build a deterministic policy with explicit match and action logic.
  • Verify both received and advertised routing information.
  • Diagnose the failure mode and roll back safely.

Concept and standards behavior

Large Communities solve a key scaling problem in the original two-octet-ASN community convention. RFC 8092 defines a 12-octet value made from a four-octet Global Administrator and two four-octet operator-defined fields. Cisco IOS XE 17.18.x provides large-community lists, matching, setting and verification.

Implementation boundary: the standard defines the wire attribute and semantics; Cisco IOS XE syntax, defaults and verification commands must be checked against the selected 17.18.x platform documentation before claiming exact execution behavior.

Engineering scenario

The lab uses three documentation-safe routers: EDGE-A (AS 65001), TRANSIT-A (AS 65002) and EDGE-B (AS 65003). EDGE-A originates 192.0.2.0/24 and 198.51.100.0/24; EDGE-B provides a second policy domain. Loopbacks and point-to-point links use TEST-NET values. No production prefixes, credentials or real ASNs are used.

The engineering requirement is to express policy using reusable metadata and precise filters, then prove that the resulting Adj-RIB-In, best path and Adj-RIB-Out behavior match the intended policy.

Topology


BGP Large Communities: Policy That Survives Four-Byte ASNs
BGP Large Communities: Policy That Survives Four-Byte ASNs 

        AS 65002 TRANSIT-A
       /                   \
  AS 65001 EDGE-A ---- AS 65003 EDGE-B
  192.0.2.0/24
  198.51.100.0/24

Prerequisites

  • Cisco IOS XE 17.18.x or a release with equivalent documented commands.
  • Working eBGP sessions.
  • Reachability between BGP next hops.
  • Address family ipv4 unicast enabled.
  • Console/out-of-band access for rollback.

Baseline configuration

The lab uses a minimal BGP baseline and then introduces only the policy feature under study. Representative configuration is shown below; exact interface names may differ by image.

router bgp 65001
 bgp router-id 10.255.1.1
 neighbor 192.0.2.2 remote-as 65002
 address-family ipv4
  neighbor 192.0.2.2 activate
  network 192.0.2.0 mask 255.255.255.0
 exit-address-family

Verification before modification

Use evidence rather than assumptions:

show ip bgp summary
show ip bgp
show ip bgp neighbors 192.0.2.2 advertised-routes
show ip bgp neighbors 192.0.2.2 received-routes
show ip bgp 192.0.2.0/24

Record the session state, prefix counts, selected path, relevant attributes and advertisement state before changing policy.

Controlled modification

Define a large-community convention such as 65001:100:1 for customer-originated routes. Match the large community in a route map, set it on export and verify the value on the peer. Compare the semantics with a legacy 65001:100 standard community.

Fault injection

Illustrative lab — not a real incident. Inject one deliberate policy error: either omit the required send-community capability, invert a permit/deny condition, or apply the policy in the wrong direction. The fault must be introduced independently from the baseline so the learner can prove causality.

Expected symptoms include a route missing a tag, a prefix unexpectedly accepted or rejected, an attribute not being propagated, or an advertisement disappearing from Adj-RIB-Out.

Troubleshooting

  1. Define the affected prefix and peer.
  2. Confirm the BGP session is Established.
  3. Inspect the route in Adj-RIB-In.
  4. Inspect the relevant attribute/community state.
  5. Verify the policy match condition.
  6. Verify the policy direction.
  7. Inspect the selected best path.
  8. Inspect Adj-RIB-Out toward the affected neighbor.
  9. Check whether the capability required for attribute exchange is enabled.
  10. Apply the smallest correction and re-check both control-plane and forwarding results.

Root cause

The smallest proven root cause should be stated only after the evidence chain identifies where the expected policy state diverged from the observed state. Do not blame “BGP” when the evidence points to a policy predicate, attribute propagation rule, address-family activation or missing capability.

Post-fix verification

Verify the peer, prefix, attribute state, selected path, advertised path and traffic behavior. For policy-only changes, also verify that the session did not flap unnecessarily.

Rollback

Remove the new policy or restore the previous sequence, then re-verify the same evidence points used before the change. If the change affects an Internet edge, use out-of-band access and a predefined rollback trigger.

Production lessons

  • Treat BGP policy as code: explicit inputs, deterministic predicates and observable outputs.
  • Prefer reusable metadata over repeated prefix-specific rules where the architecture supports it.
  • Keep import and export intent separate.
  • Verify both sides of a policy boundary.
  • Never assume an attribute is being exchanged merely because it exists locally.

Knowledge check

  1. What is the difference between a route tag and a route decision attribute?
  2. What evidence proves that an outbound policy actually changed Adj-RIB-Out?
  3. Why is a policy change safer when it can be refreshed without tearing down the BGP session?

Answers

  1. A tag such as a community carries policy metadata; a decision attribute such as LOCAL_PREF directly influences selection.
  2. The neighbor’s advertised-route view, combined with the route’s attribute state, proves the outbound result.
  3. Avoiding an unnecessary session reset reduces convergence disruption and preserves established control-plane state.

Sources

  • RFC 8092: https://www.rfc-editor.org/rfc/rfc8092
  • Cisco large community: https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9600/software/release/17-18/configuration_guide/rtng/b_1718_rtng_9600_cg/configuring_bgp_large_community.html

Publishing assets

  • Excerpt: The original community format was designed around two-octet ASNs. Modern routing uses four-octet ASNs, and operators still need compact, transitive policy metad
  • Social caption: BGP policy becomes safer when intent is explicit, metadata is reusable and every change is observable.
  • Hashtags: #BGP #Networking #Routing #Cisco #NetworkEngineering #NetOps
  • Diagram alt text: Day 27: BGP Large Communities: Policy That Survives Four-Byte ASNs shown across a three-router BGP policy topology.

Featured Post

Day 41 — BGP Confederations: Sub-AS Design, External View and Migration

1. Opening Confederations are another way to scale BGP inside a large administrative domain. They divide the domain into member autonomous systems while presenting a single confederation identifier to external peers. They are powerful, but their operational model is more complex than simply 'using private ASNs inside.' The engineering goal is not to memorize another BGP command. It is to understand what information each speaker is allowed to propagate, what path information can be hidden, and what failure domain is created by the chosen control-plane architecture . 2. Concept and standards behavior RFC 5065 defines AS_CONFED_SEQUENCE and AS_CONFED_SET and how member-AS relationships are represented. Confederation external sessions have eBGP-like properties inside the confederation, while the confederation is presented externally as one AS. Modern guidance must also account for the fact that RFC 9774 prohibits new origination of AS_SET/AS_CONFED_SET in ordinary aggregation c...