diff options
Diffstat (limited to 'examples/docker/SRv6_5-node/hc_configurations')
5 files changed, 592 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 diff --git a/examples/docker/SRv6_5-node/hc_configurations/hc_vpp_b_rest_config.sh b/examples/docker/SRv6_5-node/hc_configurations/hc_vpp_b_rest_config.sh new file mode 100755 index 000000000..4ce7dc42b --- /dev/null +++ b/examples/docker/SRv6_5-node/hc_configurations/hc_vpp_b_rest_config.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash +echo "VPPB - configuring routing table for SIDs and policy via HC" +curl --insecure --request PUT \ + --url https://172.17.0.3: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 "VPPB - configuring local sid B::100 via HC" +curl --insecure --request PUT \ + --url https://172.17.0.3:8445/restconf/config/hc2vpp-ietf-routing:routing/hc2vpp-ietf-srv6-base:srv6/locators/locator/b::/ \ + --header 'accept: application/json' \ + --header 'authorization: Basic YWRtaW46YWRtaW4=' \ + --header 'content-type: application/json' \ + --data '{ + "hc2vpp-ietf-srv6-base:locator": [ + { + "name": "b::", + "is-default": false, + "prefix": { + "address": "b::", + "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.3:8445/restconf/config/hc2vpp-ietf-routing:routing/hc2vpp-ietf-srv6-base:srv6/locators/locator/b::/static/local-sids/sid/256/ \ + --header 'accept: application/json' \ + --header 'authorization: Basic YWRtaW46YWRtaW4=' \ + --header 'content-type: application/json' \ + --data '{ + "hc2vpp-ietf-srv6-static:sid": [ + { + "opcode": 256, + "end-behavior-type": "ietf-srv6-types:End", + "end": { + } + } + ] +}' +sleep 1 diff --git a/examples/docker/SRv6_5-node/hc_configurations/hc_vpp_c_rest_config.sh b/examples/docker/SRv6_5-node/hc_configurations/hc_vpp_c_rest_config.sh new file mode 100755 index 000000000..10ee9d38d --- /dev/null +++ b/examples/docker/SRv6_5-node/hc_configurations/hc_vpp_c_rest_config.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash +echo "VPPC - configuring routing table for SIDs and policy via HC" +curl --insecure --request PUT \ + --url https://172.17.0.4: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 "VPPC - configuring local sid C::100 via HC" +curl --insecure --request PUT \ + --url https://172.17.0.4:8445/restconf/config/hc2vpp-ietf-routing:routing/hc2vpp-ietf-srv6-base:srv6/locators/locator/c::/ \ + --header 'accept: application/json' \ + --header 'authorization: Basic YWRtaW46YWRtaW4=' \ + --header 'content-type: application/json' \ + --data '{ + "hc2vpp-ietf-srv6-base:locator": [ + { + "name": "c::", + "is-default": false, + "prefix": { + "address": "c::", + "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.4:8445/restconf/config/hc2vpp-ietf-routing:routing/hc2vpp-ietf-srv6-base:srv6/locators/locator/c::/static/local-sids/sid/256/ \ + --header 'accept: application/json' \ + --header 'authorization: Basic YWRtaW46YWRtaW4=' \ + --header 'content-type: application/json' \ + --data '{ + "hc2vpp-ietf-srv6-static:sid": [ + { + "opcode": 256, + "end-behavior-type": "ietf-srv6-types:End", + "end": { + } + } + ] +}' +sleep 1 diff --git a/examples/docker/SRv6_5-node/hc_configurations/hc_vpp_d_rest_config.sh b/examples/docker/SRv6_5-node/hc_configurations/hc_vpp_d_rest_config.sh new file mode 100755 index 000000000..e15ddd393 --- /dev/null +++ b/examples/docker/SRv6_5-node/hc_configurations/hc_vpp_d_rest_config.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash +echo "VPPD - configuring routing table for SIDs and policy via HC" +curl --insecure --request PUT \ + --url https://172.17.0.5: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 "VPPD - configuring local sid D::100 via HC" +curl --insecure --request PUT \ + --url https://172.17.0.5:8445/restconf/config/hc2vpp-ietf-routing:routing/hc2vpp-ietf-srv6-base:srv6/locators/locator/d::/ \ + --header 'accept: application/json' \ + --header 'authorization: Basic YWRtaW46YWRtaW4=' \ + --header 'content-type: application/json' \ + --data '{ + "hc2vpp-ietf-srv6-base:locator": [ + { + "name": "d::", + "is-default": false, + "prefix": { + "address": "d::", + "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.5:8445/restconf/config/hc2vpp-ietf-routing:routing/hc2vpp-ietf-srv6-base:srv6/locators/locator/d::/static/local-sids/sid/256/ \ + --header 'accept: application/json' \ + --header 'authorization: Basic YWRtaW46YWRtaW4=' \ + --header 'content-type: application/json' \ + --data '{ + "hc2vpp-ietf-srv6-static:sid": [ + { + "opcode": 256, + "end-behavior-type": "ietf-srv6-types:End", + "end": { + } + } + ] +}' +sleep 1 diff --git a/examples/docker/SRv6_5-node/hc_configurations/hc_vpp_e_rest_config.sh b/examples/docker/SRv6_5-node/hc_configurations/hc_vpp_e_rest_config.sh new file mode 100755 index 000000000..01408a159 --- /dev/null +++ b/examples/docker/SRv6_5-node/hc_configurations/hc_vpp_e_rest_config.sh @@ -0,0 +1,207 @@ +#!/usr/bin/env bash +echo "VPPE - configuring routing table for SIDs and policy via HC" +curl --insecure --request PUT \ + --url https://172.17.0.6: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 "VPPE - configuring local sid E::201 via HC" +curl --insecure --request PUT \ + --url https://172.17.0.6:8445/restconf/config/hc2vpp-ietf-routing:routing/hc2vpp-ietf-srv6-base:srv6/locators/locator/e::/ \ + --header 'accept: application/json' \ + --header 'authorization: Basic YWRtaW46YWRtaW4=' \ + --header 'content-type: application/json' \ + --data '{ + "hc2vpp-ietf-srv6-base:locator": [ + { + "name": "e::", + "is-default": false, + "prefix": { + "address": "e::", + "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.6:8445/restconf/config/hc2vpp-ietf-routing:routing/hc2vpp-ietf-srv6-base:srv6/locators/locator/e::/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": "e::1", + "weight": 1, + "role": "PRIMARY" + } + ] + } + } + } + ] +}' + +echo "VPPE - configuring encapsulation source via HC" +curl --insecure --request PUT \ + --url https://172.17.0.6: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": "e::1" + } +}' +sleep 1 + +echo "VPPE - configuring SRv6 policy via HC" +curl --insecure --request PUT \ + --url https://172.17.0.6: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": "e::a-1", + "config": { + "name": "e::a-1" + }, + "segments": { + "segment": [{ + "index": 1, + "config": { + "index": 1, + "type": "type-2", + "sid-value": "d::100" + } + }, + { + "index": 2, + "config": { + "index": 2, + "type": "type-2", + "sid-value": "b::100" + } + }, + { + "index": 3, + "config": { + "index": 3, + "type": "type-2", + "sid-value": "a::201" + } + }] + } + }] + }, + "policies": { + "policy": [{ + "name": "e::a", + "config": { + "name": "e::a", + "color": 1, + "endpoint": "a::1", + "admin-state": "UP" + }, + "color": 1, + "endpoint": "a::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": "e::a" + } + }, + "segment-lists": { + "segment-list": [{ + "name": "e::a-1", + "config": { + "name": "e::a-1", + "weight": 1 + } + }] + } + }] + }, + "autoroute-include": { + "config": { + "metric-type": "constant", + "metric-constant": 0 + }, + "prefixes": { + "config": { + "prefixes-all": false + }, + "prefix": [{ + "ip-prefix": "a::/64", + "config": { + "ip-prefix": "a::/64" + } + }] + } + }, + "binding-sid": { + "config": { + "alloc-mode": "explicit", + "type": "srv6", + "value": "e::a" + } + }, + "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 |