aspath_and_community_test - bstoll/featureprofiles GitHub Wiki

RT-7.4: BGP Policy AS Path Set and Community Set

Summary

BGP policy configuration for AS Paths and Community Sets

Procedure

  • RT-7.4.1 - Test setup

    • Generate config for 2 DUT ports, with DUT port 1 eBGP session to ATE port 1.

    • Generate config for ATE 2 ports, with ATE port 1 eBGP session to DUT port 1.

    • Configure ATE port 1 to advertise ipv4 and ipv6 prefixes using the following aspaths and communities:

      • prefix-set-1 with as path [100, 200, 300] and communities [100:1, 200:2, 300:3]
      • prefix-set-2 with as path [100, 400, 300] and communities [101:1]
      • prefix-set-3 with as path [109] and communities [109:1]
      • prefix-set-4 with as path [200] and communities [200:1]
      • prefix-set-5 with as path [300] and communities [100:1]
    • Establish eBGP sessions between ATE port-1 and DUT port-1

    • Generate traffic from ATE port-2 to all prefixes

    • Validate that traffic is received on ATE port-1 for all prefixes

  • RT-7.4.2 - Validate single routing-policy containing as-path-set and ext-community-set

    • Create a as-path-set named any_my_regex_aspath with members

      • { as-path-set-member = [ "(10[0-9]]|200)" ] }
    • Create a community-set named any_my_regex_comms with members and match options as follows:

      • { community-member = [ "10[0-9]:1" ] }
    • Create a policy-definition named 'path_and_community' with the following statements

      • statement[name='match_community']/
        • conditions/bgp-conditions/match-community-set/config/community-set = 'any_my_regex_comms'
        • conditions/bgp-conditions/match-community-set/config/match-set-options = ANY
        • actions/config/policy-result = ACCEPT_ROUTE
      • statement[name='match_as']/
        • conditions/bgp-conditions/match-as-path-set/config/as-path-set = 'any_my_regex_aspath'
        • conditions/bgp-conditions/match-as-path-set/config/match-set-options = ANY
        • actions/config/policy-result = ACCEPT_ROUTE
    • Send traffic

      • Verify traffic is forwarded for routes with matching policy
      • Verify traffic is not forwarded for routes without matching policy

Expected prefix matches

prefix-set path_and_community
prefix-set-1 accept
prefix-set-2 accept
prefix-set-3 accept
prefix-set-4 reject
prefix-set-5 reject

Config Parameter Coverage

Policy definition

  • /routing-policy/policy-definitions/policy-definition/config/name
  • /routing-policy/policy-definitions/policy-definition/statements/statement/config/name

Policy for community-set match

  • /routing-policy/defined-sets/bgp-defined-sets/community-sets/community-set/config/community-set-name
  • /routing-policy/defined-sets/bgp-defined-sets/community-sets/community-set/config/community-member
  • /routing-policy/defined-sets/bgp-defined-sets/community-sets/community-set/config/match-set-options
  • /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/bgp-conditions/config/community-set
  • /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/ import-policy

Policy for ext-community-set match

  • /routing-policy/defined-sets/bgp-defined-sets/ext-community-sets/ext-community-set/config/ext-community-set-name
  • /routing-policy/defined-sets/bgp-defined-sets/ext-community-sets/ext-community-set/config/ext-community-member
  • /routing-policy/defined-sets/bgp-defined-sets/ext-community-sets/ext-community-set/config/match-set-options
  • /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/bgp-conditions/config/ext-community-set
  • /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/ import-policy

Policy for as-path match

  • /routing-policy/defined-sets/bgp-defined-sets/as-path-sets/as-path-set/config/as-path-set-name
  • /routing-policy/defined-sets/bgp-defined-sets/as-path-sets/as-path-set/config/as-path-set-member
  • /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/bgp-conditions/match-as-path-set/config/as-path-set
  • /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/bgp-conditions/match-as-path-set/config/match-set-options
  • /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/ import-policy

Telemetry Parameter Coverage

Policy definition state

  • /routing-policy/policy-definitions/policy-definition/state/name
  • /routing-policy/policy-definitions/policy-definition/statements/statement/state/name

Policy for community-set match state

  • /routing-policy/defined-sets/bgp-defined-sets/community-sets/community-set/state/community-set-name
  • /routing-policy/defined-sets/bgp-defined-sets/community-sets/community-set/state/community-member
  • /routing-policy/defined-sets/bgp-defined-sets/community-sets/community-set/state/match-set-options
  • /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/bgp-conditions/state/community-set

Policy for ext-community-set match state

  • /routing-policy/defined-sets/bgp-defined-sets/ext-community-sets/ext-community-set/state/ext-community-set-name
  • /routing-policy/defined-sets/bgp-defined-sets/ext-community-sets/ext-community-set/state/ext-community-member
  • /routing-policy/defined-sets/bgp-defined-sets/ext-community-sets/ext-community-set/state/match-set-options
  • /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/bgp-conditions/state/ext-community-set

Policy for as-path match state

  • /routing-policy/defined-sets/bgp-defined-sets/as-path-sets/as-path-set/state/as-path-set-name
  • /routing-policy/defined-sets/bgp-defined-sets/as-path-sets/as-path-set/state/as-path-set-member
  • /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/bgp-conditions/match-as-path-set/state/as-path-set
  • /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/bgp-conditions/match-as-path-set/state/match-set-options

Paths to verify policy state

  • /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/state/export-policy
  • /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/state/import-policy

Paths to verify prefixes sent and received

  • /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/state/prefixes/sent
  • /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/state/prefixes/received-pre-policy
  • /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/state/prefixes/received
  • /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/state/prefixes/installed
⚠️ **GitHub.com Fallback** ⚠️