From f3d6ba96980f058021afeb1eb7c9dfc6e41eac0f Mon Sep 17 00:00:00 2001 From: gifrerenom <lluis.gifre@cttc.es> Date: Sat, 11 May 2024 17:18:26 +0000 Subject: [PATCH] DataPlane-in-a-box: - Corrected TFS descriptors - Corrected scripts - Corrected containerlab descriptor - Corrected README.md --- dataplane-in-a-box/README.md | 8 ++-- dataplane-in-a-box/arista.clab.yml | 24 +++++------- dataplane-in-a-box/clab-cli-r1.sh | 3 ++ dataplane-in-a-box/clab-cli-r2.sh | 3 ++ dataplane-in-a-box/clab-cli-wan1.sh | 3 -- dataplane-in-a-box/clab-cli-wan2.sh | 3 -- dataplane-in-a-box/tfs-01-topo-nodes.json | 4 +- dataplane-in-a-box/tfs-02-topo-links.json | 36 +++++++++++------- .../tfs-03-dc1-2-dc2-l3svc.json | 24 ++++++++++++ dataplane-in-a-box/tfs-03-dc2dc-l2svc.json | 17 --------- dataplane-in-a-box/tfs-04-dc2dc-l3svc.json | 37 ------------------- 11 files changed, 67 insertions(+), 95 deletions(-) create mode 100755 dataplane-in-a-box/clab-cli-r1.sh create mode 100755 dataplane-in-a-box/clab-cli-r2.sh delete mode 100755 dataplane-in-a-box/clab-cli-wan1.sh delete mode 100755 dataplane-in-a-box/clab-cli-wan2.sh create mode 100644 dataplane-in-a-box/tfs-03-dc1-2-dc2-l3svc.json delete mode 100644 dataplane-in-a-box/tfs-03-dc2dc-l2svc.json delete mode 100644 dataplane-in-a-box/tfs-04-dc2dc-l3svc.json diff --git a/dataplane-in-a-box/README.md b/dataplane-in-a-box/README.md index 4dd22dec3..c6da22be0 100644 --- a/dataplane-in-a-box/README.md +++ b/dataplane-in-a-box/README.md @@ -16,7 +16,7 @@ source dataplane-in-a-box/deploy_specs.sh ## Download and install ContainerLab ```bash -sudo bash -c "$(curl -sL https://get.containerlab.dev)" -- -v 0.48.4 +sudo bash -c "$(curl -sL https://get.containerlab.dev)" -- -v 0.48.6 ``` ## Download Arista cEOS image and create Docker image @@ -46,13 +46,13 @@ sudo rm -rf clab-arista/ .arista.clab.yml.bak ## Access cEOS Bash ```bash -docker exec -it clab-arista-wan1 bash +docker exec -it clab-arista-r1 bash ``` ## Access cEOS CLI ```bash -docker exec -it clab-arista-wan1 Cli -docker exec -it clab-arista-wan2 Cli +docker exec -it clab-arista-r1 Cli +docker exec -it clab-arista-r2 Cli ``` ## Configure ContainerLab clients diff --git a/dataplane-in-a-box/arista.clab.yml b/dataplane-in-a-box/arista.clab.yml index fa4957f19..a7766e326 100644 --- a/dataplane-in-a-box/arista.clab.yml +++ b/dataplane-in-a-box/arista.clab.yml @@ -31,37 +31,31 @@ topology: image: ghcr.io/hellt/network-multitool:latest nodes: - wan1: + r1: kind: arista_ceos mgmt-ipv4: 172.20.20.101 - ports: [6001:6030] - wan2: + r2: kind: arista_ceos mgmt-ipv4: 172.20.20.102 - ports: [6002:6030] dc1: kind: linux - mgmt-ipv4: 172.20.20.201 - ports: [2201:22] + mgmt-ipv4: 172.20.20.211 exec: - - ip link set address 00:c1:ab:00:00:01 dev eth1 + - ip link set address 00:c1:ab:00:01:01 dev eth1 - ip address add 192.168.1.10/24 dev eth1 - ip route add 192.168.2.0/24 via 192.168.1.1 dc2: kind: linux - mgmt-ipv4: 172.20.20.202 - ports: [2202:22] + mgmt-ipv4: 172.20.20.221 exec: - - ip link set address 00:c1:ab:00:00:02 dev eth1 + - ip link set address 00:c1:ab:00:02:01 dev eth1 - ip address add 192.168.2.10/24 dev eth1 - ip route add 192.168.1.0/24 via 192.168.2.1 links: - - endpoints: ["wan1:eth1", "wan2:eth1"] - - endpoints: ["wan1:eth2", "wan2:eth2"] - - endpoints: ["wan1:eth3", "wan2:eth3"] - - endpoints: ["wan1:eth10", "dc1:eth1"] - - endpoints: ["wan2:eth10", "dc2:eth1"] + - endpoints: ["r1:eth1", "r2:eth1"] + - endpoints: ["r1:eth10", "dc1:eth1"] + - endpoints: ["r2:eth10", "dc2:eth1"] diff --git a/dataplane-in-a-box/clab-cli-r1.sh b/dataplane-in-a-box/clab-cli-r1.sh new file mode 100755 index 000000000..a4799c6ce --- /dev/null +++ b/dataplane-in-a-box/clab-cli-r1.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker exec -it clab-arista-r1 Cli diff --git a/dataplane-in-a-box/clab-cli-r2.sh b/dataplane-in-a-box/clab-cli-r2.sh new file mode 100755 index 000000000..39dce3938 --- /dev/null +++ b/dataplane-in-a-box/clab-cli-r2.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker exec -it clab-arista-r2 Cli diff --git a/dataplane-in-a-box/clab-cli-wan1.sh b/dataplane-in-a-box/clab-cli-wan1.sh deleted file mode 100755 index 4ae21bcb5..000000000 --- a/dataplane-in-a-box/clab-cli-wan1.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -docker exec -it clab-arista-wan1 Cli diff --git a/dataplane-in-a-box/clab-cli-wan2.sh b/dataplane-in-a-box/clab-cli-wan2.sh deleted file mode 100755 index c931ac940..000000000 --- a/dataplane-in-a-box/clab-cli-wan2.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -docker exec -it clab-arista-wan2 Cli diff --git a/dataplane-in-a-box/tfs-01-topo-nodes.json b/dataplane-in-a-box/tfs-01-topo-nodes.json index d0fafbfe8..7331664a1 100644 --- a/dataplane-in-a-box/tfs-01-topo-nodes.json +++ b/dataplane-in-a-box/tfs-01-topo-nodes.json @@ -27,7 +27,7 @@ ]} }, { - "device_id": {"device_uuid": {"uuid": "wan1"}}, "device_type": "packet-router", "device_drivers": [8], + "device_id": {"device_uuid": {"uuid": "r1"}}, "device_type": "packet-router", "device_drivers": [8], "device_config": {"config_rules": [ {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "172.20.20.101"}}, {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "6030"}}, @@ -37,7 +37,7 @@ ]} }, { - "device_id": {"device_uuid": {"uuid": "wan2"}}, "device_type": "packet-router", "device_drivers": [8], + "device_id": {"device_uuid": {"uuid": "r2"}}, "device_type": "packet-router", "device_drivers": [8], "device_config": {"config_rules": [ {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "172.20.20.102"}}, {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "6030"}}, diff --git a/dataplane-in-a-box/tfs-02-topo-links.json b/dataplane-in-a-box/tfs-02-topo-links.json index 78765a7d5..3e65f5b28 100644 --- a/dataplane-in-a-box/tfs-02-topo-links.json +++ b/dataplane-in-a-box/tfs-02-topo-links.json @@ -1,39 +1,47 @@ { "links": [ { - "link_id": {"link_uuid": {"uuid": "wan1/ethernet-1/1==wan2/ethernet-1/1"}}, + "link_id": {"link_uuid": {"uuid": "r1/Ethernet1==r2/Ethernet1"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "wan1"}}, "endpoint_uuid": {"uuid": "ethernet-1/1"}}, - {"device_id": {"device_uuid": {"uuid": "wan2"}}, "endpoint_uuid": {"uuid": "ethernet-1/1"}} + {"device_id": {"device_uuid": {"uuid": "r1"}}, "endpoint_uuid": {"uuid": "Ethernet1"}}, + {"device_id": {"device_uuid": {"uuid": "r2"}}, "endpoint_uuid": {"uuid": "Ethernet1"}} ] }, { - "link_id": {"link_uuid": {"uuid": "wan1/ethernet-1/2==wan2/ethernet-1/2"}}, + "link_id": {"link_uuid": {"uuid": "r2/Ethernet1==r1/Ethernet1"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "wan1"}}, "endpoint_uuid": {"uuid": "ethernet-1/2"}}, - {"device_id": {"device_uuid": {"uuid": "wan2"}}, "endpoint_uuid": {"uuid": "ethernet-1/2"}} + {"device_id": {"device_uuid": {"uuid": "r2"}}, "endpoint_uuid": {"uuid": "Ethernet1"}}, + {"device_id": {"device_uuid": {"uuid": "r1"}}, "endpoint_uuid": {"uuid": "Ethernet1"}} ] }, + { - "link_id": {"link_uuid": {"uuid": "wan1/ethernet-1/3==wan2/ethernet-1/3"}}, + "link_id": {"link_uuid": {"uuid": "r1/Ethernet10==dc1/eth1"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "wan1"}}, "endpoint_uuid": {"uuid": "ethernet-1/3"}}, - {"device_id": {"device_uuid": {"uuid": "wan2"}}, "endpoint_uuid": {"uuid": "ethernet-1/3"}} + {"device_id": {"device_uuid": {"uuid": "r1"}}, "endpoint_uuid": {"uuid": "Ethernet10"}}, + {"device_id": {"device_uuid": {"uuid": "dc1"}}, "endpoint_uuid": {"uuid": "eth1"}} ] }, - { - "link_id": {"link_uuid": {"uuid": "dc1/eth1==wan1/ethernet-1/10"}}, + "link_id": {"link_uuid": {"uuid": "dc1/eth1==r1/Ethernet10"}}, "link_endpoint_ids": [ {"device_id": {"device_uuid": {"uuid": "dc1"}}, "endpoint_uuid": {"uuid": "eth1"}}, - {"device_id": {"device_uuid": {"uuid": "wan1"}}, "endpoint_uuid": {"uuid": "ethernet-1/10"}} + {"device_id": {"device_uuid": {"uuid": "r1"}}, "endpoint_uuid": {"uuid": "Ethernet10"}} + ] + }, + + { + "link_id": {"link_uuid": {"uuid": "r2/Ethernet10==dc2/eth1"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "r2"}}, "endpoint_uuid": {"uuid": "Ethernet10"}}, + {"device_id": {"device_uuid": {"uuid": "dc2"}}, "endpoint_uuid": {"uuid": "eth1"}} ] }, { - "link_id": {"link_uuid": {"uuid": "dc2/eth1==wan2/ethernet-1/10"}}, + "link_id": {"link_uuid": {"uuid": "dc2/eth1==r2/Ethernet10"}}, "link_endpoint_ids": [ {"device_id": {"device_uuid": {"uuid": "dc2"}}, "endpoint_uuid": {"uuid": "eth1"}}, - {"device_id": {"device_uuid": {"uuid": "wan2"}}, "endpoint_uuid": {"uuid": "ethernet-1/10"}} + {"device_id": {"device_uuid": {"uuid": "r2"}}, "endpoint_uuid": {"uuid": "Ethernet10"}} ] } ] diff --git a/dataplane-in-a-box/tfs-03-dc1-2-dc2-l3svc.json b/dataplane-in-a-box/tfs-03-dc1-2-dc2-l3svc.json new file mode 100644 index 000000000..0e2dc5c67 --- /dev/null +++ b/dataplane-in-a-box/tfs-03-dc1-2-dc2-l3svc.json @@ -0,0 +1,24 @@ +{ + "services": [ + { + "service_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, "service_uuid": {"uuid": "dc1-2-dc2-l3svc"} + }, + "service_type": 1, + "service_status": {"service_status": 1}, + "service_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "dc1"}}, "endpoint_uuid": {"uuid": "int"}}, + {"device_id": {"device_uuid": {"uuid": "dc2"}}, "endpoint_uuid": {"uuid": "int"}} + ], + "service_constraints": [], + "service_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "/device[dc1]/endpoint[eth1]/settings", "resource_value": { + "ipv4_address": "192.168.1.10", "ipv4_prefix": 24, "sub_interface_index": 0 + }}}, + {"action": 1, "custom": {"resource_key": "/device[dc2]/endpoint[eth1]/settings", "resource_value": { + "ipv4_address": "192.168.2.10", "ipv4_prefix": 24, "sub_interface_index": 0 + }}} + ]} + } + ] +} diff --git a/dataplane-in-a-box/tfs-03-dc2dc-l2svc.json b/dataplane-in-a-box/tfs-03-dc2dc-l2svc.json deleted file mode 100644 index 8d10e5f4b..000000000 --- a/dataplane-in-a-box/tfs-03-dc2dc-l2svc.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "services": [ - { - "service_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, "service_uuid": {"uuid": "dc2dc-l2svc"} - }, - "service_type": 2, - "service_status": {"service_status": 1}, - "service_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "dc1"}}, "endpoint_uuid": {"uuid": "int"}}, - {"device_id": {"device_uuid": {"uuid": "dc2"}}, "endpoint_uuid": {"uuid": "int"}} - ], - "service_constraints": [], - "service_config": {"config_rules": []} - } - ] -} diff --git a/dataplane-in-a-box/tfs-04-dc2dc-l3svc.json b/dataplane-in-a-box/tfs-04-dc2dc-l3svc.json deleted file mode 100644 index b21cba0da..000000000 --- a/dataplane-in-a-box/tfs-04-dc2dc-l3svc.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "services": [ - { - "service_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, "service_uuid": {"uuid": "dc2dc-l3svc"} - }, - "service_type": 1, - "service_status": {"service_status": 1}, - "service_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "dc1"}}, "endpoint_uuid": {"uuid": "int"}}, - {"device_id": {"device_uuid": {"uuid": "dc2"}}, "endpoint_uuid": {"uuid": "int"}} - ], - "service_constraints": [], - "service_config": {"config_rules": [ - {"action": 1, "custom": {"resource_key": "/device[wan1]/settings", "resource_value": { - "static_routes": [{"prefix": "172.16.2.0/24", "next_hop": "172.0.0.2"}] - }}}, - {"action": 1, "custom": {"resource_key": "/device[wan1]/endpoint[ethernet-1/1]/settings", "resource_value": { - "ipv4_address": "172.0.0.1", "ipv4_prefix": 30, "sub_interface_index": 0 - }}}, - {"action": 1, "custom": {"resource_key": "/device[wan1]/endpoint[ethernet-1/2]/settings", "resource_value": { - "ipv4_address": "172.16.1.1", "ipv4_prefix": 24, "sub_interface_index": 0 - }}}, - - {"action": 1, "custom": {"resource_key": "/device[wan3]/settings", "resource_value": { - "static_routes": [{"prefix": "172.16.1.0/24", "next_hop": "172.0.0.1"}] - }}}, - {"action": 1, "custom": {"resource_key": "/device[wan3]/endpoint[ethernet-1/1]/settings", "resource_value": { - "ipv4_address": "172.0.0.2", "ipv4_prefix": 30, "sub_interface_index": 0 - }}}, - {"action": 1, "custom": {"resource_key": "/device[wan3]/endpoint[ethernet-1/2]/settings", "resource_value": { - "ipv4_address": "172.16.2.1", "ipv4_prefix": 24, "sub_interface_index": 0 - }}} - ]} - } - ] -} -- GitLab