From fd0f2a3dbdaa99b0c64f3a6214d09bf6dca5fd15 Mon Sep 17 00:00:00 2001 From: Damien A Date: Sun, 31 Dec 2023 19:04:27 +0100 Subject: [PATCH] First Commit - Empty lab settings - Default hosts configuration - Readme + DrawIO Schema --- .devcontainer/devcontainer.json | 25 ++++++++ .devcontainer/docker-compose.yml | 17 ++++++ .gitignore | 10 +++ README.md | 38 ++++++++++++ .../assets/images/diagrams/VXLAN.drawio | 61 +++++++++++++++++++ hosts/h1_interfaces | 7 +++ hosts/h2_interfaces | 7 +++ lab_vxlan.yml | 32 ++++++++++ 8 files changed, 197 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/docker-compose.yml create mode 100644 .gitignore create mode 100644 README.md create mode 100644 documentation/assets/images/diagrams/VXLAN.drawio create mode 100644 hosts/h1_interfaces create mode 100644 hosts/h2_interfaces create mode 100644 lab_vxlan.yml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..5e0a085 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,25 @@ +{ + "name": "ContainerLab", + "dockerComposeFile": "docker-compose.yml", + "service": "containerlab", + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [50080], + + // Mount worspace on container + "workspaceFolder": "/workspace", + + // Import ceos images + "postCreateCommand": "docker import images/ceos-lab-4.30.3M.tar.xz ceos:4.30.3M", + + // Configure properties specific to VS Code. + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode-remote.vscode-remote-extensionpack", + "ms-azuretools.vscode-docker", + "ms-python.python" + ] + } + } +} \ No newline at end of file diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 0000000..800bb3d --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,17 @@ +version: '3.8' +services: + containerlab: + image: ghcr.io/srl-labs/clab + platform: linux/amd64 + command: tail -f /dev/null + privileged: true + network_mode: host + pid: host + ports: + - "50080:50080" + volumes: + - ..:/workspace + - /var/run/docker.sock:/var/run/docker.sock + - /var/run/netns:/var/run/netns + - /etc/hosts:/etc/hosts + - /var/lib/docker/containers:/var/lib/docker/containers diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4d6b539 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +# Data +.DS_Store +.log + +# ContainerLab File +clab-vxlan-evpn-l2 +.lab_vxlan.yml.bak + +# Network images +images/* \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..3b5700b --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +# VXLAN-EVPN Lab with ContainerLab + +## Overview + +This project provides a hands-on lab environment for understanding and experimenting with VXLAN-EVPN (Ethernet VPN) technology. Using ContainerLab, the lab sets up a VXLAN topology featuring 1 spine and 2 leaves nodes. The lab can be deployed directly on a PC with ContainerLab installed or through a DevContainer environment. + +## Project Structure + +The project directory is structured as follows: + +- `.devcontainer/devcontainer.json`: Configuration for the DevContainer environment. +- `hosts`: Directory containing host configuration files for the lab. +- `images/ceos-lab-4.30.3M.tar.xz`: Container image used for the lab nodes. +- `lab_vxlan.yml`: YAML file describing the VXLAN lab topology. + +## Prerequisites + +- Docker and Docker Compose (for DevContainer setup). +- ContainerLab installed either on the host or within the DevContainer. +- Basic understanding of networking and VXLAN-EVPN concepts. + +## Setup and Deployment + +1. **DevContainer Setup (Optional):** + If using DevContainer, ensure Docker and Docker Compose are installed on your machine. Open the project in a compatible IDE (like Visual Studio Code) and start the DevContainer environment. + +2. **ContainerLab Setup:** + - Direct Installation: Install ContainerLab on your host machine. + - Via DevContainer: Use the provided `devcontainer.json` to set up a ContainerLab environment. + +3. **Start the Lab:** + - Navigate to the project directory. + - Run `containerlab deploy -t lab_vxlan.yml` to deploy the lab topology. + +## Usage + +- Once the lab is deployed, you can access the individual nodes (spines and leaves) via CLI or SSH to configure and test VXLAN-EVPN functionalities. +- Use the `hosts` directory to modify or apply specific configurations. diff --git a/documentation/assets/images/diagrams/VXLAN.drawio b/documentation/assets/images/diagrams/VXLAN.drawio new file mode 100644 index 0000000..8e01f9d --- /dev/null +++ b/documentation/assets/images/diagrams/VXLAN.drawio @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hosts/h1_interfaces b/hosts/h1_interfaces new file mode 100644 index 0000000..588f9a7 --- /dev/null +++ b/hosts/h1_interfaces @@ -0,0 +1,7 @@ +auto lo +iface lo inet loopback + +auto eth1 +iface eth1 inet static + address 10.100.100.1 + netmask 255.255.255.0 \ No newline at end of file diff --git a/hosts/h2_interfaces b/hosts/h2_interfaces new file mode 100644 index 0000000..5883945 --- /dev/null +++ b/hosts/h2_interfaces @@ -0,0 +1,7 @@ +auto lo +iface lo inet loopback + +auto eth1 +iface eth1 inet static + address 10.100.100.2 + netmask 255.255.255.0 \ No newline at end of file diff --git a/lab_vxlan.yml b/lab_vxlan.yml new file mode 100644 index 0000000..1fe1670 --- /dev/null +++ b/lab_vxlan.yml @@ -0,0 +1,32 @@ +name: vxlan-evpn-l2 +topology: + nodes: + spine1: + kind: ceos + image: ceos:4.30.3M + mgmt-ipv4: 172.20.20.101 + leaf1: + kind: ceos + image: ceos:4.30.3M + mgmt-ipv4: 172.20.20.11 + leaf2: + kind: ceos + image: ceos:4.30.3M + mgmt-ipv4: 172.20.20.12 + host1: + kind: linux + image: alpine:latest + binds: + - hosts/h1_interfaces:/etc/network/interfaces + mgmt-ipv4: 172.20.20.21 + host2: + kind: linux + image: alpine:latest + binds: + - hosts/h2_interfaces:/etc/network/interfaces + mgmt-ipv4: 172.20.20.22 + links: + - endpoints: ["spine1:eth1", "leaf1:eth1"] + - endpoints: ["spine1:eth2", "leaf1:eth2"] + - endpoints: ["leaf1:eth3", "host1:eth1"] + - endpoints: ["leaf2:eth3", "host2:eth1"] \ No newline at end of file