Static Route#
Virtual Networks → SRStatic Routes
Static routes enable connectivity to remote network elements that do not have a routing protocol enabled to advertise routes. A static route is either configured with one or more next-hop IP addresses, or as a blackhole route. A blackhole route will attract traffic for the entire subnet, but will discard packets if no longer prefix match is available in the routing table.
Example: if all outbound traffic is meant to pass through a firewall device, a default static route (0.0.0.0/0) could be configured with the next-hop IP address of the firewall.
Deployment of the static route
The StaticRoute resource can optionally configured with a list of TopoNodes on which the static route is configured. If no nodes are referenced, EDA will configure the static route on all nodes that the Router is configured on. Although static routes are not installed in the routing table if the next-hop is not a locally reachable IP address, configuring a static route with a non-local next-hop should be avoided.
To set up static routes in the default VRF, use
DefaultStaticRouteinstead.
Dependencies#
To configure this resource, the following resources must exist or be created alongside the StaticRoute
- The
Routerin which the static route will be configured
Referenced resources#
Router#
Static route prefixes configured in the StaticRoute resource are only configured in the VRF of the linked Router resource. The next-hop of the static routes should be reachable through a local interface (typically a RoutedInterface or IRBInterface) configured in the same Router.
TopoNode#
Optionally, a list of nodes can be provided on which the static route is deployed. EDA does not determine on which nodes the next-hop IP address is reachable through a local interface, but instead deploys the static route on ALL nodes that the Router is configured on, if no nodes are specified.
Examples#
cat << 'EOF' | kubectl apply -f -
apiVersion: protocols.eda.nokia.com/v2
kind: StaticRoute
metadata:
name: my-static-route
namespace: eda
spec:
nexthopGroup:
blackhole: false
nexthops:
- ipPrefix: 192.168.1.254
resolve: false
resolve: false
nodes:
- leaf-1
prefixes:
- 10.0.1.0/24
- 10.0.2.0/24
router: test-router
EOF
Custom Resource Definition#
To browse the Custom Resource Definition go to crd.eda.dev.
StaticRoute
SPEC
StaticRoute allows for the specification of destination prefixes, route preferences, and the associated Router. It also supports configuring nexthop groups and specifying the nodes where the static routes should be provisioned.
-
The name of the static route to configure on the device.
-
Group of nexthops for the list of prefixes.
-
Enables BFD to the next-hops in the group. Local and Remote discriminator parameters have been deprecated at this level. Use Nexthop to set these parameters.
-
Defines whether BFD should be enabled towards the nexthops.
default: false -
Defines the local address to use when establishing the BFD session with the nexthop.
-
-
If set to true all traffic destined to the prefixes will be blackholed. If enabled, next-hops are ignored and this takes precedence.
default: false -
When enabled, the router will generate ICMP Unreachable messages for packets destined to the blackhole route.
-
Follow the resolution of another route. This setting is mutually exclusive with all other settings in the group.
-
Follow mode. Only "NextLongest" is supported, which means that the route will follow the next-hop-group of the next most specific matching route in the routing table.
enum: "NextLongest"
-
-
Ordered list of nexthops.
-
-
Enables BFD to the next-hops in the group. This overrides the configuration at the group.
-
Defines whether BFD should be enabled towards the nexthops.
default: false -
Defines the local address to use when establishing the BFD session with the nexthop.
-
Defines the local discriminator.
-
Defines the remote discriminator.
-
-
Address to use.
-
If set to true the next-hops can be destinations which are resolved in the route table. This overrides the configuration at the group.
default: false
-
-
-
If set to true the next-hops can be destinations which are resolved in the route table.
default: false
-
-
List of nodes on which to configure the static routes. An AND operation is executed against the nodes in this list and the nodes on which the Router is configured to determine the Nodes on which to configure the static routes.
-
Defines the route preference.
-
List of destination prefixes and mask to use for the static routes.
-
Reference to a Router on which to configure the static routes. If no Nodes are provided then the static routes will be provisioned on all Nodes on which the Router is provisioned.
STATUS
StaticRouteStatus defines the observed state of Static Route
-
Indicates the health score of the static routes.
-
Indicates the reason for the health score.
-
The time when the state of the resource last changed.
-
List of Nodes on which the static routes are configured.
-
Operational state of the static routes.