diff options
author | Gabriel Ganne <gabriel.ganne@enea.com> | 2017-10-02 11:41:24 +0200 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2017-11-10 20:25:10 +0000 |
commit | 8527f12b525181b47cc7c0c9e943a743b1a3b19e (patch) | |
tree | a4a407a2d1b25fc42f80ff06b952271a72f60025 /src/vnet/srv6 | |
parent | f616d10d04d5c444e20e617841a54cfb2c58d07d (diff) |
add classify session action set-sr-policy-index
This allows to use the classifier to steer source routing packets instead
of using the "sr steer" command.
This way we can steer on anything instead of only the dst ip address.
test:
* add add_node_next function to the VppPapiProvider class.
* add simple test scenario using the classifier to steer packets with
dest ip addr == a7::/8 to the source routing insert node.
* use new interface indexes (3,4) instead of (0,1) to prevent a cleanup
conflict with the other tests which attach a specific fib to the
interface.
The test creates interfaces sepsrated from the other tests to prevent a
conflict in the cleaning of the ip6 fib index 1 which causes vpp not to
be able to find a default route on this table.
Change-Id: Ibacb30fab3ce53f0dfe848ca6a8cdf0d111d8336
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
Diffstat (limited to 'src/vnet/srv6')
-rw-r--r-- | src/vnet/srv6/sr_steering.md | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/vnet/srv6/sr_steering.md b/src/vnet/srv6/sr_steering.md index cf446f8171e..7e91892e0bc 100644 --- a/src/vnet/srv6/sr_steering.md +++ b/src/vnet/srv6/sr_steering.md @@ -1,5 +1,7 @@ # Steering packets into a SR Policy {#srv6_steering_doc} +## steer packets uging the sr steering policy + To steer packets in Transit into an SR policy (T.Insert, T.Encaps and T.Encaps.L2 behaviors), the user needs to create an 'sr steering policy'. sr steer l3 2001::/64 via sr policy index 1 @@ -9,3 +11,25 @@ To steer packets in Transit into an SR policy (T.Insert, T.Encaps and T.Encaps.L sr steer l2 TenGE0/1/0 via sr policy bsid cafe::1 Disclaimer: The T.Encaps.L2 will steer L2 frames into an SR Policy. Notice that creating an SR steering policy for L2 frames will actually automatically *put the interface into promiscous mode*. + +## steer packets using the classifier + +Another way to steer packet is to use the classifier. + +First the user need to manually add the source routing node to the list of the +ip6-inacl next nodes. +Using the python api this can be donne with: + + # jsonfiles = get list of json api files + vpp = VPP(jsonfiles) + vpp.add_node_next(node_name='ip6-inacl', next_name='sr-pl-rewrite-insert') + +Below is a classifier mask filtering all the packets from the interface +TenGigabitEthernet5/0/0 on ip version and moving all ipv6 packets to the +sr-pl-rewrite-insert node (dropping the others) and applying the source routing +index 2. +In essence, this means "apply this sr policy to all the packets from this interface) + + vpp# classify table miss-next 0 current-data-flag 1 mask hex f000000000000000 skip 0 + vpp# classify session acl-hit-next 1 table-index 0 match hex 6000000000000000 action set-sr-policy-index 2 + vpp# set interface input acl intfc TenGigabitEthernet5/0/0 ip6-table 0 |