blob: b8a82e575504f3c8c5143e102588a279decb1ee7 [file] [log] [blame]
Nathan Skrzypczakd4a70642021-10-08 14:01:27 +02001.. _srv6_steering_doc:
2
3Steering packets into a SR Policy
4=================================
5
6steer packets using the sr steering policy
7------------------------------------------
8
9To steer packets in Transit into an SR policy (T.Insert, T.Encaps and
10T.Encaps.L2 behaviors), the user needs to create an sr steering
11policy’.
12
13::
14
15 sr steer l3 2001::/64 via index 1
16 sr steer l3 2001::/64 via bsid cafe::1
17 sr steer l3 2001::/64 via bsid cafe::1 fib-table 3
18 sr steer l3 10.0.0.0/16 via bsid cafe::1
19 sr steer l2 TenGE0/1/0 via bsid cafe::1
20
21Disclaimer: The T.Encaps.L2 will steer L2 frames into an SR Policy.
22Notice that creating an SR steering policy for L2 frames will actually
23automatically *put the interface into promiscous mode*.
24
25steer packets using the classifier
26----------------------------------
27
28Another way to steer packet is to use the classifier.
29
30First the user need to manually add the source routing node to the list
31of the ip6-inacl next nodes. Using the python api this can be done
32with:
33
34::
35
36 # jsonfiles = get list of json api files
37 vpp = VPP(jsonfiles)
38 vpp.add_node_next(node_name='ip6-inacl', next_name='sr-pl-rewrite-insert')
39
40Below is a classifier mask filtering all the packets from the interface
41TenGigabitEthernet5/0/0 on ip version and moving all ipv6 packets to the
42sr-pl-rewrite-insert node (dropping the others) and applying the source
43routing index 2. In essence, this means apply this sr policy to all the
44packets from this interface)
45
46::
47
48 vpp# classify table miss-next 0 current-data-flag 1 mask hex f000000000000000 skip 0
49 vpp# classify session acl-hit-next 1 table-index 0 match hex 6000000000000000 action set-sr-policy-index 2
50 vpp# set interface input acl intfc TenGigabitEthernet5/0/0 ip6-table 0