Prefix Set#
Routing Policies → PSPrefix Sets
The PrefixSet resource is used to check whether a route belongs to a logical group of prefixes. It is used in the match criteria of a routing Policy to take an action on an imported or exported route, such as preventing the route from being advertised, adding an internal Tag, or modifying its BGP Communities.
Each PrefixSet contains prefix entries. Each entry consists of an IP subnet and, optionally, a prefix-length range for matching more-specific routes.
Example 1: matching all point-to-point subnets#
The following PrefixSet matches any IPv4 /30 or /31 subnet:
apiVersion: routingpolicies.eda.nokia.com/v1
kind: PrefixSet
metadata:
name: point-to-points
namespace: eda
spec:
prefixes:
- endRange: 31
prefix: 0.0.0.0/0
startRange: 30
Example 2: matching all routes to private IP ranges#
The following PrefixSet matches any route in the private IPv4 address space defined in RFC 1918.
apiVersion: routingpolicies.eda.nokia.com/v1
kind: PrefixSet
metadata:
namespace: eda
name: private-ip-subnets
spec:
prefixes:
- prefix: 10.0.0.0/8
startRange: 8
endRange: 32
- prefix: 172.16.0.0/12
startRange: 12
endRange: 32
- prefix: 192.168.0.0/16
startRange: 16
endRange: 32
Example 3: matching the exact route to a subnet#
The following PrefixSet matches the route to a particular subnet. It does not match routes with shorter or longer prefix lengths.
apiVersion: routingpolicies.eda.nokia.com/v1
kind: PrefixSet
metadata:
namespace: eda
name: management-subnet
spec:
prefixes:
- prefix: 10.10.10.0/24
exact: true
Dependencies#
This resource does not have any dependencies.
Referenced resources#
This resource does not reference any other resource.
Examples#
cat << 'EOF' | kubectl apply -f -
apiVersion: routingpolicies.eda.nokia.com/v1
kind: PrefixSet
metadata:
namespace: eda
name: private-ip-subnets
spec:
prefixes:
- prefix: 10.0.0.0/8
startRange: 8
endRange: 32
- prefix: 172.16.0.0/12
startRange: 12
endRange: 32
- prefix: 192.168.0.0/16
startRange: 16
endRange: 32
EOF
Custom Resource Definition#
To browse the Custom Resource Definition go to crd.eda.dev.
PrefixSet
SPEC
PrefixSet defines a collection of IP prefixes, which may include specific CIDR blocks or a range of prefixes. This set is typically used for matching routes or implementing routing policies.
-
The name of the prefixset to configure on the device.
-
List of IPv4 or IPv6 prefixes in CIDR notation.
-
-
The end range when using a range to match prefixes.
format: int32range: 0 to 128 -
Indicates if it is an exact match. Ignores the StartRange and EndRange if this param is set.
-
The IPv4 or IPv6 prefix in CIDR notation with mask.
-
If specifying a range, this is the start of the range.
format: int32range: 0 to 128
-
-
STATUS
PrefixSetStatus defines the observed state of PrefixSet.