basic_static_route_support_test - openconfig/featureprofiles GitHub Wiki
This test validates the foundational routing capabilities for static routes on a DUT. It consolidates verification for:
- IPv4 and IPv6 static routes across DEFAULT, NON-DEFAULT, and MANAGEMENT network-instances.
- Cross-address family (XAF) next-hops (IPv4 route with IPv6 next-hop and vice-versa).
- Route properties: ECMP, metric, administrative distance (preference), and tags.
- Next-hop actions: DROP next-hops, invalid/blackhole next-hops, and disabling recursive next-hop resolution.
- Dynamic modifications: Adding and removing next-hops dynamically.
- Connect DUT port-1, port-2, port-3 and port-4 to ATE port-1, port-2, port-3 and port-4 respectively.
- Configure IPv4 and IPv6 addresses on DUT and ATE interfaces.
- Configure one IPv4 destination network
ipv4-network = 203.0.113.0/24connected to ATE port 1 and 2. - Configure one IPv6 destination network
ipv6-network = 2001:db8:128:128::/64connected to ATE port 1 and 2.
- Step 1 - Configure IPv4 and IPv6 static routes for ECMP by setting the values at
/network-instances/network-instance/protocols/protocol/static-routes/static/config/prefixand/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/config/next-hop:- Configure an IPv4 static route
ipv4-route-aon the DUT for destination203.0.113.0/24with the next-hop set to the IPv4 address of ATE port-1. - Configure an IPv4 static route
ipv4-route-bon the DUT for destination203.0.113.0/24with the next-hop set to the IPv4 address of ATE port-2. - Configure an IPv6 static route
ipv6-route-aon the DUT for destination2001:db8:128:128::/64with the next-hop set to the IPv6 address of ATE port-1. - Configure an IPv6 static route
ipv6-route-bon the DUT for destination2001:db8:128:128::/64with the next-hop set to the IPv6 address of ATE port-2.
- Configure an IPv4 static route
- Step 2 - Push configuration to DUT using gnmi.Set with REPLACE option.
- Step 3 - Validate both routes are configured and reported correctly by checking that
the value of
/network-instances/network-instance/protocols/protocol/static-routes/static/state/prefixmatches the configured prefixes. - Step 4 - Send IPv4 and IPv6 Traffic from ATE port-3 towards destination
203.0.113.0/24and2001:db8:128:128::/64. - Step 5 - Verify that traffic is received from DUT on both port-1 and port-2, confirming ECMP works.
- Step 1 - Set the value of
/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/config/metricto100for bothipv4-route-bandipv6-route-b. - Step 2 - Push configuration to DUT using gnmi.Set with REPLACE option.
- Step 3 - Validate that the metric is set correctly by checking that the value of
/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/state/metricis100. - Step 4 - Send Traffic from ATE port-3 towards destinations.
- Step 5 - Verify that traffic is received from DUT on port-1 and NOT on port-2 (as route-b has a higher metric).
- Step 1 - Set the value of
/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/config/preferenceto50for bothipv4-route-aandipv6-route-a. - Step 2 - Push configuration to DUT.
- Step 3 - Validate that the preference is set correctly by checking that the value of
/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/state/preferenceis50. - Step 4 - Send Traffic from ATE port-3 towards destinations.
- Step 5 - Verify that traffic is now received from DUT on port-2 and NOT on port-1 (as route-a has a higher preference value/lower priority).
- Step 1 - Configure a tag of value
10on the IPv4 and IPv6 static routes via/network-instances/network-instance/protocols/protocol/static-routes/static/config/set-tag. - Step 2 - Push configuration to DUT.
- Step 3 - Validate the tag is set correctly by checking that the value of
/network-instances/network-instance/protocols/protocol/static-routes/static/state/set-tagis10.
- Step 1 - Delete the configuration using a gNMI Set DELETE on the specific
metricandpreferencepaths foripv4-route-b,ipv6-route-b,ipv4-route-a, andipv6-route-a. - Step 2 - Configure IPv6 static route
2001:db8:128:128::/64with next-hops set to the IPv4 address of ATE port-1 and ATE port-2. - Step 3 - Configure IPv4 static route
203.0.113.0/24with next-hops set to the IPv6 address of ATE port-1 and ATE port-2. - Step 4 - Push configuration to DUT.
- Step 5 - Validate the routes are configured and the cross-family next-hops are
reported correctly by checking the next-hop IP addresses via
/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/state/next-hop. - Step 6 - Send Traffic from ATE port-3 towards both destinations.
- Step 7 - Verify that traffic is received from DUT on both port-1 and port-2 and ECMP works for both XAF routes.
- Step 1 - Configure an IPv4 static route for
203.0.113.0/24by setting/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/config/next-hopto the OpenConfiglocal-defined-next-hopvalueDROP. - Step 2 - Configure an IPv6 static route for
2001:db8:128:128::/64by setting/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/config/next-hopto the OpenConfiglocal-defined-next-hopvalueDROP. - Step 3 - Push configuration to DUT.
- Step 4 - Validate the route is configured and reported correctly.
- Step 5 - Send Traffic from ATE port-3 towards destinations.
- Step 6 - Verify that traffic is dropped on DUT and not received on port-1 and port-2.
- Step 1 - Configure IPv4 and IPv6 IS-IS between ATE port-1 <-> DUT port-1 and ATE port-2 <-> DUT port-2.
- Step 2 - Configure one IPv4
/32host route (198.51.100.100/32) and one IPv6/128host route (2001:db8::64:64::1/128) connected to ATE and advertised to DUT through both IS-IS adjacencies. - Step 3 - Configure an IPv4 static route for
203.0.113.0/24with next-hop198.51.100.100. Configure an IPv6 static route for2001:db8:128:128::/64with next-hop2001:db8::64:64::1. - Step 4 - Push configuration to DUT.
- Step 5 - Send Traffic and Verify that traffic is received from DUT.
- Step 6 - Disable static route next-hop recursive lookup by setting
/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/config/recursetofalse. - Step 7 - Push configuration to DUT.
- Step 8 - Validate by checking that the value of
/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/state/recurseisfalse. - Step 9 - Send Traffic and Verify that traffic is NOT received from DUT, as the recursive next-hop resolution is disabled.
- Step 1 - Configure one IPv4 static route with next-hops set to the IPv4 address of ATE port-2 (index 0) and port-3 (index 1).
- Step 2 - Push configuration to DUT.
- Step 3 - Update the static route by adding next-hops for ATE port-1 (index 2) and port-4 (index 3).
- Step 4 - Push configuration to DUT.
- Step 5 - Validate all four next-hops and indexes are reported correctly using the
/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/state/indexand/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/state/next-hoppaths. - Step 6 - Remove two next-hops (e.g., indexes 0 and 3).
- Step 7 - Push configuration to DUT and validate that only two next-hops remain.
- Step 1 - Configure a static route that resolves via a directly connected interface IP.
- Step 2 - Delete the IP address of that direct interface using a gNMI Set DELETE.
- Step 3 - Send Traffic.
- Step 4 - Verify the traffic drops, and the static route becomes inactive without crashing the device.
- Step 1 - Configure overlapping static routes:
10.0.0.0/8pointing to ATE port-1, and10.1.1.0/24pointing to ATE port-2. - Step 2 - Push configuration to DUT.
- Step 3 - Send traffic to destination
10.1.1.1. - Step 4 - Verify that traffic strictly adheres to Longest Prefix Match (LPM) routing and flows exclusively to ATE port-2.
- Step 1 - Configure Static Route A pointing to Next-Hop IP B.
- Step 2 - Configure Static Route B pointing to Next-Hop IP A.
- Step 3 - Push configuration to DUT.
- Step 4 - Verify the device's control plane detects or breaks the recursion loop safely without hanging or crashing.
{
"openconfig-network-instance:network-instances": {
"network-instance": [
{
"name": "default",
"config": {
"name": "default"
},
"protocols": {
"protocol": [
{
"identifier": "openconfig-policy-types:STATIC",
"name": "DEFAULT",
"config": {
"identifier": "openconfig-policy-types:STATIC",
"name": "DEFAULT"
},
"static-routes": {
"static": [
{
"prefix": "203.0.113.0/24",
"config": {
"prefix": "203.0.113.0/24",
"set-tag": "10"
},
"next-hops": {
"next-hop": [
{
"index": "0",
"config": {
"index": "0",
"metric": 100,
"preference": 50,
"next-hop": "192.0.2.1",
"recurse": true
}
}
]
}
}
]
}
}
]
}
}
]
}
}paths:
## Config Paths ##
/interfaces/interface/config/enabled:
/interfaces/interface/subinterfaces/subinterface/ipv4/config/enabled:
/interfaces/interface/subinterfaces/subinterface/ipv6/config/enabled:
/network-instances/network-instance/protocols/protocol/static-routes/static/config/prefix:
/network-instances/network-instance/protocols/protocol/static-routes/static/config/set-tag:
/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/config/next-hop:
/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/config/metric:
/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/config/preference:
/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/config/recurse:
## State Paths ##
/network-instances/network-instance/protocols/protocol/static-routes/static/state/prefix:
/network-instances/network-instance/protocols/protocol/static-routes/static/state/set-tag:
/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/state/next-hop:
/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/state/metric:
/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/state/preference:
/network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/state/recurse:
rpcs:
gnmi:
gNMI.Subscribe:
on_change: true
gNMI.Set:
replace: true- FFF