aspath_and_community_test - openconfig/featureprofiles GitHub Wiki
BGP policy configuration for AS Paths and Community Sets
-
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]
- prefix-set-1 with as path
-
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 followingstatements
- 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
- statement[name='match_community']/
-
Send traffic
- Verify traffic is forwarded for routes with matching policy
- Verify traffic is not forwarded for routes without matching policy
-
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 |
- /routing-policy/policy-definitions/policy-definition/config/name
- /routing-policy/policy-definitions/policy-definition/statements/statement/config/name
- /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
- /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
- /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
- /routing-policy/policy-definitions/policy-definition/state/name
- /routing-policy/policy-definitions/policy-definition/statements/statement/state/name
- /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
- /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
- /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
- /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
- /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
The below yaml defines the OC paths intended to be covered by this test. OC paths used for test setup are not listed here.
paths:
## Config paths
### 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/match-community-set/config/community-set:
/routing-policy/policy-definitions/policy-definition/statements/statement/conditions/bgp-conditions/match-community-set/config/match-set-options:
/routing-policy/policy-definitions/policy-definition/statements/statement/actions/config/policy-result:
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/import-policy:
## State paths
### 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:
### 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:
rpcs:
gnmi:
gNMI.Set:
gNMI.Get:
gNMI.Subscribe: