blob: 50cc19bfb148d101a5b531a5c8e2650bd14fa97b [file] [log] [blame]
Nathan Skrzypczakd4a70642021-10-08 14:01:27 +02001.. _srv6_policy_doc:
2
3Creating a SR Policy
4====================
5
6An SR Policy is defined by a Binding SID and a weighted set of Segment
7Lists.
8
9A new SR policy is created with a first SID list using:
10
11::
12
13 sr policy add bsid 2001::1 next A1:: next B1:: next C1:: (weight 5) (fib-table 3)
14
15- The weight parameter is only used if more than one SID list is
16 associated with the policy.
17- The fib-table parameter specifies in which table (VRF) the Binding
18 SID is to be installed.
19
20An SR policy is deleted with:
21
22::
23
24 sr policy del bsid 2001::1
25 sr policy del index 1
26
27The existing SR policies are listed with:
28
29::
30
31 show sr policies
32
33Adding/Removing SID Lists from an SR policy
34-------------------------------------------
35
36An additional SID list is associated with an existing SR policy with:
37
38::
39
40 sr policy mod bsid 2001::1 add sl next A2:: next B2:: next C2:: (weight 3)
41 sr policy mod index 3 add sl next A2:: next B2:: next C2:: (weight 3)
42
43Conversely, a SID list can be removed from an SR policy with:
44
45::
46
47 sr policy mod bsid 2001::1 del sl index 1
48 sr policy mod index 3 del sl index 1
49
50Note that this cannot be used to remove the last SID list of a policy.
51
52The weight of a SID list can also be modified with:
53
54::
55
56 sr policy mod bsid 2001::1 mod sl index 1 weight 4
57 sr policy mod index 3 mod sl index 1 weight 4
58
59SR Policies: Spray policies
60---------------------------
61
62Spray policies are a specific type of SR policies where the packet is
63replicated on all the SID lists, rather than load-balanced among them.
64
65SID list weights are ignored with this type of policies.
66
67A Spray policy is instantiated by appending the keyword **spray** to a
68regular SR policy command, as in:
69
70::
71
72 sr policy add bsid 2001::1 next A1:: next B1:: next C1:: spray
73
74Spray policies are used for removing multicast state from a network core
75domain, and instead send a linear unicast copy to every access node. The
76last SID in each list accesses the multicast tree within the access
77node.
78
79Encapsulation SR policies
80-------------------------
81
82In case the user decides to create an SR policy an IPv6 Source Address
83must be specified for the encapsulated traffic. In order to do so the
84user might use the following command:
85
86::
87
88 set sr encaps source addr XXXX::YYYY
89
90Default hop-limit for the encapsulating IPv6 header is 64. It is
91possible to specify custom hop-limit value from 1 to 255 using this
92command:
93
94::
95
96 set sr encaps hop-limit N