diff options
author | Michal Cmarada <michal.cmarada@pantheon.tech> | 2018-06-15 10:37:14 +0200 |
---|---|---|
committer | Michal Cmarada <michal.cmarada@pantheon.tech> | 2018-06-20 08:29:14 +0200 |
commit | 1528ed5d01ddd8a0de14711de59861d16f727a3e (patch) | |
tree | defc318c886c8673161b2cae43d6fa097b8a0772 /examples/docker/SRv6_5-node/hc_configurations/hc_vpp_a_rest_config.sh | |
parent | b77a5725338dc700873b36c98af85d70acd7bbe4 (diff) |
Add SRv6 5 node docker demo
This demo is intended to test SRv6 implementation. There are
two options how to run the demo. First one is to use VPP only
configuration and the second one uses honeycomb to configure
SRv6 on nodes.
For detailed information about the demo read documentation in
./asciidoc/Readme.adoc file. Follow the instructions to run
the demo and use provided commands to verify the operation
of VPP nodes.
Change-Id: I7d17db0096cc48b06e9148e7c78faaf9d7b8a97d
Signed-off-by: Michal Cmarada <michal.cmarada@pantheon.tech>
Diffstat (limited to 'examples/docker/SRv6_5-node/hc_configurations/hc_vpp_a_rest_config.sh')
-rwxr-xr-x | examples/docker/SRv6_5-node/hc_configurations/hc_vpp_a_rest_config.sh | 208 |
1 files changed, 208 insertions, 0 deletions
diff --git a/examples/docker/SRv6_5-node/hc_configurations/hc_vpp_a_rest_config.sh b/examples/docker/SRv6_5-node/hc_configurations/hc_vpp_a_rest_config.sh new file mode 100755 index 000000000..35b274116 --- /dev/null +++ b/examples/docker/SRv6_5-node/hc_configurations/hc_vpp_a_rest_config.sh @@ -0,0 +1,208 @@ +#!/usr/bin/env bash +echo "VPPA - configuring routing table for SIDs and policy via HC" +curl --insecure --request PUT \ + --url https://172.17.0.2:8445/restconf/config/vpp-fib-table-management:fib-table-management/vpp-fib-table-management:fib-tables/table/0/vpp-fib-table-management:ipv6 \ + --header 'accept: application/json' \ + --header 'authorization: Basic YWRtaW46YWRtaW4=' \ + --header 'content-type: application/json' \ + --data '{ + "vpp-fib-table-management:table": [ + { + "table-id": 0, + "address-family": "vpp-fib-table-management:ipv6", + "name": "ipv6-VRF:0" + } + ] +}' +sleep 1 + +echo "VPPA - configuring local sid A::201 via HC" +curl --insecure --request PUT \ + --url https://172.17.0.2:8445/restconf/config/hc2vpp-ietf-routing:routing/hc2vpp-ietf-srv6-base:srv6/locators/locator/a::/ \ + --header 'accept: application/json' \ + --header 'authorization: Basic YWRtaW46YWRtaW4=' \ + --header 'content-type: application/json' \ + --data '{ + "hc2vpp-ietf-srv6-base:locator": [ + { + "name": "a::", + "is-default": false, + "prefix": { + "address": "a::", + "length": 64 + }, + "enable": true, + "vpp-ietf-srv6-base:fib-table" : { + "table-id": 0, + "address-family": "vpp-fib-table-management:ipv6" + } + } + ] +}' +sleep 1 + +curl --insecure --request PUT \ + --url https://172.17.0.2:8445/restconf/config/hc2vpp-ietf-routing:routing/hc2vpp-ietf-srv6-base:srv6/locators/locator/a::/static/local-sids/sid/513/ \ + --header 'accept: application/json' \ + --header 'authorization: Basic YWRtaW46YWRtaW4=' \ + --header 'content-type: application/json' \ + --data '{ + "hc2vpp-ietf-srv6-static:sid": [ + { + "opcode": 513, + "end-behavior-type": "ietf-srv6-types:End.DX6", + "end-dx6": { + "paths": { + "path": [ + { + "path-index": 1, + "interface": "host-veth0", + "next-hop": "a::1", + "weight": 1, + "role": "PRIMARY" + } + ] + } + } + } + ] +}' +sleep 1 + +echo "VPPA - configuring encapsulation source via HC" +curl --insecure --request PUT \ + --url https://172.17.0.2:8445/restconf/config/hc2vpp-ietf-routing:routing/hc2vpp-ietf-srv6-base:srv6/hc2vpp-ietf-srv6-base:encapsulation/ \ + --header 'accept: application/json' \ + --header 'authorization: Basic YWRtaW46YWRtaW4=' \ + --header 'content-type: application/json' \ + --data '{ + "hc2vpp-ietf-srv6-base:encapsulation": { + "ip-ttl-propagation": false, + "source-address": "a::1" + } +}' +sleep 1 + +echo "VPPA - configuring SRv6 policy via HC" +curl --insecure --request PUT \ + --url https://172.17.0.2:8445/restconf/config/hc2vpp-oc-srte-policy:segment-routing \ + --header 'accept: application/json' \ + --header 'authorization: Basic YWRtaW46YWRtaW4=' \ + --header 'content-type: application/json' \ + --data '{ + "hc2vpp-oc-srte-policy:segment-routing": { + "traffic-engineering": { + "named-segment-lists": { + "named-segment-list": [{ + "name": "a::e-1", + "config": { + "name": "a::e-1" + }, + "segments": { + "segment": [{ + "index": 1, + "config": { + "index": 1, + "type": "type-2", + "sid-value": "c::100" + } + }, + { + "index": 2, + "config": { + "index": 2, + "type": "type-2", + "sid-value": "d::100" + } + }, + { + "index": 3, + "config": { + "index": 3, + "type": "type-2", + "sid-value": "e::201" + } + }] + } + }] + }, + "policies": { + "policy": [{ + "name": "a::e", + "config": { + "name": "a::e", + "color": 1, + "endpoint": "e::1", + "admin-state": "UP" + }, + "color": 1, + "endpoint": "e::1", + "candidate-paths": { + "candidate-path": [{ + "name": "candidatePath1", + "provisioning-method": "provisioning-method-config", + "preference": 100, + "distinguisher": 0, + "config": { + "name": "candidatePath1", + "provisioning-method": "provisioning-method-config", + "computation-method": "path-explicitly-defined", + "preference": 100, + "distinguisher": 0 + }, + "binding-sid": { + "config": { + "alloc-mode": "explicit", + "type": "srv6", + "value": "a::e" + } + }, + "segment-lists": { + "segment-list": [{ + "name": "a::e-1", + "config": { + "name": "a::e-1", + "weight": 1 + } + }] + } + }] + }, + "autoroute-include": { + "config": { + "metric-type": "constant", + "metric-constant": 0 + }, + "prefixes": { + "config": { + "prefixes-all": false + }, + "prefix": [{ + "ip-prefix": "e::/64", + "config": { + "ip-prefix": "e::/64" + } + }] + } + }, + "binding-sid": { + "config": { + "alloc-mode": "explicit", + "type": "srv6", + "value": "a::e" + } + }, + "vpp-oc-srte-policy:vpp-sr-policy": { + "config": { + "policy-type": "Default", + "policy-behavior": "Encapsulation", + "table-id": 0, + "address-family": "vpp-fib-table-management:ipv6" + } + } + }] + } + } + } +}' +sleep 1 |