Update Readme, Add installation doc and update lab

This commit is contained in:
Damien A
2023-08-18 15:17:42 +02:00
parent 9690fa81bb
commit 97a72cf58e
9 changed files with 317 additions and 147 deletions

2
.gitignore vendored
View File

@@ -1,2 +1,4 @@
.DS_Store .DS_Store
documentation/assets/images/diagrams/.$VXLAN.drawio.bkp documentation/assets/images/diagrams/.$VXLAN.drawio.bkp
clab-vxlan-evpn-l2/*
containerlab/.lab_definition.yml.bak

View File

@@ -2,6 +2,16 @@
Ce projet vise à automatiser la création et la gestion d'un laboratoire de test VXLAN EVPN en utilisant ContainerLab, Arista cEOS, Cisco N9Kv, et Netbox. L'automatisation est réalisée principalement grâce à Ansible et des scripts Python. Ce projet vise à automatiser la création et la gestion d'un laboratoire de test VXLAN EVPN en utilisant ContainerLab, Arista cEOS, Cisco N9Kv, et Netbox. L'automatisation est réalisée principalement grâce à Ansible et des scripts Python.
🖋️ **_NOTE_**: L'environnement utilisé est un Debian 12 :
```bash
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
```
## Table des matières ## Table des matières
1. [Pré-requis](#pré-requis) 1. [Pré-requis](#pré-requis)
@@ -14,9 +24,9 @@ Ce projet vise à automatiser la création et la gestion d'un laboratoire de tes
## Pré-requis ## Pré-requis
- Docker & ContainerLab installés. - Docker, ContainerLab et Ansible installés.
- Images pour Arista cEOS et Cisco N9Kv téléchargées. - Images pour Arista cEOS, Cisco N9Kv et Linux Alpine téléchargées.
- Python 3.x avec les bibliothèques nécessaires (voir `requirements.txt`). - Python 3.11 avec les bibliothèques nécessaires (voir `requirements.txt`).
## Installation ## Installation
@@ -46,7 +56,7 @@ Ce projet vise à automatiser la création et la gestion d'un laboratoire de tes
1. **Mise en place du lab** : 1. **Mise en place du lab** :
```bash ```bash
ansible-playbook ansible/playbooks/setup_containerlab.yml sudo containerlab deploy --topo containerlab/lab_definition.yml
``` ```
2. **Configurer Netbox** : 2. **Configurer Netbox** :

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,7 @@
auto lo
iface lo inet loopback
auto eth1
iface eth1 inet static
address 10.100.100.3
netmask 255.255.255.0

View File

@@ -0,0 +1,7 @@
auto lo
iface lo inet loopback
auto eth1
iface eth1 inet static
address 10.100.100.4
netmask 255.255.255.0

View File

@@ -0,0 +1,64 @@
name: vxlan-evpn-l2
topology:
nodes:
spine1:
kind: ceos
image: ceos:4.30.1F
mgmt-ipv4: 172.20.20.101
spine2:
kind: ceos
image: ceos:4.30.1F
mgmt-ipv4: 172.20.20.102
leaf1:
kind: ceos
image: ceos:4.30.1F
mgmt-ipv4: 172.20.20.11
leaf2:
kind: vr-n9kv
image: vrnetlab/vr-n9kv:9.3.9
mgmt-ipv4: 172.20.20.12
leaf3:
kind: vr-n9kv
image: vrnetlab/vr-n9kv:9.3.9
mgmt-ipv4: 172.20.20.13
leaf4:
kind: ceos
image: ceos:4.30.1F
mgmt-ipv4: 172.20.20.14
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
host3:
kind: linux
image: alpine:latest
binds:
- hosts/h3_interfaces:/etc/network/interfaces
mgmt-ipv4: 172.20.20.23
host4:
kind: linux
image: alpine:latest
binds:
- hosts/h4_interfaces:/etc/network/interfaces
mgmt-ipv4: 172.20.20.24
links:
- endpoints: ["leaf1:eth1", "spine1:eth1"]
- endpoints: ["leaf1:eth2", "spine2:eth1"]
- endpoints: ["leaf2:eth1", "spine1:eth2"]
- endpoints: ["leaf2:eth2", "spine2:eth2"]
- endpoints: ["leaf3:eth1", "spine1:eth3"]
- endpoints: ["leaf3:eth2", "spine2:eth3"]
- endpoints: ["leaf4:eth1", "spine1:eth4"]
- endpoints: ["leaf4:eth2", "spine2:eth4"]
- endpoints: ["leaf1:eth3", "host1:eth1"]
- endpoints: ["leaf2:eth3", "host2:eth1"]
- endpoints: ["leaf3:eth3", "host3:eth1"]
- endpoints: ["leaf4:eth3", "host4:eth1"]

View File

@@ -0,0 +1,66 @@
## Table des matières
1. [Installation de ContainerLab](#installation-de-containerlab)
2. [Installation de vrnetlab](#installation-de-vrnetlab)
3. [Installation de Docker](#installation-de-docker)
## Installation de ContainerLab
Containerlab peut être installé à l'aide du script d'installation qui détecte le type de système d'exploitation et installe le paquetage approprié :
```bash
# télécharger et installer la dernière version (peut nécessiter sudo)
bash -c "$(curl -sL https://get.containerlab.dev)"
# avec wget
bash -c "$(wget -qO - https://get.containerlab.dev)"
```
## Installation de vrnetlab
Vrnetlab place une VM normale dans un conteneur et la rend exécutable comme s'il s'agissait d'une image de conteneur.
Pour ce faire, vrnetlab fournit un ensemble de scripts qui construisent l'image du conteneur à partir d'un disque VM fourni par l'utilisateur.
```bash
# mise à jour et installation des dépendances
sudo apt update
sudo apt -y install python3-bs4 sshpass make
sudo apt -y install git
# se déplacer dans /opt et cloner le projet
sudo cd /opt && sudo git clone https://github.com/hellt/vrnetlab
# optionnel : modification des droits du répertoire
sudo chown -R $USER:$USER vrnetlab
```
## Installation de docker
Il s'agit de moteur de conteneurisation utilisé par ContainerLab
```bash
# Mise à jour et installation des dépendances
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
# Ajout de la clef GPG
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Ajout du dépôt
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Mise à jour et installation
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```
## Sources
- [InsContainerLab](https://containerlab.dev/install/)
- [vrnetlab](https://containerlab.dev/manual/vrnetlab/#vrnetlab)
- [BiranLinkLetter](https://www.brianlinkletter.com/2019/03/vrnetlab-emulate-networks-using-kvm-and-docker/)
- [Docker Engine for Debian](https://docs.docker.com/engine/install/debian/)

View File

@@ -1,6 +1,6 @@
<mxfile host="Electron" modified="2023-08-18T06:51:52.601Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.6.8 Chrome/114.0.5735.289 Electron/25.5.0 Safari/537.36" etag="vOb1lIAEZjDNW4An1MBB" version="21.6.8" type="device"> <mxfile host="65bd71144e">
<diagram name="Page-1" id="O6sBWOfz2bUCuo58S4gg"> <diagram name="Page-1" id="O6sBWOfz2bUCuo58S4gg">
<mxGraphModel dx="2954" dy="1267" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0"> <mxGraphModel dx="1359" dy="888" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
<root> <root>
<mxCell id="0"/> <mxCell id="0"/>
<mxCell id="1" parent="0"/> <mxCell id="1" parent="0"/>
@@ -109,13 +109,13 @@
<mxCell id="aTlmoTqcXMnjitFqs7Kw-43" value="&lt;div style=&quot;&quot;&gt;&lt;font face=&quot;Tahoma&quot; color=&quot;#5c5c5c&quot;&gt;&lt;b&gt;Host 1&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;font face=&quot;Tahoma&quot; color=&quot;#5c5c5c&quot;&gt;10.100.100.1/24&lt;/font&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;align=center;" parent="1" vertex="1"> <mxCell id="aTlmoTqcXMnjitFqs7Kw-43" value="&lt;div style=&quot;&quot;&gt;&lt;font face=&quot;Tahoma&quot; color=&quot;#5c5c5c&quot;&gt;&lt;b&gt;Host 1&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;font face=&quot;Tahoma&quot; color=&quot;#5c5c5c&quot;&gt;10.100.100.1/24&lt;/font&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;align=center;" parent="1" vertex="1">
<mxGeometry x="236" y="660" width="97.5" height="40" as="geometry"/> <mxGeometry x="236" y="660" width="97.5" height="40" as="geometry"/>
</mxCell> </mxCell>
<mxCell id="aTlmoTqcXMnjitFqs7Kw-44" value="&lt;div style=&quot;&quot;&gt;&lt;font face=&quot;Tahoma&quot; color=&quot;#5c5c5c&quot;&gt;&lt;b&gt;Host 2&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;font face=&quot;Tahoma&quot; color=&quot;#5c5c5c&quot;&gt;10.100.100.1/24&lt;/font&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;align=center;" parent="1" vertex="1"> <mxCell id="aTlmoTqcXMnjitFqs7Kw-44" value="&lt;div style=&quot;&quot;&gt;&lt;font face=&quot;Tahoma&quot; color=&quot;#5c5c5c&quot;&gt;&lt;b&gt;Host 2&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;font face=&quot;Tahoma&quot; color=&quot;#5c5c5c&quot;&gt;10.100.100.2/24&lt;/font&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;align=center;" parent="1" vertex="1">
<mxGeometry x="436" y="660" width="97.5" height="40" as="geometry"/> <mxGeometry x="436" y="660" width="97.5" height="40" as="geometry"/>
</mxCell> </mxCell>
<mxCell id="aTlmoTqcXMnjitFqs7Kw-45" value="&lt;div style=&quot;&quot;&gt;&lt;font face=&quot;Tahoma&quot; color=&quot;#5c5c5c&quot;&gt;&lt;b&gt;Host 3&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;font face=&quot;Tahoma&quot; color=&quot;#5c5c5c&quot;&gt;10.100.100.1/24&lt;/font&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;align=center;" parent="1" vertex="1"> <mxCell id="aTlmoTqcXMnjitFqs7Kw-45" value="&lt;div style=&quot;&quot;&gt;&lt;font face=&quot;Tahoma&quot; color=&quot;#5c5c5c&quot;&gt;&lt;b&gt;Host 3&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;font face=&quot;Tahoma&quot; color=&quot;#5c5c5c&quot;&gt;10.100.100.3/24&lt;/font&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;align=center;" parent="1" vertex="1">
<mxGeometry x="636" y="660" width="97.5" height="40" as="geometry"/> <mxGeometry x="636" y="660" width="97.5" height="40" as="geometry"/>
</mxCell> </mxCell>
<mxCell id="aTlmoTqcXMnjitFqs7Kw-46" value="&lt;div style=&quot;&quot;&gt;&lt;font face=&quot;Tahoma&quot; color=&quot;#5c5c5c&quot;&gt;&lt;b&gt;Host 4&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;font face=&quot;Tahoma&quot; color=&quot;#5c5c5c&quot;&gt;10.100.100.1/24&lt;/font&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;align=center;" parent="1" vertex="1"> <mxCell id="aTlmoTqcXMnjitFqs7Kw-46" value="&lt;div style=&quot;&quot;&gt;&lt;font face=&quot;Tahoma&quot; color=&quot;#5c5c5c&quot;&gt;&lt;b&gt;Host 4&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;font face=&quot;Tahoma&quot; color=&quot;#5c5c5c&quot;&gt;10.100.100.4/24&lt;/font&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;align=center;" parent="1" vertex="1">
<mxGeometry x="836" y="660" width="97.5" height="40" as="geometry"/> <mxGeometry x="836" y="660" width="97.5" height="40" as="geometry"/>
</mxCell> </mxCell>
<mxCell id="iRoN0Qlv0NIkLaMQXTU7-1" value="" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=4.416107382550308;strokeColor=#6c8ebf;fillColor=#dae8fc;" parent="1" vertex="1"> <mxCell id="iRoN0Qlv0NIkLaMQXTU7-1" value="" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=4.416107382550308;strokeColor=#6c8ebf;fillColor=#dae8fc;" parent="1" vertex="1">