3level_nested_policies - openconfig/featureprofiles GitHub Wiki
- AS-path prepending by more the 10 repetitions
- Recursive policy subroutines (multi-level nesting). At least 3 levels
- match-set-options of ANY, INVERT for match-prefix-set conditions
- Applicable to both IPv4 and IPv6 BGP neighbors
For each section of configuration below, prepare a gnmi.SetBatch with all the configuration items appended to one SetBatch. Then apply the configuration to the DUT in one gnmi.Set using the replace
option
- Connect DUT port-1, 2 to ATE port-1, 2
- Configure IPv4/IPv6 addresses on the ports
- Create an IPv4 networks i.e.
ipv4-network-1 = 192.168.10.0/24
attached to ATE port-1 - Create an IPv6 networks i.e.
ipv6-network-1 = 2024:db8:128:128::/64
attached to ATE port-1 - Create an IPv4 networks i.e.
ipv4-network-2 = 192.168.20.0/24
attached to ATE port-2 - Create an IPv6 networks i.e.
ipv6-network-2 = 2024:db8:64:64::/64
attached to ATE port-2 - Configure IPv4 and IPv6 eBGP between DUT Port-1 and ATE Port-1
- Note: Nested policies will be applied to this eBGP session later in the test to validate the results
- /network-instances/network-instance/protocols/protocol/bgp/global/config
- /network-instances/network-instance/protocols/protocol/bgp/global/afi-safis/afi-safi/config/
- Advertise
ipv4-network-1 = 192.168.10.0/24
andipv6-network-1 = 2024:db8:128:128::/64
from ATE to DUT over the IPv4 and IPv6 eBGP session on port-1 - Configure DUT to advertise standard communities to ATE
- /network-instances/network-instance/protocols/protocol/bgp/global/afi-safis/afi-safi/config/send-community-type =
STANDARD
- /network-instances/network-instance/protocols/protocol/bgp/global/afi-safis/afi-safi/config/send-community-type =
- Configure IPv4 and IPv6 eBGP between DUT Port-2 and ATE Port-2
- Note: This eBGP session is only used to advertise prefixes to DUT and receive prefixes from DUT
- /network-instances/network-instance/protocols/protocol/bgp/global/config
- /network-instances/network-instance/protocols/protocol/bgp/global/afi-safis/afi-safi/config/
- Advertise
ipv4-network-2 = 192.168.20.0/24
andipv6-network-2 = 2024:db8:64:64::/64
from ATE to DUT over the IPv4 and IPv6 eBGP session on port-2 - Set default import and export policy to
ACCEPT_ROUTE
for this eBGP session only- /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/default-import-policy
- /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/default-export-policy
Parent Route Policy: Configure a route-policy to inverse match any prefix in the given prefix-set (INVERT)
- Note: This parent policy will be applied to both import and export route policy on the neighbor.
- This policy will call unique nested policies for both import and export scenarios defined in the sub-tests
- Configure an IPv4 route-policy definition with the name
invert-policy-v4
- /routing-policy/policy-definitions/policy-definition/config/name
- For routing-policy
invert-policy-v4
configure a statement with the nameinvert-statement-v4
- /routing-policy/policy-definitions/policy-definition/statements/statement/config/name
- For routing-policy
invert-policy-v4
statementinvert-statement-v4
set policy-result asNEXT_STATEMENT
- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/config/policy-result
- Configure a prefix-set with the name
prefix-set-v4
and modeIPV4
- /routing-policy/defined-sets/prefix-sets/prefix-set/config/name
- /routing-policy/defined-sets/prefix-sets/prefix-set/config/mode
- For prefix-set
prefix-set-v4
set the ip-prefix to10.0.0.0/8
and masklength toexact
- Our intention is to allow the prefix that does not match 10.0.0.0/8 (inverse the match result)
- /routing-policy/defined-sets/prefix-sets/prefix-set/prefixes/prefix/config/ip-prefix
- /routing-policy/defined-sets/prefix-sets/prefix-set/prefixes/prefix/config/masklength-range
- For routing-policy
invert-policy-v4
statementinvert-statement-v4
set match options toINVERT
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/match-prefix-set/config/match-set-options
- For routing-policy
invert-policy-v4
statementinvert-statement-v4
set prefix set toprefix-set-v4
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/match-prefix-set/config/prefix-set
- Configure an IPv4 route-policy definition with the name
match-import-policy-v4
- /routing-policy/policy-definitions/policy-definition/config/name
- For routing-policy
match-import-policy-v4
configure a statement with the namematch-statement-v4
- /routing-policy/policy-definitions/policy-definition/statements/statement/config/name
- For routing-policy
match-import-policy-v4
statementmatch-statement-v4
set policy-result asNEXT_STATEMENT
- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/config/policy-result
- Configure a prefix-set with the name
prefix-set-v4
and modeIPV4
- /routing-policy/defined-sets/prefix-sets/prefix-set/config/name
- /routing-policy/defined-sets/prefix-sets/prefix-set/config/mode
- For prefix-set
prefix-set-v4
set the ip-prefix toipv4-network-1
i.e.192.168.10.0/24
and masklength toexact
- /routing-policy/defined-sets/prefix-sets/prefix-set/prefixes/prefix/config/ip-prefix
- /routing-policy/defined-sets/prefix-sets/prefix-set/prefixes/prefix/config/masklength-range
- For routing-policy
match-import-policy-v4
statementmatch-statement-v4
set match options toANY
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/match-prefix-set/config/match-set-options
- For routing-policy
match-import-policy-v4
statementmatch-statement-v4
set prefix set toprefix-set-v4
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/match-prefix-set/config/prefix-set
- Configure an IPv4 route-policy definition with the name
lp-policy-v4
- /routing-policy/policy-definitions/policy-definition/config/name
- For routing-policy
lp-policy-v4
configure a statement with the namelp-statement-v4
- /routing-policy/policy-definitions/policy-definition/statements/statement/config/name
- For routing-policy
lp-policy-v4
statementlp-statement-v4
set policy-result asNEXT_STATEMENT
- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/config/policy-result
- For routing-policy
lp-policy-v4
statementlp-statement-v4
set local-preference to200
- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/config/set-local-pref
- Configure an IPv4 route-policy definition with the name
community-policy-v4
- /routing-policy/policy-definitions/policy-definition/config/name
- For routing-policy
community-policy-v4
configure a statement with the namecommunity-statement-v4
- /routing-policy/policy-definitions/policy-definition/statements/statement/config/name
- For routing-policy
community-policy-v4
statementcommunity-statement-v4
set policy-result asACCEPT_ROUTE
- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/config/policy-result
- Configure a community set with name
community-set-v4
- /routing-policy/defined-sets/bgp-defined-sets/community-sets/community-set/config/community-set-name
- For community set
community-set-v4
configure a community member value to64512:100
- /routing-policy/defined-sets/bgp-defined-sets/community-sets/community-set/config/community-member
- For routing-policy
community-policy-v4
statementcommunity-statement-v4
reference the community setcommunity-set-v4
- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-community/reference/config/community-set-ref
- For Parent routing-policy
invert-policy-v4
and statementinvert-statement-v4
call the policymatch-import-policy-v4
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/config/call-policy
- For routing-policy
match-import-policy-v4
and statementmatch-statement-v4
call the policylp-policy-v4
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/config/call-policy
- For routing-policy
lp-policy-v4
and statementlp-statement-v4
call the policycommunity-policy-v4
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/config/call-policy
- Set default import policy to
REJECT_ROUTE
(Note: even though this is the OC default, the DUT should still accept this configuration)- /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/default-import-policy
- Apply the parent policy
invert-policy-v4
to the BGP neighbor- /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/import-policy
- Verify that the parent
invert-policy-v4
policy is successfully applied to the DUT BGP neighbor on ATE Port-1- /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/state/import-policy
- Verify that the parent
invert-policy-v4
policy has a child policymatch-import-policy-v4
attached- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/state/call-policy
- Verify that the sub-parent
match-import-policy-v4
policy has a child policylp-policy-v4
attached- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/state/call-policy
- Verify that the sub-parent
lp-policy-v4
policy has a child policycommunity-policy-v4
attached- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/state/call-policy
- Validate that the DUT receives the prefix
ipv4-network-1
i.e.192.168.10.0/24
from BGP neighbor on ATE Port-1- /network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/loc-rib/routes/route/prefix
- Validate that the prefix
ipv4-network-1
i.e.192.168.10.0/24
from BGP neighbor on ATE Port-1 has local preference of200
- /network-instances/network-instance/protocols/protocol/bgp/rib/attr-sets/attr-set/state/med
- Validate that the prefix
ipv4-network-1
i.e.192.168.10.0/24
from BGP neighbor on ATE Port-1 has community of64512:100
- /network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/loc-rib/routes/route/prefix
- /network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/loc-rib/routes/route/state/community-index
- Initiate traffic from ATE Port-2 towards the DUT destined to
ipv4-network-1
i.e.192.168.10.0/24
- Validate that the traffic is received on ATE Port-1
- Configure an IPv4 route-policy definition with the name
match-export-policy-v4
- /routing-policy/policy-definitions/policy-definition/config/name
- For routing-policy
match-export-policy-v4
configure a statement with the namematch-statement-v4
- /routing-policy/policy-definitions/policy-definition/statements/statement/config/name
- For routing-policy
match-export-policy-v4
statementmatch-statement-v4
set policy-result asNEXT_STATEMENT
- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/config/policy-result
- Configure a prefix-set with the name
prefix-set-v4
and modeIPV4
- /routing-policy/defined-sets/prefix-sets/prefix-set/config/name
- /routing-policy/defined-sets/prefix-sets/prefix-set/config/mode
- For prefix-set
prefix-set-v4
set the ip-prefix toipv4-network-2
i.e.192.168.20.0/24
and masklength toexact
- /routing-policy/defined-sets/prefix-sets/prefix-set/prefixes/prefix/config/ip-prefix
- /routing-policy/defined-sets/prefix-sets/prefix-set/prefixes/prefix/config/masklength-range
- For routing-policy
match-export-policy-v4
statementmatch-statement-v4
set match options toANY
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/match-prefix-set/config/match-set-options
- For routing-policy
match-export-policy-v4
statementmatch-statement-v4
set prefix set toprefix-set-v4
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/match-prefix-set/config/prefix-set
- Configure an IPv4 route-policy definition with the name
asp-policy-v4
- /routing-policy/policy-definitions/policy-definition/config/name
- For routing-policy
asp-policy-v4
configure a statement with the nameasp-statement-v4
- /routing-policy/policy-definitions/policy-definition/statements/statement/config/name
- For routing-policy
asp-policy-v4
statementasp-statement-v4
set policy-result asNEXT_STATEMENT
- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/config/policy-result
- For routing-policy
asp-policy-v4
statementasp-statement-v4
set AS-PATH prepend to the ASN of the DUT- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-as-path-prepend/config/asn
- For routing-policy
asp-policy-v4
statementasp-statement-v4
set the prepended ASN to repeat15
times- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-as-path-prepend/config/repeat-n
- Configure an IPv4 route-policy definition with the name
med-policy-v4
- /routing-policy/policy-definitions/policy-definition/config/name
- For routing-policy
med-policy-v4
configure a statement with the namemed-statement-v4
- /routing-policy/policy-definitions/policy-definition/statements/statement/config/name
- For routing-policy
med-policy-v4
statementmed-statement-v4
set policy-result asACCEPT_ROUTE
- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/config/policy-result
- For routing-policy
med-policy-v4
statementmed-statement-v4
set MED to1000
- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/config/set-med
- For Parent routing-policy
invert-policy-v4
and statementinvert-statement-v4
call the policymatch-export-policy-v4
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/config/call-policy
- For routing-policy
match-export-policy-v4
and statementmatch-statement-v4
call the policyasp-policy-v4
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/config/call-policy
- For routing-policy
asp-policy-v4
and statementasp-statement-v4
call the policymed-policy-v4
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/config/call-policy
- Set default export policy to
REJECT_ROUTE
(Note: even though this is the OC default, the DUT should still accept this configuration)- /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/default-export-policy
- Apply the parent policy
invert-export-policy-v4
to the BGP neighbor- /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/export-policy
- Verify that the parent
invert-policy-v4
policy is successfully applied to the DUT BGP neighbor on ATE Port-1- /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/state/export-policy
- Verify that the parent
invert-policy-v4
policy has a child policymatch-export-policy-v4
attached- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/state/call-policy
- Verify that the parent
match-export-policy-v4
policy has a child policyasp-policy-v4
attached- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/state/call-policy
- Verify that the parent
asp-policy-v4
policy has a child policymed-policy-v4
attached- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/state/call-policy
- Validate that the ATE receives the prefix
ipv4-network-2
i.e.192.168.20.0/24
from BGP neighbor on DUT Port-1- /network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/loc-rib/routes/route/prefix
- Validate that the prefix
ipv4-network-2
i.e.192.168.20.0/24
on ATE from BGP neighbor on DUT Port-1 has AS-PATH with the ASN of DUT occuring more than 10 times- /network-instances/network-instance/protocols/protocol/bgp/rib/attr-sets/attr-set/as-path/as-segment/state/member
- Validate that the prefix
ipv4-network-2
i.e.192.168.20.0/24
from BGP neighbor on DUT Port-1 has MED set to1000
- /network-instances/network-instance/protocols/protocol/bgp/rib/attr-sets/attr-set/state/med
- Initiate traffic from ATE Port-1 towards the DUT destined
ipv4-network-2
i.e.192.168.20.0/24
- Validate that the traffic is received on ATE Port-2
- Configure an IPv6 route-policy definition with the name
match-import-policy-v6
- /routing-policy/policy-definitions/policy-definition/config/name
- For routing-policy
match-import-policy-v6
configure a statement with the namematch-statement-v6
- /routing-policy/policy-definitions/policy-definition/statements/statement/config/name
- For routing-policy
match-import-policy-v6
statementmatch-statement-v6
set policy-result asNEXT_STATEMENT
- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/config/policy-result
- Configure a prefix-set with the name
prefix-set-v6
and modeIPV6
- /routing-policy/defined-sets/prefix-sets/prefix-set/config/name
- /routing-policy/defined-sets/prefix-sets/prefix-set/config/mode
- For prefix-set
prefix-set-v6
set the ip-prefix toipv6-network-1
i.e.2024:db8:128:128::/64
and masklength toexact
- /routing-policy/defined-sets/prefix-sets/prefix-set/prefixes/prefix/config/ip-prefix
- /routing-policy/defined-sets/prefix-sets/prefix-set/prefixes/prefix/config/masklength-range
- For routing-policy
match-import-policy-v6
statementmatch-statement-v6
set match options toANY
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/match-prefix-set/config/match-set-options
- For routing-policy
match-import-policy-v6
statementmatch-statement-v6
set prefix set toprefix-set-v6
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/match-prefix-set/config/prefix-set
- Configure an IPv6 route-policy definition with the name
lp-policy-v6
- /routing-policy/policy-definitions/policy-definition/config/name
- For routing-policy
lp-policy-v6
configure a statement with the namelp-statement-v6
- /routing-policy/policy-definitions/policy-definition/statements/statement/config/name
- For routing-policy
lp-policy-v6
statementlp-statement-v6
set policy-result asNEXT_STATEMENT
- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/config/policy-result
- For routing-policy
lp-policy-v6
statementlp-statement-v6
set local-preference to200
- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/config/set-local-pref
- Configure an IPv6 route-policy definition with the name
community-policy-v6
- /routing-policy/policy-definitions/policy-definition/config/name
- For routing-policy
community-policy-v6
configure a statement with the namecommunity-statement-v6
- /routing-policy/policy-definitions/policy-definition/statements/statement/config/name
- For routing-policy
community-policy-v6
statementcommunity-statement-v6
set policy-result asACCEPT_ROUTE
- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/config/policy-result
- Configure a community set with name
community-set-v6
- /routing-policy/defined-sets/bgp-defined-sets/community-sets/community-set/config/community-set-name
- For community set
community-set-v6
configure a community member value to64512:100
- /routing-policy/defined-sets/bgp-defined-sets/community-sets/community-set/config/community-member
- For routing-policy
community-policy-v6
statementcommunity-statement-v6
reference the community setcommunity-set-v6
- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-community/reference/config/community-set-ref
- For Parent routing-policy
invert-policy-v6
and statementinvert-statement-v6
call the policymatch-import-policy-v6
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/config/call-policy
- For routing-policy
match-import-policy-v6
and statementmatch-statement-v6
call the policylp-policy-v6
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/config/call-policy
- For routing-policy
lp-policy-v6
and statementlp-statement-v6
call the policycommunity-policy-v6
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/config/call-policy
- Set default import policy to
REJECT_ROUTE
(Note: even though this is the OC default, the DUT should still accept this configuration)- /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/default-import-policy
- Apply the parent policy
invert-policy-v6
to the BGP neighbor- /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/import-policy
- Verify that the parent
invert-policy-v6
policy is successfully applied to the DUT BGP neighbor on ATE Port-1- /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/state/import-policy
- Verify that the parent
invert-policy-v6
policy has a child policymatch-import-policy-v6
attached- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/state/call-policy
- Verify that the sub-parent
match-import-policy-v6
policy has a child policylp-policy-v6
attached- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/state/call-policy
- Verify that the sub-parent
lp-policy-v6
policy has a child policycommunity-policy-v6
attached- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/state/call-policy
- Validate that the DUT receives the prefix
ipv6-network-1
i.e.2024:db8:128:128::/64
from BGP neighbor on ATE Port-1- /network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv6-unicast/loc-rib/routes/route/prefix
- Validate that the prefix
ipv6-network-1
i.e.2024:db8:128:128::/64
from BGP neighbor on ATE Port-1 has local preference of200
- /network-instances/network-instance/protocols/protocol/bgp/rib/attr-sets/attr-set/state/med
- Validate that the prefix
ipv6-network-1
i.e.2024:db8:128:128::/64
from BGP neighbor on ATE Port-1 has community of64512:100
- /network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv6-unicast/loc-rib/routes/route/prefix
- /network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv6-unicast/loc-rib/routes/route/state/community-index
- Initiate traffic from ATE Port-2 towards the DUT destined to
ipv6-network-1
i.e.2024:db8:128:128::/64
- Validate that the traffic is received on ATE Port-1
- Configure an IPv6 route-policy definition with the name
match-export-policy-v6
- /routing-policy/policy-definitions/policy-definition/config/name
- For routing-policy
match-export-policy-v6
configure a statement with the namematch-statement-v6
- /routing-policy/policy-definitions/policy-definition/statements/statement/config/name
- For routing-policy
match-export-policy-v6
statementmatch-statement-v6
set policy-result asNEXT_STATEMENT
- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/config/policy-result
- Configure a prefix-set with the name
prefix-set-v6
and modeIPV6
- /routing-policy/defined-sets/prefix-sets/prefix-set/config/name
- /routing-policy/defined-sets/prefix-sets/prefix-set/config/mode
- For prefix-set
prefix-set-v6
set the ip-prefix toipv6-network-2
i.e.2024:db8:64:64::/64
and masklength toexact
- /routing-policy/defined-sets/prefix-sets/prefix-set/prefixes/prefix/config/ip-prefix
- /routing-policy/defined-sets/prefix-sets/prefix-set/prefixes/prefix/config/masklength-range
- For routing-policy
match-export-policy-v6
statementmatch-statement-v6
set match options toANY
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/match-prefix-set/config/match-set-options
- For routing-policy
match-export-policy-v6
statementmatch-statement-v6
set prefix set toprefix-set-v6
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/match-prefix-set/config/prefix-set
- Configure an IPv6 route-policy definition with the name
asp-policy-v6
- /routing-policy/policy-definitions/policy-definition/config/name
- For routing-policy
asp-policy-v6
configure a statement with the nameasp-statement-v6
- /routing-policy/policy-definitions/policy-definition/statements/statement/config/name
- For routing-policy
asp-policy-v6
statementasp-statement-v6
set policy-result asNEXT_STATEMENT
- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/config/policy-result
- For routing-policy
asp-policy-v6
statementasp-statement-v6
set AS-PATH prepend to the ASN of the DUT- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-as-path-prepend/config/asn
- For routing-policy
asp-policy-v6
statementasp-statement-v6
set the prepended ASN to repeat15
times- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-as-path-prepend/config/repeat-n
- Configure an IPv6 route-policy definition with the name
med-policy-v6
- /routing-policy/policy-definitions/policy-definition/config/name
- For routing-policy
med-policy-v6
configure a statement with the namemed-statement-v6
- /routing-policy/policy-definitions/policy-definition/statements/statement/config/name
- For routing-policy
med-policy-v6
statementmed-statement-v6
set policy-result asACCEPT_ROUTE
- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/config/policy-result
- For routing-policy
med-policy-v6
statementmed-statement-v6
set MED to1000
- /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/config/set-med
- For Parent routing-policy
invert-policy-v6
and statementinvert-statement-v6
call the policymatch-export-policy-v6
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/config/call-policy
- For routing-policy
match-export-policy-v6
and statementmatch-statement-v6
call the policyasp-policy-v6
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/config/call-policy
- For routing-policy
asp-policy-v6
and statementasp-statement-v6
call the policymed-policy-v6
- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/config/call-policy
- Set default export policy to
REJECT_ROUTE
(Note: even though this is the OC default, the DUT should still accept this configuration)- /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/default-export-policy
- Apply the parent policy
invert-export-policy-v6
to the BGP neighbor- /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/export-policy
- Verify that the parent
invert-policy-v6
policy is successfully applied to the DUT BGP neighbor on ATE Port-1- /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/state/export-policy
- Verify that the parent
invert-policy-v6
policy has a child policymatch-export-policy-v6
attached- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/state/call-policy
- Verify that the parent
match-export-policy-v6
policy has a child policyasp-policy-v6
attached- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/state/call-policy
- Verify that the parent
asp-policy-v6
policy has a child policymed-policy-v6
attached- /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/state/call-policy
- Validate that the ATE receives the prefix
ipv6-network-2
i.e.2024:db8:64:64::/64
from BGP neighbor on DUT Port-1- /network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv6-unicast/loc-rib/routes/route/prefix
- Validate that the prefix
ipv6-network-2
i.e.2024:db8:64:64::/64
on ATE from BGP neighbor on DUT Port-1 has AS-PATH with the ASN of DUT occuring more than 10 times- /network-instances/network-instance/protocols/protocol/bgp/rib/attr-sets/attr-set/as-path/as-segment/state/member
- Validate that the prefix
ipv6-network-2
i.e.2024:db8:64:64::/64
from BGP neighbor on DUT Port-1 has MED set to1000
- /network-instances/network-instance/protocols/protocol/bgp/rib/attr-sets/attr-set/state/med
- Initiate traffic from ATE Port-1 towards the DUT destined
ipv6-network-2
i.e.2024:db8:64:64::/64
- Validate that the traffic is received on ATE Port-2
The below yaml defines the OC paths intended to be covered by this test.
paths:
## Config parameter coverage
/routing-policy/policy-definitions/policy-definition/config/name:
/routing-policy/policy-definitions/policy-definition/statements/statement/config/name:
/routing-policy/policy-definitions/policy-definition/statements/statement/actions/config/policy-result:
/routing-policy/policy-definitions/policy-definition/statements/statement/conditions/config/call-policy:
/routing-policy/defined-sets/prefix-sets/prefix-set/config/name:
/routing-policy/defined-sets/prefix-sets/prefix-set/config/mode:
/routing-policy/defined-sets/prefix-sets/prefix-set/prefixes/prefix/config/ip-prefix:
/routing-policy/defined-sets/prefix-sets/prefix-set/prefixes/prefix/config/masklength-range:
/routing-policy/policy-definitions/policy-definition/statements/statement/conditions/match-prefix-set/config/match-set-options:
/routing-policy/policy-definitions/policy-definition/statements/statement/conditions/match-prefix-set/config/prefix-set:
/routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/config/set-med:
/routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-as-path-prepend/config/asn:
/routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-as-path-prepend/config/repeat-n:
/network-instances/network-instance/protocols/protocol/bgp/global/afi-safis/afi-safi/config/send-community-type:
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/default-import-policy:
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/import-policy:
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/default-export-policy:
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/export-policy:
## Telemetry parameter coverage
/routing-policy/policy-definitions/policy-definition/statements/statement/conditions/state/call-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/apply-policy/state/export-policy:
/network-instances/network-instance/protocols/protocol/bgp/rib/attr-sets/attr-set/as-path/as-segment/state/member:
/network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv6-unicast/loc-rib/routes/route/prefix:
/network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/loc-rib/routes/route/prefix:
/network-instances/network-instance/protocols/protocol/bgp/rib/attr-sets/attr-set/state/med:
/network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/loc-rib/routes/route/state/community-index:
## Protocol/RPC Parameter Coverage
rpcs:
gnmi:
gNMI.Get:
gNMI.Set:
- vRX