Fin de la semaine 3
This commit is contained in:
353
Semaine_01/Jour_05_Examen.md
Normal file
353
Semaine_01/Jour_05_Examen.md
Normal file
@@ -0,0 +1,353 @@
|
|||||||
|
Emmanuel-Joyce Ntsia, Gauvain BOICHÉ, Joris Stavroulakis, Léo Jarry,
|
||||||
|
|
||||||
|
# Virtualisation, Containérisation d'OS, Stockage évolutif & résilient
|
||||||
|
|
||||||
|
Pour démarrer l'évaluation on est parti sur une VM avec ces spécifications :
|
||||||
|
|
||||||
|
- Debian 13.1.0-amd64-netinst
|
||||||
|
- 8 Coeurs Logiques
|
||||||
|
- 8 Go RAM
|
||||||
|
- 20 Go d'espace disque (disque 1, le disque système)
|
||||||
|
|
||||||
|
À partir de là on a commencé par installer toutes les dépendances nécessaires
|
||||||
|
|
||||||
|
## 1.1 Installation des paquets pour libvirt / KVM / Qemu
|
||||||
|
|
||||||
|
On commence par installer et configurer tout ce qui sera nécessaire pour la virtualisation :
|
||||||
|
|
||||||
|
sudo apt install bridge-utils cpu-checker libvirt-clients libvirt-daemon-system virtinst qemu-kvm virt-manager -y
|
||||||
|
|
||||||
|
sudo usermod -aG kvm $USER
|
||||||
|
sudo usermod -aG libvirt $USER
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/9c/9cd72a4f06ae45f9c4064b24287379f1a889a5293c39461a" data-crypto-key="cryptpad:xmYOKRlSW+p/hjbv0OGLGWxFjPQtrrmtlnHODPk4XBU="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/93/93f9e103690570d6f3d02210cf83edfcb736339a4d4b9c8d" data-crypto-key="cryptpad:psh9MPwR6SQLSQ3Al329EqQKAFHne0aCloKUD93F1eY="></media-tag>
|
||||||
|
|
||||||
|
## 1.2 Installation des paquets pour la containérisation LXC
|
||||||
|
|
||||||
|
Ensuite on installe tout ce qui sera nécessaire pour la conteneurisation :
|
||||||
|
|
||||||
|
sudo apt install lxc lxctl lxc-templates -y
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/5d/5df3047ef1e1af7c2d1db5b63a13ef05bd7c64cc12c99643" data-crypto-key="cryptpad:ksu/YqjuaAa+VzX9v4b204UzvB8AE+YwdYt9B0mrZ4Q="></media-tag>
|
||||||
|
|
||||||
|
## 1.3 Installation du paquet mdadm pour le RAID
|
||||||
|
|
||||||
|
Enfin on installe **mdadm** pour créer et gérer le RAID
|
||||||
|
|
||||||
|
sudo apt install mdadm -y
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/14/14b0ac45bb59e5e3129b86c25aca2258f3c4a0c83a9d36e5" data-crypto-key="cryptpad:cBJFqiRkkTMpkGLHfnntFkWHM9oM9w0uskFurA9d6Ec="></media-tag>
|
||||||
|
|
||||||
|
## 2.1 Ajout des 4 disques pour le RAID5 (3 disques actifs + un hotspare)
|
||||||
|
|
||||||
|
On a choisi un RAID de type 5 pour la tolérance de panne **et** les performances, on est parti sur des disques de 4Go, ce qui s'avèrera (voir la suite) ne pas être assez, donc il faudra agrandir par la suite :
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/2b/2b3f74a732f1f3ddcd8b05b3ada85b08f4c916d71ae8ddc9" data-crypto-key="cryptpad:C8bfHXiX9/Tunv2+olxN5HDBlXvqCmzprPxIHthhITs="></media-tag>
|
||||||
|
|
||||||
|
## 2.2 Mise en place du RAID5
|
||||||
|
|
||||||
|
D'abord on repère les disques qu'on va mettre dans le RAID :
|
||||||
|
|
||||||
|
sudo lsblk
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/5c/5c0a911256e37aa48cf61d833c051d450615863e03b97fca" data-crypto-key="cryptpad:d/EpZVHUm8sL/5bxPqFu+cuVqYaknQC+tqYk1fuZhPc="></media-tag>
|
||||||
|
|
||||||
|
Ensuite on créé ce dernier en précisant le type et le nom :
|
||||||
|
|
||||||
|
sudo mdadm --create /dev/md1 --level=5 --raid-devices=3 /dev/sdb /dev/sdc /dev/sdd
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/63/630186676c496c657c4e0f9de90104a721dff9d91f87ad91" data-crypto-key="cryptpad:DxFDrJxMlMk4mmRIokEmtRtFdV1BqJMvv71fFt3DKsU="></media-tag>
|
||||||
|
|
||||||
|
On ajoute le disque ***sde*** en tant que hotspare pour notre RAID :
|
||||||
|
|
||||||
|
sudo mdadm --add /dev/md1 /dev/sde
|
||||||
|
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/9c/9c4835e947ef82ee5c21e28a94f9110f4190ab178320a7a5" data-crypto-key="cryptpad:au7wZjM/DC0U0MPy6t97+s+h4uTc9pE3MztTZZj4aLg="></media-tag>
|
||||||
|
|
||||||
|
On vérifie que tout est en place :
|
||||||
|
|
||||||
|
sudo mdadm --detail /dev/md1
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/c3/c36057cabdd3b5fbe899870d1d1756b40e5d21b13e68984d" data-crypto-key="cryptpad:qBgoCP//ADl6jEjDh1u4DGXfJhzxOwUWJ2nrK54r5UM="></media-tag>
|
||||||
|
|
||||||
|
On voit que le RAID5 avec *hotspare* est bien en place, on peut passer à la partie LVM
|
||||||
|
|
||||||
|
## 2.3 Mise en place du LVM
|
||||||
|
|
||||||
|
Ici on commence par déclarer le pv qu'on va utiliser, notre RAID :
|
||||||
|
|
||||||
|
sudo pvcreate /dev/md1
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/69/69e4a894c430e812a2dc36cfcef6a02c3c018f6703d9364a" data-crypto-key="cryptpad:uf18KubsvRYQMW/Hcnejf2mVew2wtXq4sOqcLMvH99I="></media-tag>
|
||||||
|
|
||||||
|
Ensuite on créé le volume group nommé ***eval*** et les deux logical volume ***vms*** et ***conteneurs*** :
|
||||||
|
|
||||||
|
sudo vgcreate eval /dev/md1
|
||||||
|
|
||||||
|
sudo lvcreate -l 50%FREE -n vms eval
|
||||||
|
|
||||||
|
sudo lvcreate -l 100%FREE -n conteneurs eval
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/0d/0d850ebbbfe9c351926e1f977d4dc7d0f15a5841b71fc709" data-crypto-key="cryptpad:SZn+5Ho1g2eLKOTIlUZkZ8reASiM1OhuYP0W4caPXfU="></media-tag>
|
||||||
|
|
||||||
|
Ensuite on formate les volumes pour mettre le système de fichiers *ext4* :
|
||||||
|
|
||||||
|
sudo mkfs.ext4 /dev/mapper/eval-vms
|
||||||
|
|
||||||
|
sudo mkfs.ext4 /dev/mapper/eval-conteneurs
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/39/3938c6e3c15112a89caa8804381cf3e7ab3177b671da302d" data-crypto-key="cryptpad:pY2ZgfH5v9Yz0mSzVsklX/kN04T4SqNyogZpGsHsmzM="></media-tag>
|
||||||
|
|
||||||
|
Puis on ajoute les labels :
|
||||||
|
|
||||||
|
sudo tune2fs -L vmsfs /dev/mapper/eval-vms
|
||||||
|
|
||||||
|
sudo tune2fs -L conteneursfs /dev/mapper/eval-conteneurs
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/14/14ee8b862cf1fa9775fe8e1269709c0f55238ef4be39e758" data-crypto-key="cryptpad:n8PAhJ64GMaoIk1ypNf7fUvWrpTlQKnZfZ0hjqnCCvQ="></media-tag>
|
||||||
|
|
||||||
|
On vérifie qu'ils sont bien mis :
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/f0/f02fc6dad2118f18802e4c95c9eea665f61d307e36469e40" data-crypto-key="cryptpad:C8stCyVXhksub85vBKoGvBXC1Re7GFbk9En2kvRKgjw="></media-tag>
|
||||||
|
|
||||||
|
## 2.4 Mise en place du montage au démarrage
|
||||||
|
|
||||||
|
On prépare les dossiers pour le montage de nos volumes :
|
||||||
|
|
||||||
|
sudo mkdir -p /mnt/vms /mnt/conteneurs
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/b5/b51ea5967a9435301f7202d81c9f0d5aea45b09574c07ef2" data-crypto-key="cryptpad:59ETfguz+UHjN6sZfe0HTl3FlMZ1JEGnQ+iY+ZeLDSA="></media-tag>
|
||||||
|
|
||||||
|
On modifie le fstab pour que le montage se fasse au démarrage du système :
|
||||||
|
|
||||||
|
sudo nano /etc/fstab
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/dc/dcbdf8ad45ee0ea4758b08bd2c429123b893a26d8dd740fa" data-crypto-key="cryptpad:FJPrymuTZ1TCMYl+TD2+3898XsErQpFCZ4LfaE37EnM="></media-tag>
|
||||||
|
|
||||||
|
### 2.5 Montage des volumes
|
||||||
|
|
||||||
|
Ici on le monte directement (plutôt que de devoir redémarrer), pour ça on oublie pas de relancer le service :
|
||||||
|
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/ef/efc9365824f907bd8e6f8b19ee289a90d8ef7359d50babd6" data-crypto-key="cryptpad:9/v3TUck5tVTV4vMVTudJfcZ2DfSnG5N4YegOljWMmo="></media-tag>
|
||||||
|
|
||||||
|
On monte les volumes sur les dossiers précédemment créés :
|
||||||
|
|
||||||
|
sudo mount -t ext4 /dev/mapper/eval-vms /mnt/vms
|
||||||
|
sudo mount -t ext4 /dev/mapper/eval-conteneurs /mnt/conteneurs
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/38/3851f0cfe90736849fb40b373e241c21420ee73ecba8f6ea" data-crypto-key="cryptpad:4KfVWIMmBobeulibZiozjFaz7+oNOq93e5u0w3bEM9o="></media-tag>
|
||||||
|
|
||||||
|
## 3.1 Installation des conteneurs LXC
|
||||||
|
|
||||||
|
Maintenant que tout est préparé on peut commencer à faire les conteneurs et les vms, on a décidé de commencer par les conteneurs
|
||||||
|
|
||||||
|
### 3.1.1 Le conteneur Debian
|
||||||
|
|
||||||
|
On installe le conteneur Debian :
|
||||||
|
|
||||||
|
sudo lxc-create -n debianLXC -t download -- -d debian -r bullseye
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/40/40d8ecb2850732611e0ef0f472b6ff6340cc4f479f428362" data-crypto-key="cryptpad:uq8h3EP/n0BHebZbxfA16ZsqGqRluCHuNeQcZ5FtzIE="></media-tag>
|
||||||
|
|
||||||
|
On crée le dossier qui servira de volume rattaché à ce conteneur :
|
||||||
|
|
||||||
|
sudo mkdir /mnt/conteneurs/debianlxc
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/ef/efc44707ee7eabbdbfe23563e57707399f7d5341e339c44c" data-crypto-key="cryptpad:yo1dE2qOV4J+sSacIYPqexRRDLgCSTMPGds5vuxdjQw="></media-tag>
|
||||||
|
|
||||||
|
On va modifier le fichier de config pour le rattacher justement :
|
||||||
|
|
||||||
|
sudo nano /var/lib/lxc/debianLXC/config
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/b5/b5b52a75f1658a40b32e6027d97fff36419f53ce1f6a82db" data-crypto-key="cryptpad:P/ciZg6I12Bi7P4c0W8MLsK2zqJnuhz4DdDoUeXjHOs="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/4d/4d535bd8e670fd9ee89d1a1c5d2f34cb091cb16a475ccda0" data-crypto-key="cryptpad:7t7MXfJyVn7bTWFxCr797j5yyg57ESbQnWZyjLJyWE8="></media-tag>
|
||||||
|
|
||||||
|
### 3.1.2 Le conteneur Ubuntu
|
||||||
|
|
||||||
|
On installe le conteneur Ubuntu :
|
||||||
|
|
||||||
|
sudo lxc-create -n ubuntuLXC -t download -- -d ubuntu -r noble
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/fe/febd60a7eac6310802935ad72199d62113fe1b02e822f619" data-crypto-key="cryptpad:neiBuwyda8neNhYWeHDIftJDnKcr2QMgYhT34wyPMjM="></media-tag>
|
||||||
|
|
||||||
|
On créé le dossier qui servira de volume rattaché à ce conteneur :
|
||||||
|
|
||||||
|
sudo mkdir /mnt/conteneurs/ubuntulxc
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/be/bec36cbc8e80e4e7fa72f74f74bf4782a2db9b7d01746d09" data-crypto-key="cryptpad:dH4/fylYvmuUVr90ev2kwq8QWI11/PAwFPK2zTNGTPA="></media-tag>
|
||||||
|
|
||||||
|
On va modifier le fichier de config pour le rattacher justement :
|
||||||
|
|
||||||
|
sudo nano /var/lib/lxc/ubuntuLXC/config
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/d1/d15272f1b623442f67af27a41e2418373fc551c4f9fe7e18" data-crypto-key="cryptpad:LW9VN4rJDGUyC1NDO7eTamVTJTh/cKLjgE3y1J3agDc="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/62/6281a6155012d3ea8d3efaaf03d801bdaeb8968c6656b703" data-crypto-key="cryptpad:Nzo01YrudSAFpGqlj6Q/CqFEzd4yGbQuv7oadGHXkVc="></media-tag>
|
||||||
|
|
||||||
|
### 3.1.3 Le conteneur Fedora
|
||||||
|
|
||||||
|
On installe le conteneur Fedora :
|
||||||
|
|
||||||
|
sudo lxc-create -n fedoraLXC -t download -- d fedora -r 42
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/de/dec127fcb5f2fef990c9dae7e648a23341d9dcfeebc51dd3" data-crypto-key="cryptpad:Gz4m25ZGx2Ut0l7jy73MX8l4+vsaRVknk3ykfP4nPZE="></media-tag>
|
||||||
|
|
||||||
|
On crée le dossier qui servira de volume rattaché à ce conteneur :
|
||||||
|
|
||||||
|
sudo mkdir /mnt/conteneurs/fedoralxc
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/8e/8ed4e36f2d2567341392aaf844eb7d68125a7214585a539b" data-crypto-key="cryptpad:3oa/1rk1MwadnBkCTD0FsDEtgosOEZAi9iOtVQW07+s="></media-tag>
|
||||||
|
|
||||||
|
On va modifier le fichier de config pour le rattacher justement :
|
||||||
|
|
||||||
|
sudo nano /var/lib/lxc/fedoraLXC/config
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/4a/4a7fda7e748fcfe8065a00545421ef44ad51fd08a571778f" data-crypto-key="cryptpad:xWNDUAad/ZnYdWo5KnJN6Bw7FoG6w0Tz2CUDhMhwJRk="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/5f/5fe86ceb86dc605d6e4534ab71be0f9df6be2a4db77a7a9d" data-crypto-key="cryptpad:hiAh5/oNuJRDlHVAq3w/63iKY1BqYAH+dSvdB1sr1k0="></media-tag>
|
||||||
|
|
||||||
|
## 3.2 Installation des VMS
|
||||||
|
|
||||||
|
Maintenant que les conteneurs sont installés et configurés on passe aux VMs
|
||||||
|
|
||||||
|
### 3.2.1 La VM Debian
|
||||||
|
|
||||||
|
On commence à créer un dossier dans lequel on rangera le disque de la VM (ainsi que son iso au passage) :
|
||||||
|
|
||||||
|
sudo mkdir debian
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/31/31f9dc7e9c0297eed0228692138981218e5c47e4b5bd37ed" data-crypto-key="cryptpad:vTERowwrpitSK7f2DXN5gX/XewVlDrKeZ9hp91Indnw="></media-tag>
|
||||||
|
|
||||||
|
On télécharge le fichier iso :
|
||||||
|
|
||||||
|
sudo wget https://cdimage.debian.org/mirror/cdimage/archive/11.11.0/amd64/iso-cd/debian-11.11.0-amd64-netinst.iso
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/73/7301bcd725e717fa22fe7ed8eac1a1e642d1a6e5b6218e61" data-crypto-key="cryptpad:R2i36nJXlx5IGNyIwZpWG/QKQucsUBATu7BuJIU+F2I="></media-tag>
|
||||||
|
|
||||||
|
On crée le disque (qui s'avèrera trop petit, voir la suite) :
|
||||||
|
|
||||||
|
sudo qemu-img create -f qcow2 debian.qcow2 2G
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/d9/d9baa18e4dc17d4d1a12be63b7c00787fca9640e7be2f52a" data-crypto-key="cryptpad:JsxrbrbfwH0bfenUenvk3KZDswQjcqk5vvPIpmJRUqU="></media-tag>
|
||||||
|
|
||||||
|
On lance l'installation avec ***virt-install*** :
|
||||||
|
|
||||||
|
sudo virt-install \
|
||||||
|
--name debianVM \
|
||||||
|
--os-variant=debian11 \
|
||||||
|
--ram 2048 \
|
||||||
|
--vcpus 2 \
|
||||||
|
--location /mnt/vms/debian/debian-11.11.0-amd64-netinst.iso \
|
||||||
|
--disk debian.qcow2 \
|
||||||
|
--graphics none \
|
||||||
|
--console pty,target_type=serial \
|
||||||
|
--extra-args='console=ttyS0,115200n8 serial'
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/41/4186b87fe73e5996c19a4e44630631c4eefd1d791cc429ef" data-crypto-key="cryptpad:n85CcKoSA02D2icTzUrCeavaAMJ1RXPbigI09mD16U0="></media-tag>
|
||||||
|
|
||||||
|
On a manqué de place pour l'installation, donc on rajoute deux disques de 4Go au raid et au LVM pour recommencer :
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/ba/ba799c916d57a0c60d87413e3d40f4bb045c7395b0c85e5d" data-crypto-key="cryptpad:dIgiQfo8mDCeDWiG0+kl+jFliFqqD3Mg2u2rdAaer2w="></media-tag>
|
||||||
|
|
||||||
|
|
||||||
|
On ajoute nos deux disques au RAID (Après le reboot le md1 a été renommé par le système en md127) :
|
||||||
|
|
||||||
|
sudo mdadm --add /dev/md127 /dev/sdf /dev/sdg
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/78/781ba4595e2eaf843e67e9b011044fed1e56f66e13960f98" data-crypto-key="cryptpad:FnScioCuM2cPk34phyf8kg17xi/LDtZMhR4PZJCdaOM="></media-tag>
|
||||||
|
|
||||||
|
On oublie pas cette commande, sinon nos disques seront juste en spare :
|
||||||
|
|
||||||
|
sudo mdadm --grow /dev/md127 --raid-devices=5
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/d9/d9349cdaaed4b7f69a709fbf2f37419c9c35159d8855b383" data-crypto-key="cryptpad:9VNUEYRjDnIpv0aqsl6e++BsNDMpGI/QVYxeKvdcV1s="></media-tag>
|
||||||
|
|
||||||
|
*Et ensuite il faut bien sûr étendre le LVM (**après avoir attendu que le reshape du RAID ait fini**)*
|
||||||
|
|
||||||
|
On commence par resize le pv :
|
||||||
|
|
||||||
|
sudo pvresize /dev/md127
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/de/de6710544f95f3ed6863d47d7a22c586a6f6f154f919aaee" data-crypto-key="cryptpad:2YOBmZhXlD1DFv1PGsV1MNbbLAxv5jmJPkquMLP0SMA="></media-tag>
|
||||||
|
|
||||||
|
On étend ensuite notre volume dédié au VM pour lui accorde 100% du nouvel espace libre :
|
||||||
|
|
||||||
|
sudo lvextend -l +100%FREE --resizefs /dev/mapper/eval-vms
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/af/af1454927752414639c8583694ccabfff5e151de5ec044e1" data-crypto-key="cryptpad:gyVGn4TWL5w7Tzs0503zfbejDT+sbS1/XhBHBsfBw5E="></media-tag>
|
||||||
|
|
||||||
|
Ensuite on undefine le debianVM créé précédemment pour refaire l'installation à zéro :
|
||||||
|
|
||||||
|
*(Cette étape est nécessaire pour pouvoir utiliser le disque avec le même nom qu'avant, sinon virt croit que le disque est déjà utilisé par une autre VM)*
|
||||||
|
|
||||||
|
sudo virsh undefine debianVM
|
||||||
|
|
||||||
|
Puis on supprime le disque :
|
||||||
|
|
||||||
|
sudo rm debian.qcow2
|
||||||
|
|
||||||
|
Et on le recrée avec une plus grande taille :
|
||||||
|
|
||||||
|
sudo qemu-img create -f qcow2 debian.qcow2 5G
|
||||||
|
|
||||||
|
Et on refait l'installation avec la commande virt-install utilisée au-dessus, voici le résultat :
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/1e/1e4b5cf1dedc44937084cb725f9f7add1b2a6b7551a9b590" data-crypto-key="cryptpad:imkCtErKM8sLwX2TS/GrD2vILyp9ugnvvYEuzjxHpk8="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/fc/fca279a55474fe6d4e68b2eb683cad42b412db3784617b5d" data-crypto-key="cryptpad:RhvA2BEHKPxsCjYv/qfqIs5B4YkPGf1f/HnUzzvGqkI="></media-tag>
|
||||||
|
|
||||||
|
### 3.2.2 La VM Ubuntu
|
||||||
|
|
||||||
|
On commence à créer un dossier dans lequel on rangera le disque de la VM (ainsi que son iso au passage) :
|
||||||
|
|
||||||
|
sudo mkdir /mnt/vms/ubuntu
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/e4/e4d92d09be3a521db140229e5beb0cfea8abf2a0c0c4d412" data-crypto-key="cryptpad:rTGMAPCavmig2pKE/p3n5hyquc1BdwMXifZj75RlXdc="></media-tag>
|
||||||
|
|
||||||
|
On télécharge le fichier iso :
|
||||||
|
|
||||||
|
sudo wget https://cdimage.ubuntu.com/ubuntu-legacy-server/releases/20.04/release/ubuntu-20.04.1-legacy-server-amd64.iso
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/f4/f450926458dac5270e72c6fa79bb6d22803215ffe506cdeb" data-crypto-key="cryptpad:qFDOYX7aL/CAf65jW1bXpD92WIoVbB38KGJ07k9C/Zs="></media-tag>
|
||||||
|
|
||||||
|
On créé notre disque de 6Go :
|
||||||
|
|
||||||
|
sudo qemu-img create -f qcow2 ubuntu.qcow2 6G
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/20/203f8565203dcc2d49323c885d4fcc015b9e514eaa291ca4" data-crypto-key="cryptpad:CsydruhHoV3VKjfGjEjGc88HgJBV5JZHBf3V277dsWU="></media-tag>
|
||||||
|
|
||||||
|
On lance l'installation :
|
||||||
|
|
||||||
|
sudo virt-install \
|
||||||
|
--name ubuntuVM \
|
||||||
|
--os-variant=ubuntu20.04 \
|
||||||
|
--ram 4096 \
|
||||||
|
--vcpus 4 \
|
||||||
|
--location /mnt/vms/ubuntu/ubuntu-20.04.1-legacy-server-amd64.iso \
|
||||||
|
--disk ubuntu.qcow2 \
|
||||||
|
--graphics none \
|
||||||
|
--console pty,target_type=serial \
|
||||||
|
--extra-args='console=ttyS0,115200n8 serial'
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/f0/f0148c74a643715c2b3290ba19a2dfab50226c0296532792" data-crypto-key="cryptpad:b6iZnvO4SW/bT5OcVw4u04BMMBHB/M26VSHtciZMOVw="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/d9/d9ea5dd8171e6e315f39892595286a4154acffbd45255480" data-crypto-key="cryptpad:ryP22LbOuAtRfQakA+miZI0MGeEHowhC6LoRFcoAaeM="></media-tag>
|
||||||
|
|
||||||
|
L'installation du ubuntu va jusqu'au bout, mais après on a un écran "noir" comme mentionné par le formateur, donc impossible d'aller plus loin :
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/b0/b055a09b6a3fa8a7d0eda8d8d9e526579e4538a4828ece0b" data-crypto-key="cryptpad:C27BL+GZSyKOWENfzuW+entS+91eLKtTHhHFMMoLM1I="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/5c/5ccaa2ae0762544b9b5be2d107f942f8673eafd940860dc2" data-crypto-key="cryptpad:z/Gt2mqiT505XOJ5iOl2KdDHhtCQT+a0SKBA9hRjOFY="></media-tag>
|
||||||
|
|
||||||
|
Mais on a réussi à y accéder grâce à SSH et au final tout fonctionne :
|
||||||
|
|
||||||
|
sudo nmap 192.168.122.0/24 -sP # pour trouver l'ip de la VM ubuntu
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/85/8562e2daf46bc7a62282c0a3c48820d76b72846b06a19328" data-crypto-key="cryptpad:K1z83sJcK3K1MyDf6dSw3EahvlVOzSoNwqTknFH9uak="></media-tag>
|
||||||
|
|
||||||
BIN
Semaine_01/Jour_05_Examen.pdf
Normal file
BIN
Semaine_01/Jour_05_Examen.pdf
Normal file
Binary file not shown.
79
Semaine_02/Jour_01.md
Normal file
79
Semaine_02/Jour_01.md
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
# CEPH : Architecture générale
|
||||||
|
|
||||||
|
## Programme
|
||||||
|
|
||||||
|
- CEPH
|
||||||
|
- VLAN
|
||||||
|
- Trunking
|
||||||
|
- Routage Inter-VLAN
|
||||||
|
|
||||||
|
## Objectifs
|
||||||
|
|
||||||
|
Nécessité du CEPH, son architecture, le rôle de CRUSH, des Pools, des PG. Distinguer les 3 services de stockage possibles. Connaître les bonnes pratiques.
|
||||||
|
|
||||||
|
### Pourquoi CEPH
|
||||||
|
|
||||||
|
Il peut continuer le stockage en cas de panne de disque/noeud/switch. Plus évolué que le RAID, il trouvera d'autres stockages en :
|
||||||
|
- scalant en ajoutant des machines
|
||||||
|
- ne se concentrant pas sur un SPOF
|
||||||
|
- utilisant du stockage bloc, fichier, ou l'objet
|
||||||
|
- équilibrant le stockage avec ce qu'il a à disposition
|
||||||
|
|
||||||
|
CEPH repose sur une couche logicielle nommée RADOS, composée de 3 daemons :
|
||||||
|
- MON (ceph-mon) : Moniteur, gère la carte du cluster (qui est en vie, où sont les données, quelles règles de placement)
|
||||||
|
- OSD (ceph-osd) : Stocke les données
|
||||||
|
- MGR (ceph-mgr) : Manager, surveille, fournit de la métrique, met de l'orchestration supplémentaire
|
||||||
|
|
||||||
|
Il existe des démons supplémentaires :
|
||||||
|
- MDS (ceph-mds) : Uniquement si on stocke en mode système de fichiers, avec CephFS
|
||||||
|
- RGW (radosgw) : Passerelle (Gateway) pour stockage S3
|
||||||
|
- RBD (radosblocks) : Stockage en mode blocs
|
||||||
|
|
||||||
|
### Où se trouvent les données
|
||||||
|
|
||||||
|
Ceph utilise l'algorithme CRUSH. Il décide où mettre les données en fonction d'une carte décrivant une topologie.
|
||||||
|
- Le placement est déterministe : tout le monde obtient le même résultat chacun de son côté.
|
||||||
|
- Pas de BDD.
|
||||||
|
|
||||||
|
### Nomenclature
|
||||||
|
|
||||||
|
- POOL : zone virtuelle
|
||||||
|
- PG : *Placement Group*, Groupes de placement
|
||||||
|
- OSD : Disque de stockage
|
||||||
|
|
||||||
|
Un Pool est découpé en PGs avec chacun ses OSDs (vous m'suivez ?)
|
||||||
|
|
||||||
|
## Mise en place
|
||||||
|
|
||||||
|
Commande centrale :
|
||||||
|
`cephadm`
|
||||||
|
|
||||||
|
Générer le premier noaud :
|
||||||
|
`cephadm bootstrap --mon-node Noeud1`
|
||||||
|
|
||||||
|
Cela installe :
|
||||||
|
- 1 MON
|
||||||
|
- 1 MGR
|
||||||
|
- 1 shell CEPH
|
||||||
|
|
||||||
|
Vérifier la santé :
|
||||||
|
`ceph status`
|
||||||
|
|
||||||
|
Vérifier la topologie :
|
||||||
|
`ceph osd tree`
|
||||||
|
|
||||||
|
Vérifier l'espace :
|
||||||
|
`ceph df`
|
||||||
|
|
||||||
|
Activer la Web UI (pour un cluster déjà mis en service) :
|
||||||
|
`ceph mgr module enable dashboard`
|
||||||
|
|
||||||
|
## Exercice 1
|
||||||
|
|
||||||
|
1. Quel protocole utilisent les MON et MGR pour communiquer entre eux ?
|
||||||
|
2. Quelle(s) sont le(s) bonne(s) pratique(s) auxquelles cet exercice ne se plie pas ?
|
||||||
|
3. À quoi sert le SSH dans une infrastructure Ceph ?
|
||||||
|
4. La WebUI semble t-elle protéger les communications via un chiffrement SSL/TLS ?
|
||||||
|
5. Quelle est la différence entre le Backfill et le Recovery ?
|
||||||
|
|
||||||
|
## Exercice 2
|
||||||
Binary file not shown.
274
Semaine_02/Jour_02.md
Normal file
274
Semaine_02/Jour_02.md
Normal file
@@ -0,0 +1,274 @@
|
|||||||
|
#
|
||||||
|
|
||||||
|
## Exercice 1
|
||||||
|
|
||||||
|
```
|
||||||
|
SW1#
|
||||||
|
SW1#configure terminal
|
||||||
|
SW1(config)#vlan 10
|
||||||
|
SW1(config-vlan)#name VLAN0010
|
||||||
|
SW1(config-vlan)#interface Fa0/1
|
||||||
|
SW1(config-if)#switchport mode access
|
||||||
|
SW1(config-if)#switchport access vlan 10
|
||||||
|
SW1(config-if)#no shutdown
|
||||||
|
SW1(config-if)#end
|
||||||
|
SW1#write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
SW1#
|
||||||
|
SW1#configure terminal
|
||||||
|
SW1(config)#interface Fa0/3
|
||||||
|
SW1(config-if)#switchport mode trunk
|
||||||
|
SW1(config-if)#switchport trunk native vlan 10
|
||||||
|
SW1(config-if)#switchport nonegotiate
|
||||||
|
SW1(config-if)#end
|
||||||
|
SW1#write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
SW1#
|
||||||
|
SW1#configure terminal
|
||||||
|
SW1(config)#interface Fa0/3
|
||||||
|
SW1(config-if)#switchport mode trunk
|
||||||
|
SW1(config-if)#switchport trunk native vlan 1
|
||||||
|
SW1(config-if)#switchport trunk allowed vlan 1,10,20
|
||||||
|
SW1(config-if)#end
|
||||||
|
SW1#write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
## Cours
|
||||||
|
|
||||||
|
### Port-Channelling
|
||||||
|
|
||||||
|
Agrégation de liens entre plusieurs switchs : augmenter la bande passante à l'infini.
|
||||||
|
|
||||||
|
- Câble virtuel : nommé LAG (*Link Agregation Group*)
|
||||||
|
Une fois créé, le LAG doit être administré comme une interface physique.
|
||||||
|
|
||||||
|
#### Les standards
|
||||||
|
|
||||||
|
- Le Port-Channel : standard ouvert de l'IEEE
|
||||||
|
- Etherchannel : protocole propriétaire de Cisco
|
||||||
|
|
||||||
|
De 2 à 8 interfaces physiques max par LAG. Uniquement de même type et de débit. Avec un seul destinataire.
|
||||||
|
Maximum 6 LAGs par Switch. (donc 6 LAGs x 8 ports, ça fait un switch de 48 ports).
|
||||||
|
|
||||||
|
Implémentations :
|
||||||
|
- Statiques : l'existence du LAG est décidée par l'admin
|
||||||
|
- Dynamiques : les appareils négocient entre eux l'établissement d'un LAG si besoin, via un protocole.
|
||||||
|
|
||||||
|
Les protocoles d'auto-établissement de LAG :
|
||||||
|
- PAgP : Propriétaire Cisco
|
||||||
|
- LACP : Standard IEEE 803.2ad
|
||||||
|
|
||||||
|
Il suffit pour activer de dire `desirable` en console :
|
||||||
|
- Desirable : *J'initie la négociation du LAG*
|
||||||
|
- Auto : *J'attends qu'on vienne négocier*
|
||||||
|
|
||||||
|
## Exercice 3
|
||||||
|
|
||||||
|
### Liaison entre SW1 et SW2
|
||||||
|
|
||||||
|
```
|
||||||
|
Switch1>enable
|
||||||
|
Switch1#configure terminal
|
||||||
|
Switch1(config)#interface range Fa0/1 - 3
|
||||||
|
Switch1(config-if-range)#channel-group 1 mode active
|
||||||
|
Switch1(config-if-range)#exit
|
||||||
|
Switch1(config)#interface port-channel 1
|
||||||
|
Switch1(config-if)#description LACP-SW1-SW2
|
||||||
|
Switch1(config-if)#switchport mode trunk
|
||||||
|
Switch1(config-if)#exit
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
Switch2>enable
|
||||||
|
Switch2#configure terminal
|
||||||
|
Switch2(config)#interface range Fa0/4 - 6
|
||||||
|
Switch2(config-if-range)#channel-group 1 mode active
|
||||||
|
Switch2(config-if-range)#exit
|
||||||
|
Switch2(config)#interface port-channel 1
|
||||||
|
Switch2(config-if)#description LACP-SW1-SW2
|
||||||
|
Switch2(config-if)#switchport mode trunk
|
||||||
|
Switch2(config-if)#exit
|
||||||
|
```
|
||||||
|
|
||||||
|
### Liaison entre SW2 et SW3
|
||||||
|
|
||||||
|
```
|
||||||
|
Switch2>enable
|
||||||
|
Switch2#configure terminal
|
||||||
|
Switch2(config)#interface range Fa0/1 - 3
|
||||||
|
Switch2(config-if-range)#channel-group 2 mode active
|
||||||
|
Switch2(config-if-range)#exit
|
||||||
|
Switch2(config)#interface port-channel 2
|
||||||
|
Switch2(config-if)#description LACP-SW2-SW3
|
||||||
|
Switch2(config-if)#switchport mode trunk
|
||||||
|
Switch2(config-if)#exit
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
Switch3>enable
|
||||||
|
Switch3#configure terminal
|
||||||
|
Switch3(config)#interface range Fa0/4 - 6
|
||||||
|
Switch3(config-if-range)#channel-group 2 mode active
|
||||||
|
Switch3(config-if-range)#exit
|
||||||
|
Switch3(config)#interface port-channel 2
|
||||||
|
Switch3(config-if)#description LACP-SW2-SW3
|
||||||
|
Switch3(config-if)#switchport mode trunk
|
||||||
|
Switch3(config-if)#exit
|
||||||
|
```
|
||||||
|
|
||||||
|
### Liaison entre SW3 et SW1
|
||||||
|
|
||||||
|
```
|
||||||
|
Switch3>enable
|
||||||
|
Switch3#configure terminal
|
||||||
|
Switch3(config)#interface range Fa0/1 - 3
|
||||||
|
Switch3(config-if-range)#channel-group 3 mode active
|
||||||
|
Switch3(config-if-range)#exit
|
||||||
|
Switch3(config)#interface port-channel 3
|
||||||
|
Switch3(config-if)#description LACP-SW3-SW1
|
||||||
|
Switch3(config-if)#switchport mode trunk
|
||||||
|
Switch3(config-if)#exit
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
Switch1>enable
|
||||||
|
Switch1#configure terminal
|
||||||
|
Switch1(config)#interface range Fa0/4 - 6
|
||||||
|
Switch1(config-if-range)#channel-group 3 mode active
|
||||||
|
Switch1(config-if-range)#exit
|
||||||
|
Switch1(config)#interface port-channel 3
|
||||||
|
Switch1(config-if)#description LACP-SW3-SW1
|
||||||
|
Switch1(config-if)#switchport mode trunk
|
||||||
|
Switch1(config-if)#exit
|
||||||
|
```
|
||||||
|
|
||||||
|
## Exercice 4
|
||||||
|
|
||||||
|
**TP : Mise en œuvre du protocole HSRP dans un réseau redondant**
|
||||||
|
|
||||||
|
*Objectif*
|
||||||
|
Mettre en place une **redondance de passerelle** à l’aide du protocole **HSRP (Hot Standby Router Protocol)**, afin d’assurer la **continuité de service** en cas de défaillance d’un routeur.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Réseau partagé** : 192.168.1.0/24
|
||||||
|
**Passerelle virtuelle HSRP** : 192.168.1.1
|
||||||
|
|
||||||
|
### 1 & 2
|
||||||
|
|
||||||
|
```
|
||||||
|
Router1>enable
|
||||||
|
Router1#configure terminal
|
||||||
|
Router1(config)#interface Gig0/0/0
|
||||||
|
Router1(config-if)#ip address 192.168.1.200 255.255.255.0
|
||||||
|
Router1(config-if)#standby 1 ip 192.168.1.1
|
||||||
|
Router1(config-if)#standby 1 priority 150
|
||||||
|
Router1(config-if)#standby 1 preempt
|
||||||
|
Router1(config-if)#no shutdown
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
Router2>enable
|
||||||
|
Router2#configure terminal
|
||||||
|
Router2(config)#interface Gig0/0/0
|
||||||
|
Router2(config-if)#ip address 192.168.1.201 255.255.255.0
|
||||||
|
Router2(config-if)#standby 1 ip 192.168.1.1
|
||||||
|
Router2(config-if)#standby 1 priority 100
|
||||||
|
Router2(config-if)#standby 1 preempt
|
||||||
|
Router2(config-if)#no shutdown
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3
|
||||||
|
|
||||||
|
```
|
||||||
|
Router1#show standby brief
|
||||||
|
P indicates configured to preempt.
|
||||||
|
|
|
||||||
|
Interface Grp Pri P State Active Standby Virtual IP
|
||||||
|
Gig0/0/0 1 150 P Active local 192.168.1.201 192.168.1.1
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
Router2#show standby brief
|
||||||
|
P indicates configured to preempt.
|
||||||
|
|
|
||||||
|
Interface Grp Pri P State Active Standby Virtual IP
|
||||||
|
Gig0/0/0 1 100 P Standby 192.168.1.200 local 192.168.1.1
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4
|
||||||
|
|
||||||
|
### 5
|
||||||
|
|
||||||
|
1. HSRP est fermé par Cisco, VRRP est ouvert.
|
||||||
|
2.
|
||||||
|
3. L'adresse IP la plus haute remporterait le rôle Actif.
|
||||||
|
4. HSRP est une passerelle virtuelle avec du matériel en série pour éviter les SPOF. L'agrégation de liens est autre chose
|
||||||
|
|
||||||
|
## Exercice 5
|
||||||
|
|
||||||
|
### Liaison entre SW1 et SW2
|
||||||
|
|
||||||
|
```
|
||||||
|
SW1>enable
|
||||||
|
SW1#configure terminal
|
||||||
|
SW1(config)#interface range Fa0/3 - 4
|
||||||
|
SW1(config-if-range)#channel-group 1 mode active
|
||||||
|
SW1(config-if-range)#exit
|
||||||
|
SW1(config)#interface port-channel 1
|
||||||
|
SW1(config-if)#description LACP-SW1-SW2
|
||||||
|
SW1(config-if)#switchport mode trunk
|
||||||
|
SW1(config-if)#exit
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
SW2>enable
|
||||||
|
SW2#configure terminal
|
||||||
|
SW2(config)#interface range Fa0/3 - 4
|
||||||
|
SW2(config-if-range)#channel-group 1 mode active
|
||||||
|
SW2(config-if-range)#exit
|
||||||
|
SW2(config)#interface port-channel 1
|
||||||
|
SW2(config-if)#description LACP-SW1-SW2
|
||||||
|
SW2(config-if)#switchport mode trunk
|
||||||
|
SW2(config-if)#exit
|
||||||
|
```
|
||||||
|
|
||||||
|
### HSRP entre MLSW1 et MLSW2
|
||||||
|
|
||||||
|
```
|
||||||
|
MLSW1>enable
|
||||||
|
MLSW1#configure terminal
|
||||||
|
MLSW1(config)#interface vlan 10
|
||||||
|
MLSW1(config-if)#ip address 89.76.0.200 255.255.255.0
|
||||||
|
MLSW1(config-if)#standby 1 ip 89.76.0.1
|
||||||
|
MLSW1(config-if)#standby 1 priority 150
|
||||||
|
MLSW1(config-if)#standby 1 preempt
|
||||||
|
MLSW1(config-if)#no shutdown
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
MLSW2>enable
|
||||||
|
MLSW2#configure terminal
|
||||||
|
MLSW2(config)#interface vlan 10
|
||||||
|
MLSW2(config-if)#ip address 89.76.0.201 255.255.255.0
|
||||||
|
MLSW2(config-if)#standby 1 ip 89.76.0.1
|
||||||
|
MLSW2(config-if)#standby 1 priority 100
|
||||||
|
MLSW2(config-if)#standby 1 preempt
|
||||||
|
MLSW2(config-if)#no shutdown
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
Router0>enable
|
||||||
|
Router0#configure terminal
|
||||||
|
Router0(config)#ip routing
|
||||||
|
Router0(config)#interface Gig0/0/0
|
||||||
|
Router0(config-if)#ip address 89.76.0.254 255.255.255.0
|
||||||
|
Router0(config-if)#exit
|
||||||
|
Router0(config)#interface Gig0/0/1
|
||||||
|
Router0(config-if)#ip address 89.76.0.254 255.255.255.0
|
||||||
|
Router0(config-if)#exit
|
||||||
|
```
|
||||||
Binary file not shown.
BIN
Semaine_02/Jour_02/Exercice_2.pkt
Normal file
BIN
Semaine_02/Jour_02/Exercice_2.pkt
Normal file
Binary file not shown.
BIN
Semaine_02/Jour_02/Exercice_4.pkt
Normal file
BIN
Semaine_02/Jour_02/Exercice_4.pkt
Normal file
Binary file not shown.
BIN
Semaine_02/Jour_02/Exercice_5_debut.pkt
Normal file
BIN
Semaine_02/Jour_02/Exercice_5_debut.pkt
Normal file
Binary file not shown.
Binary file not shown.
52
Semaine_02/Jour_02/TP_HSRP_LAN.md
Normal file
52
Semaine_02/Jour_02/TP_HSRP_LAN.md
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# TP : Mise en œuvre du protocole HSRP dans un réseau redondant
|
||||||
|
|
||||||
|
## 🎯 Objectif
|
||||||
|
Mettre en place une **redondance de passerelle** à l’aide du protocole **HSRP (Hot Standby Router Protocol)**, afin d’assurer la **continuité de service** en cas de défaillance d’un routeur.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
🧱 **Réseau partagé** : 192.168.1.0/24
|
||||||
|
🎯 **Passerelle virtuelle HSRP** : 192.168.1.1
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚙️ Étapes du TP
|
||||||
|
|
||||||
|
### 1️⃣ Configuration IP de base
|
||||||
|
Configurer les adresses IP sur les deux routeurs et le PC selon le schéma ci-dessus.
|
||||||
|
Vérifier la connectivité entre les équipements avec la commande `ping`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 2️⃣ Configuration HSRP
|
||||||
|
Configurer HSRP sur les deux routeurs afin de partager une adresse IP virtuelle (192.168.1.1).
|
||||||
|
Le **Router1** doit être prioritaire.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 3️⃣ Vérification
|
||||||
|
Utiliser les commandes de vérification pour observer :
|
||||||
|
- Le routeur **actif**
|
||||||
|
- Le routeur **standby**
|
||||||
|
- L’adresse IP virtuelle et l’adresse MAC virtuelle associée
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 4️⃣ Test de bascule
|
||||||
|
1. Vérifier le rôle initial de chaque routeur.
|
||||||
|
2. Désactiver l’interface G0/0 de Router1 pour simuler une panne.
|
||||||
|
3. Vérifier le basculement automatique du rôle actif vers Router2.
|
||||||
|
4. Réactiver Router1 et observer le retour automatique à l’état initial.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 5️⃣ Questions de réflexion
|
||||||
|
|
||||||
|
1. Quelle est la différence entre HSRP et VRRP ?
|
||||||
|
2. Pourquoi configure-t-on la commande `preempt` ?
|
||||||
|
3. Que se passerait-il si les deux routeurs avaient la même priorité ?
|
||||||
|
4. Quelle est la différence entre HSRP et une agrégation de liens (EtherChannel) ?
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Fin du TP.**
|
||||||
BIN
Semaine_02/Jour_03/Exercice_5_suite.pkt
Normal file
BIN
Semaine_02/Jour_03/Exercice_5_suite.pkt
Normal file
Binary file not shown.
207
Semaine_02/Jour_04.md
Normal file
207
Semaine_02/Jour_04.md
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
# Sécurité en réseau
|
||||||
|
|
||||||
|
## Cours
|
||||||
|
|
||||||
|
### Travail dirigé
|
||||||
|
|
||||||
|
- Sécuriser le port console
|
||||||
|
- Sécuriser le passage au niveau 2 (*enable*)
|
||||||
|
- Sécuriser les ports réseau (*port-security*)
|
||||||
|
- Metter en place le SSH (*sur VLAN dédié*)
|
||||||
|
|
||||||
|
- BDPU Guard (*protéger le port d'un branchement à un autre switch*)
|
||||||
|
- ACLs (*standard et étendue*)
|
||||||
|
- Théorie des pare-feux
|
||||||
|
|
||||||
|
## Exercices
|
||||||
|
|
||||||
|
### Exercice 1
|
||||||
|
|
||||||
|
### Exercice 2
|
||||||
|
|
||||||
|
#### Partie 1
|
||||||
|
|
||||||
|
**Routeur**
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface Gig0/1
|
||||||
|
ip address 192.168.0.1 255.255.255.0
|
||||||
|
no shutdown
|
||||||
|
ip default-gateway 192.168.0.1
|
||||||
|
interface Gig0/1
|
||||||
|
ip address 192.168.1.1 255.255.255.0
|
||||||
|
no shutdown
|
||||||
|
ip default-gateway 192.168.1.1
|
||||||
|
no ip domain-lookup
|
||||||
|
enable secret class
|
||||||
|
line console 0
|
||||||
|
password cisco
|
||||||
|
login
|
||||||
|
line vty 0 4
|
||||||
|
password cisco
|
||||||
|
login
|
||||||
|
transport input all
|
||||||
|
service password-encryption
|
||||||
|
banner motd # You shan't access this very device without permission #
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
**Switch**
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
vlan 10
|
||||||
|
name VLAN10
|
||||||
|
exit
|
||||||
|
interface FastEthernet0/5
|
||||||
|
switchport mode access
|
||||||
|
switchport access vlan 99
|
||||||
|
spanning-tree portfast
|
||||||
|
interface FastEthernet0/6
|
||||||
|
switchport mode access
|
||||||
|
switchport access vlan 99
|
||||||
|
spanning-tree portfast
|
||||||
|
interface vlan 10
|
||||||
|
ip address 192.168.1.2 255.255.255.0
|
||||||
|
no shutdown
|
||||||
|
ip default-gateway 192.168.1.1
|
||||||
|
no ip domain-lookup
|
||||||
|
enable secret class
|
||||||
|
line console 0
|
||||||
|
password cisco
|
||||||
|
login
|
||||||
|
line vty 0 4
|
||||||
|
password cisco
|
||||||
|
login
|
||||||
|
transport input all
|
||||||
|
service password-encryption
|
||||||
|
banner motd # You shan't access this very device without permission #
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
### Exercice 3
|
||||||
|
|
||||||
|
#### Liste des commandes utiles
|
||||||
|
|
||||||
|
| Commandes | Descriptions |
|
||||||
|
|---------------------------------------------------------|------------------------------------------------------------------|
|
||||||
|
| conf t | Activate configuration from terminal |
|
||||||
|
| interface *interface* | Go in interface to configure it properly |
|
||||||
|
| ip access-group *ACL_name* **{in\|out}** | Activate and apply ACL to interface |
|
||||||
|
| **ip access-list extended** *ACL_name* | Define ACL and go into conf mode |
|
||||||
|
| **{permit\|deny}** {test conditions} | Defined apply policy for said ACL |
|
||||||
|
| **show access-lists** *ACL_name* | Display all ACLs content |
|
||||||
|
| **show ip interface** *interface-type interface number* | Display IP infos from specific interface, including applied ACLs |
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
|
```
|
||||||
|
router> enable
|
||||||
|
router# configure terminal
|
||||||
|
router(config)# access-list 10 deny 10.1.1.101 0.0.0.0
|
||||||
|
router(config)# access-list 10 permit any
|
||||||
|
router(config)# line vty 0 4
|
||||||
|
router(config-line)# access-class 10 in
|
||||||
|
router(config-line)# exit
|
||||||
|
router(config)# interface GigabitEthernet0/0
|
||||||
|
router(config-if)# ip access-group 10 in
|
||||||
|
router(config)# exit
|
||||||
|
router# write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
### Exercice 4
|
||||||
|
|
||||||
|
#### Tâche 1
|
||||||
|
|
||||||
|
```
|
||||||
|
ping 172.16.1.100
|
||||||
|
traceroute 172.16.1.100
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
show interfaces Gig0/1
|
||||||
|
conf t
|
||||||
|
ip route 0.0.0.0 0.0.0.0 209.165.201.2
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Tâche 2
|
||||||
|
|
||||||
|
```
|
||||||
|
telnet 172.16.1.100 23
|
||||||
|
telnet 172.16.1.100 80
|
||||||
|
```
|
||||||
|
|
||||||
|
### Exercice 5
|
||||||
|
|
||||||
|
**R1**
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface Gig0/0
|
||||||
|
ip address 192.168.0.5 255.255.255.252
|
||||||
|
no shutdown
|
||||||
|
interface Gig0/1
|
||||||
|
ip address 192.168.0.2 255.255.255.252
|
||||||
|
no shutdown
|
||||||
|
router ospf 21
|
||||||
|
network 192.168.0.0 0.0.0.3 area 0
|
||||||
|
router ospf 13
|
||||||
|
network 192.168.0.4 0.0.0.3 area 0
|
||||||
|
no ip domain-lookup
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
**R2**
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface Gig0/0
|
||||||
|
ip address 192.168.0.10 255.255.255.252
|
||||||
|
no shutdown
|
||||||
|
interface Gig0/1
|
||||||
|
ip address 192.168.0.6 255.255.255.252
|
||||||
|
no shutdown
|
||||||
|
interface Gig0/2
|
||||||
|
ip address 192.168.100.254 255.255.255.0
|
||||||
|
no shutdown
|
||||||
|
router ospf 32
|
||||||
|
network 192.168.0.8 0.0.0.3 area 0
|
||||||
|
router ospf 21
|
||||||
|
network 192.168.0.0 0.0.0.3 area 0
|
||||||
|
no ip domain-lookup
|
||||||
|
ip routing
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
**R3**
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface Gig0/0
|
||||||
|
ip address 192.168.0.1 255.255.255.252
|
||||||
|
no shutdown
|
||||||
|
interface Gig0/1
|
||||||
|
ip address 192.168.0.9 255.255.255.252
|
||||||
|
no shutdown
|
||||||
|
interface Gig0/2
|
||||||
|
ip address 192.168.200.254 255.255.255.0
|
||||||
|
no shutdown
|
||||||
|
router ospf 13
|
||||||
|
network 192.168.0.4 0.0.0.3 area 0
|
||||||
|
router ospf 32
|
||||||
|
network 192.168.0.8 0.0.0.3 area 0
|
||||||
|
no ip domain-lookup
|
||||||
|
ip routing
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Exercice 6
|
||||||
Binary file not shown.
Binary file not shown.
BIN
Semaine_02/Jour_04/Jour_04.pkt
Normal file
BIN
Semaine_02/Jour_04/Jour_04.pkt
Normal file
Binary file not shown.
BIN
Semaine_02/Jour_04/Jour_04_exercice_2.pkt
Normal file
BIN
Semaine_02/Jour_04/Jour_04_exercice_2.pkt
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Semaine_02/Jour_04/TP5 - 2 Établir une ACL standard.pdf
Normal file
BIN
Semaine_02/Jour_04/TP5 - 2 Établir une ACL standard.pdf
Normal file
Binary file not shown.
BIN
Semaine_02/Jour_04/TP5 - 2 Établir une ACL standard.pkt
Normal file
BIN
Semaine_02/Jour_04/TP5 - 2 Établir une ACL standard.pkt
Normal file
Binary file not shown.
BIN
Semaine_02/Jour_04/TP6 - 3 Établir une ACL étendue.pdf
Normal file
BIN
Semaine_02/Jour_04/TP6 - 3 Établir une ACL étendue.pdf
Normal file
Binary file not shown.
BIN
Semaine_02/Jour_04/drive-download-20251120T130418Z-1-001.zip
Normal file
BIN
Semaine_02/Jour_04/drive-download-20251120T130418Z-1-001.zip
Normal file
Binary file not shown.
BIN
Semaine_02/Jour_05_evaluation.pdf
Normal file
BIN
Semaine_02/Jour_05_evaluation.pdf
Normal file
Binary file not shown.
609
Semaine_02/Jour_05_examen.md
Normal file
609
Semaine_02/Jour_05_examen.md
Normal file
@@ -0,0 +1,609 @@
|
|||||||
|
Emmanuel-Joyce NTSIA, Gauvain BOICHÉ, Joris STAVROULAKIS, Léo JARRY,
|
||||||
|
|
||||||
|
**Nous jurons sur l'honneur que les commandes entre `` sont tapées à la main à partir de nos notes de cours. (Elles sont réfléchies par nous en notre âme et conscience, on boycott openAI)**
|
||||||
|
|
||||||
|
*Pour rigoler on a passé une instruction "Génère moi une capture d'écran de Cisco Packet Tracer en pleine configuration d'un VLAN par la CLI" et voilà le résultat :*
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/54/546a8aa9001c2159072a7baec8264e1a2021d0150b46e9f3" data-crypto-key="cryptpad:SE/opt2PYh11RFDrv+FIqztrWEM8Tbs38Ym2vLUS/0c="></media-tag>
|
||||||
|
|
||||||
|
**Pour ne pas rigoler, ça devrait être illégal de nous mettre du 176 quand on est habitué au 172 en adresse**
|
||||||
|
|
||||||
|
# Mise en place de la Topologie physique:
|
||||||
|
|
||||||
|
Le client a présenté une topologie précise avec des modèles précis, nous avons décidé de garder la topologie d'origine pour des questions de négociations facilitées.
|
||||||
|
|
||||||
|
- Commutateurs 2960-24TT
|
||||||
|
- Routeur ISR4331
|
||||||
|
- Câbles droits pour liaisons routeurs & PC <-> commutateurs
|
||||||
|
- Câbles croisés pour liaisons inter-commutateurs
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/f7/f78a72e3028ac51e664d595fc353f4f55ddd750a13a2ec12" data-crypto-key="cryptpad:cK6ON14fjHlmFIpvwrE4lflB2C0J66a8h0P8XgEm94A="></media-tag>
|
||||||
|
|
||||||
|
## Mise en place des adresses IP pour les pc
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/75/7531c9b9ffcad96cc9698387b13ff1f00d0d515bde067fbe" data-crypto-key="cryptpad:rAHhYAVWjTh1wLOLV7hRBJSv2uPOVEwGSZlNCnVpE2c="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/e1/e167b987d500078f41d11dff37d706b87c83612d2e958640" data-crypto-key="cryptpad:BetJlmk4OBDHo6UKp7/MHjt3tw99MFo749gOOwRJyIU="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/2c/2c25e98d1f3fffd017c272cf71007eb3c86f6b794fad4faf" data-crypto-key="cryptpad:fQDX194rYklfps2SuGWY14GjlB2MGoQO0xkoLmc1mYQ="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/d5/d505baf4fab37899b026d171930b5720a7ce1ed3f13ce0dd" data-crypto-key="cryptpad:AUYlTQAfIQpLCTdjRIxH0JCBBkUb90YUDOwiPUatu24="></media-tag>
|
||||||
|
|
||||||
|
## Mise en place des VLAN
|
||||||
|
|
||||||
|
**À noter qu'à partir de maintenant, des write memory sont fait après chaque étape pour s'assurer que la configuration soit bien sauvegardée**
|
||||||
|
|
||||||
|
### Création des VLANS dans les switch
|
||||||
|
|
||||||
|
**À faire sur tous les Switchs**
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
vlan 10
|
||||||
|
name OSD
|
||||||
|
exit
|
||||||
|
vlan 20
|
||||||
|
name MON-MGR
|
||||||
|
exit
|
||||||
|
vlan 30
|
||||||
|
name Supervision
|
||||||
|
exit
|
||||||
|
vlan 40
|
||||||
|
name Tests
|
||||||
|
exit
|
||||||
|
interface vlan 1
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
interface vlan 10
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
interface vlan 20
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
interface vlan 30
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
interface vlan 40
|
||||||
|
no shutdown
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/88/8894ff9fe3ee3c5d596f6b3d90115e31d75026fdc3edc85f" data-crypto-key="cryptpad:LcR3E2Cba1LW3U2/hybbdCFO1gpBFGD+mMu8kfCXvsw="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/6f/6f263259f02dfff0a5a5d47f4fcd7a3f37e583c1b4e4420b" data-crypto-key="cryptpad:Uqj9/FdG1R6mDppsvM6krb+gwiXu57KVirU9lBH2WRQ="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/e6/e6ba75ea5f3203723da30ffa7d449c34a51efae5d8bff21c" data-crypto-key="cryptpad:Ke+JwlWqjOk5hlwUKTIWXALWjuDre5OGi2uTLSd3MBM="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/d1/d1d9973764a3dd22af9c23af7c8357851f1af75bc6b23a55" data-crypto-key="cryptpad:aPx4p+sK7AleLZVdHL0TfgJ61nwTE+d37GcKwraWS30="></media-tag>
|
||||||
|
|
||||||
|
### Mise en place des ports access Switch - PC
|
||||||
|
|
||||||
|
|
||||||
|
**À faire sur tous les Switchs sauf S5 en adaptant le port et la vlan**
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/cb/cbb784c08055c1e65fa452a12a845285dd6f8873beb6b372" data-crypto-key="cryptpad:HUFx2xYyrtDhpblKPxBE1TlM00Mjegg4Jrv+45c8L24="></media-tag>
|
||||||
|
|
||||||
|
|
||||||
|
### Mise en place du port trunk entre S5 et R1 (le routeur)
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/6f/6f4e5d053334f8f74dfec7ea9f2c3ec8d1dbcf3faa8bdf1e" data-crypto-key="cryptpad:FQo7teQskt8L2x2LTcWdnLjpcNArdymgQ44CGhKZ5Q4="></media-tag>
|
||||||
|
|
||||||
|
(Petit oubli) On rajoute le nonegotiate :
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/41/417fe4f0a146622e5f782c9ed0ed2282550eb56a4b83c559" data-crypto-key="cryptpad:azRX27aolDPvYJSSELsl01CgAzLIA5nyX4rNJMS82wA="></media-tag>
|
||||||
|
|
||||||
|
## Mise en place des LAGs
|
||||||
|
|
||||||
|
**Switch 1**
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface range Fa0/2 - 4
|
||||||
|
channel-group 1 mode active
|
||||||
|
exit
|
||||||
|
interface range Fa0/5 - 7
|
||||||
|
channel-group 2 mode active
|
||||||
|
exit
|
||||||
|
interface port-channel 1
|
||||||
|
switchport mode trunk
|
||||||
|
switchport trunk native vlan 1
|
||||||
|
switchport trunk allowed vlan 1,10,20,30,40
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
interface port-channel 2
|
||||||
|
switchport mode trunk
|
||||||
|
switchport trunk native vlan 1
|
||||||
|
switchport trunk allowed vlan 1,10,20,30,40
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
show interfaces Port-channel [1,2] ! Pour contrôler
|
||||||
|
show interfaces trunk ! Pour contrôler
|
||||||
|
show etherchannel summary ! Pour contrôler
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
### Création du LAG en LACP actif
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/81/81fb3e3b3a439b4bbba857d0a30ae130b278c412992fbaeb" data-crypto-key="cryptpad:o+CVdqOL3L0sV9KH/XeY2SfvrUNtxgWbc4Cx5XSwNTo="></media-tag>
|
||||||
|
|
||||||
|
**Il faut faire pareil sur S4 (le switch de l'autre côté des ports concernés) du coup aussi pour que ça fonctionne**
|
||||||
|
|
||||||
|
### Configuration du trunk sur les LAGs
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/e8/e84f77050b2aab28cbd4688052976acaa3f9368178018315" data-crypto-key="cryptpad:d5Vhb8Hi1yXvjcvb0RDdLJKHU9UmgUCsyeAeNdGj12M="></media-tag>
|
||||||
|
|
||||||
|
(Petit oubli) On rajoute le nonegotiate :
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/68/6803b7c93fa4174b7cb1cc9a91ac48b4e310b1c57243b4e2" data-crypto-key="cryptpad:/QHmma0a0HXXtpgsUCRBS7d+NFZgZAGSW8SwW0moXr0="></media-tag>
|
||||||
|
|
||||||
|
**Ensuite il faut recommencer ces deux étapes (création du LAG et mise en place du trunk), sur tous les switchs en adaptant bien sûr les ports et en faisant bien attention de respecter les numéros de channel-group**
|
||||||
|
|
||||||
|
### Vérification du LAG et du trunk dessus
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/a9/a9b0ae6851b909314e12df72105c652d76a27705699b4225" data-crypto-key="cryptpad:ET7sByM10fWyoxFk9wMfpVnDoQ06ziOJjP6kOMvshG4="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/ad/ad485ff672e41bf34ad62b220e3f10b5306130a6efa55152" data-crypto-key="cryptpad:ipjEjM4dhGrcPVI9NzaT08IOrVvkazgkpM5/KsPOR2k="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/34/343a182e5e800bfa3fc53089ff7aa9303e1129dab85f0c72" data-crypto-key="cryptpad:6m1j7C0M3A89PwQ7cUY9SoOe5mrvUYkMJ0bFewG+cuE="></media-tag>
|
||||||
|
|
||||||
|
**Switch 2**
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface range Fa0/2 - 4
|
||||||
|
channel-group 3 mode active
|
||||||
|
exit
|
||||||
|
interface range Fa0/5 - 7
|
||||||
|
channel-group 2 mode active
|
||||||
|
exit
|
||||||
|
interface range Fa0/8 - 10
|
||||||
|
channel-group 1 mode active
|
||||||
|
exit
|
||||||
|
interface port-channel 1
|
||||||
|
switchport mode trunk
|
||||||
|
switchport trunk native vlan 1
|
||||||
|
switchport trunk allowed vlan 1,10,20,30,40
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
interface port-channel 2
|
||||||
|
switchport mode trunk
|
||||||
|
switchport trunk native vlan 1
|
||||||
|
switchport trunk allowed vlan 1,10,20,30,40
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
interface port-channel 3
|
||||||
|
switchport mode trunk
|
||||||
|
switchport trunk native vlan 1
|
||||||
|
switchport trunk allowed vlan 1,10,20,30,40
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
show interfaces Port-channel [1,2,3]
|
||||||
|
show interfaces trunk
|
||||||
|
show etherchannel summary
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
**Switch 3**
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface range Fa0/5 - 7
|
||||||
|
channel-group 2 mode active
|
||||||
|
exit
|
||||||
|
interface range Fa0/8 - 10
|
||||||
|
channel-group 1 mode active
|
||||||
|
exit
|
||||||
|
interface range Fa0/11 - 13
|
||||||
|
channel-group 4 mode active
|
||||||
|
exit
|
||||||
|
interface port-channel 1
|
||||||
|
switchport mode trunk
|
||||||
|
switchport trunk native vlan 1
|
||||||
|
switchport trunk allowed vlan 1,10,20,30,40
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
interface port-channel 2
|
||||||
|
switchport mode trunk
|
||||||
|
switchport trunk native vlan 1
|
||||||
|
switchport trunk allowed vlan 1,10,20,30,40
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
interface port-channel 3
|
||||||
|
switchport mode trunk
|
||||||
|
switchport trunk native vlan 1
|
||||||
|
switchport trunk allowed vlan 1,10,20,30,40
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
show interfaces Port-channel [1,2,3]
|
||||||
|
show interfaces trunk
|
||||||
|
show etherchannel summary
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
**Switch 4**
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface range Fa0/2 - 4
|
||||||
|
channel-group 1 mode active
|
||||||
|
exit
|
||||||
|
interface range Fa0/5 - 7
|
||||||
|
channel-group 2 mode active
|
||||||
|
exit
|
||||||
|
interface port-channel 1
|
||||||
|
switchport mode trunk
|
||||||
|
switchport trunk native vlan 1
|
||||||
|
switchport trunk allowed vlan 1,10,20,30,40
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
interface port-channel 2
|
||||||
|
switchport mode trunk
|
||||||
|
switchport trunk native vlan 1
|
||||||
|
switchport trunk allowed vlan 1,10,20,30,40
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
show interfaces Port-channel [1,2,3]
|
||||||
|
show interfaces trunk
|
||||||
|
show etherchannel summary
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
**Switch 5**
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface range Fa0/2 - 4
|
||||||
|
channel-group 3 mode active
|
||||||
|
exit
|
||||||
|
interface range Fa0/11 - 13
|
||||||
|
channel-group 4 mode active
|
||||||
|
exit
|
||||||
|
interface port-channel 1
|
||||||
|
switchport mode trunk
|
||||||
|
switchport trunk native vlan 1
|
||||||
|
switchport trunk allowed vlan 1,10,20,30,40
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
interface port-channel 2
|
||||||
|
switchport mode trunk
|
||||||
|
switchport trunk native vlan 1
|
||||||
|
switchport trunk allowed vlan 1,10,20,30,40
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
show interfaces Port-channel [1,2,3]
|
||||||
|
show interfaces trunk
|
||||||
|
show etherchannel summary
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
## Mise en place du routage inter-vlan
|
||||||
|
|
||||||
|
**Routeur**
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface Gig0/0/0
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
interface Gig0/0/0.1
|
||||||
|
encapsulation dot1Q 1 native
|
||||||
|
ip address 176.16.1.254 255.255.255.0
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
interface Gig0/0/0.10
|
||||||
|
encapsulation dot1Q 10
|
||||||
|
ip address 176.16.10.254 255.255.255.0
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
interface Gig0/0/0.20
|
||||||
|
encapsulation dot1Q 20
|
||||||
|
ip address 176.16.20.254 255.255.255.0
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
interface Gig0/0/0.30
|
||||||
|
encapsulation dot1Q 30
|
||||||
|
ip address 176.16.30.254 255.255.255.0
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
interface Gig0/0/0.40
|
||||||
|
encapsulation dot1Q 40
|
||||||
|
ip address 176.16.40.254 255.255.255.0
|
||||||
|
no shutdown
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
### Interface physique
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/5a/5a56ebdd262aef1b824aa1f532992ad4ede02ff02782d095" data-crypto-key="cryptpad:+0CpOO5cDw/nD8JoR8h8yB3DK0Jqoq1NQ1/jSWsa48w="></media-tag>
|
||||||
|
|
||||||
|
### Interfaces virtuelles
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/2e/2ed9dd7897dfef103aa5155365dfb4a25f68390a89f82afc" data-crypto-key="cryptpad:B8ZapZI+2wsuGkC6Hb2lv4SdolP37dVIuObOI1d45dk="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/f6/f67b5e8972e8b1b11d0a084cdd6205b063292b689dfba9b6" data-crypto-key="cryptpad:fEakil02wX68FSgqtANnNP8BGGl8UCEhuNkzHnKAqMk="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/c3/c30a3872e9cae5ff921a4e421a4b0a11e27b70ccd3616f9b" data-crypto-key="cryptpad:Qf4olHJBX0N1803FkidN3ybBnCijMd5tDHQRqsdeIyc="></media-tag>
|
||||||
|
|
||||||
|
Depuis PC_OSD (vlan 10) :
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/f8/f8a6fc0c6e154b5278a57c42df58f0cfb79038c9ec5400be" data-crypto-key="cryptpad:E6XBGelcO8z3F852KVa0YLmeYejQS4j3s5XVM5czwOo="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/aa/aa081b9b255deb0cfabc6dd3502fb22ad39c23f74bd16e69" data-crypto-key="cryptpad:wcBCg8DG9YCkcZ7OGkSqRWEky3hpDAN6LBu/1UQnmjM="></media-tag>
|
||||||
|
|
||||||
|
**Puis on fait ça pour toutes les autres VLAN**
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/d0/d0a7c14956fc49c021310f8d5e376ea25d4f23c6c33cb8a7" data-crypto-key="cryptpad:0ZsNXijRJTj2oTUcL7nQMxlSVeolDTxzL4+6DRljSdo="></media-tag>
|
||||||
|
|
||||||
|
|
||||||
|
## Sécurisation et accès à distance sur chaque appareil
|
||||||
|
|
||||||
|
### BPDU Guard
|
||||||
|
|
||||||
|
Sur les ports des switchs qui sont connectés aux pc/routeur on active le BPDU guard
|
||||||
|
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface Fa0/1
|
||||||
|
spanning-tree bpduguard enable
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/de/de4ce762dbe97acecd2f35d72f7a5bbc9db533bc10126508" data-crypto-key="cryptpad:2bWPavKJoydJarCrup+BQCOoZ3caCFnsR0usDVf1QU8="></media-tag>
|
||||||
|
|
||||||
|
### Sécurisation du port console
|
||||||
|
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
line console 0
|
||||||
|
password root
|
||||||
|
login
|
||||||
|
exit
|
||||||
|
service password-encryption
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/af/afcbc673150c0d18c2a9361230ae530f81380d3792748969" data-crypto-key="cryptpad:4u4DjkTPkeVx4kUA6V05WVjECdeIXdeWHeRVIL96AD4="></media-tag>
|
||||||
|
|
||||||
|
Parce que c'est un exercice on va mettre le même mot de passe partout pour se simplifier la vie, bien sûr en vrai on mettrait des mots de passes forts et différents
|
||||||
|
|
||||||
|
Le service password-encryption servira à empêcher que le mot de passe soit accessible en clair dans la configuration
|
||||||
|
|
||||||
|
**On fait la même chose sur tous les switch et routeur**
|
||||||
|
|
||||||
|
### Activation à distance (ssh)
|
||||||
|
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
ip domain-name fuckssh.com
|
||||||
|
username ssh secret root
|
||||||
|
crypto key generate rsa general-keys modulus 2048
|
||||||
|
line vty 0 15
|
||||||
|
transport input ssh
|
||||||
|
login local
|
||||||
|
exit
|
||||||
|
ip ssh version 2
|
||||||
|
interface vlan 1
|
||||||
|
ip address 176.16.1.1 255.255.255.0
|
||||||
|
exit
|
||||||
|
ip default-gateway 176.16.1.254
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
*Le code est adapté pour chaque Switch, donc l'adresse IP sera 176.16.1.[1-5]*
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/e4/e4516c5b4e9d29e5c4eb646975508b04daac845db822c6e8" data-crypto-key="cryptpad:Wqn1O46/ucU/r9fia/XjFGzaCR3rzkIgBt6QUqceGgc="></media-tag>
|
||||||
|
|
||||||
|
**On oublie bien sûr pas d'ajouter une ip au switch dans le vlan 1 pour pouvoir s'y connecter ainsi que l'ip default-gateway**
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/41/416d332606f7a8857995f8037326ab857bffa5870fb7d502" data-crypto-key="cryptpad:loN+qfyLhMjcx4IwoJOlNAB6IHma22mmSzFO6AyRvXs="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/65/656b037fabf64be0b4925ec26bed04c41c4d027dc2233e0b" data-crypto-key="cryptpad:VRLakDpWCSPcpZaO8Ahc+C0YXYCAPYJyezTwSRH5BSs="></media-tag>
|
||||||
|
|
||||||
|
**On fait la même chose sur tous les switch et routeur**
|
||||||
|
|
||||||
|
### Sécurisation du mode enable
|
||||||
|
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
enable secret root
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/b1/b173291a2c5ad33f30b31ce7f278026490136416a640d883" data-crypto-key="cryptpad:WiOgi91Teu6fQkllF6/leGxRuczUvHGAb+nVV1SOuZU="></media-tag>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/05/05a498fafcb76da3fb3d828e58d1dfa04627f08198877cb3" data-crypto-key="cryptpad:RtiXPcHtE1MQY7HjX/0esiHl4p3AD59e0KxByzHe2h4="></media-tag>
|
||||||
|
|
||||||
|
### Vérification accès à distance
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/d4/d4c17ecee3644837f8517197d9f68b92c6224eb6098447e0" data-crypto-key="cryptpad:aAZO8A4u++FP6txk9i1Hd22MtU2jTT6g1txDXcVPkiQ="></media-tag>
|
||||||
|
|
||||||
|
### MOTD + Sécurisation des interfaces inactives
|
||||||
|
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
banner motd # Personnel autorise seulement #
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
**On fait la même chose sur tous les switch et routeur**
|
||||||
|
|
||||||
|
Puis on fait la sécurisation des interfaces inactives en les éteignant et en les mettant sur un vlan 44 créé exprès pour ça
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/e5/e55c4ac8b9b677643da4364ce42aa0b0171d0acb447f8277" data-crypto-key="cryptpad:frkBBUIeRECZOr20nA24micUz2GqLZrWQuOLDfiygGM="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/9d/9d16630905283efe0d88bf62c29f420c9e0c2341316afeff" data-crypto-key="cryptpad:Hkd7WDLqcDkk5cKW2oTdC2AOeJnDQ/Lr+OGh8PjTtWo="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/d0/d08063a58ed877328789e741f6178d8bbebced047aaaadd7" data-crypto-key="cryptpad:x4lZdy9RmK3iMm1GNN+xynMB6xr0L+2Y5qUKbXVZxBE="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/e3/e3b0fc80e8dce3c0bccd883b9012851641f5db7f8f096920" data-crypto-key="cryptpad:SPuLms2t/YNIB7JHpLda0QFlfvB4I4OO2DL0RqywI+k="></media-tag>
|
||||||
|
|
||||||
|
**Switch 1**
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface range Gig0/1 - 2
|
||||||
|
switchport mode access
|
||||||
|
switchport access vlan 44
|
||||||
|
shutdown
|
||||||
|
exit
|
||||||
|
interface range Fa0/8 - 24
|
||||||
|
switchport mode access
|
||||||
|
switchport access vlan 44
|
||||||
|
shutdown
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
**Switch 2**
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface range Gig0/1 - 2
|
||||||
|
switchport mode access
|
||||||
|
switchport access vlan 44
|
||||||
|
shutdown
|
||||||
|
exit
|
||||||
|
interface range Fa0/11 - 24
|
||||||
|
switchport mode access
|
||||||
|
switchport access vlan 44
|
||||||
|
shutdown
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
**Switch 3**
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface range Gig0/1 - 2
|
||||||
|
switchport mode access
|
||||||
|
switchport access vlan 44
|
||||||
|
shutdown
|
||||||
|
exit
|
||||||
|
interface range Fa0/2 - 4
|
||||||
|
switchport mode access
|
||||||
|
switchport access vlan 44
|
||||||
|
shutdown
|
||||||
|
exit
|
||||||
|
interface range Fa0/14 - 24
|
||||||
|
switchport mode access
|
||||||
|
switchport access vlan 44
|
||||||
|
shutdown
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
**Switch 4**
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface range Gig0/1 - 2
|
||||||
|
switchport mode access
|
||||||
|
switchport access vlan 44
|
||||||
|
shutdown
|
||||||
|
exit
|
||||||
|
interface range Fa0/8 - 24
|
||||||
|
switchport mode access
|
||||||
|
switchport access vlan 44
|
||||||
|
shutdown
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
**Switch 5**
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface range Gig0/1 - 2
|
||||||
|
switchport mode access
|
||||||
|
switchport access vlan 44
|
||||||
|
shutdown
|
||||||
|
exit
|
||||||
|
interface range Fa0/5 - 10
|
||||||
|
switchport mode access
|
||||||
|
switchport access vlan 44
|
||||||
|
shutdown
|
||||||
|
exit
|
||||||
|
interface range Fa0/14 - 24
|
||||||
|
switchport mode access
|
||||||
|
switchport access vlan 44
|
||||||
|
shutdown
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
**Router**
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface range Gig0/0/1 - 2
|
||||||
|
shutdown
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
## Mise en place des ACLs
|
||||||
|
|
||||||
|
Pour les ACLs on a décidé deux faire deux listes, une spécifiquement à l'entrée de la gateway du vlan 10 sur le routeur qui bloque uniquement les ports utilisés par les OSD avec les protocoles CEPH
|
||||||
|
|
||||||
|
Et une deuxième à l'entrée de la gateway du vlan 20 sur le routeur pour bloquer les ports utilisés par le monitor / manager de la même façon
|
||||||
|
|
||||||
|
On bloque donc les paquets qui viennent de ces deux vlan sur les ports utilisés par CEPH et qui sont en destination du réseau Tests (vlan 40)
|
||||||
|
|
||||||
|
Tout le reste du traffic est permis entre tous les vlans définis (icmp / ip, etc...)
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/20/20873674c55dab869fec0335d89010ae778864abc2a200ef" data-crypto-key="cryptpad:94ovIdglwHGQdU2B5869FcUHBKJndQi2F7zAUPwll6o="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/e8/e816dec28d2acdfb0a4e5f95cf0b1606fdecd36c852b65b7" data-crypto-key="cryptpad:coqWs73UmRyv58pKl61d0EISuiBP5O4RP9/XI18TFWA="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/93/93d92019644a11a4adb44f0a7c3a1ec32309d7e946999ed5" data-crypto-key="cryptpad:6q3YGerOUSknC5cTG1mfEdh26yLagA6n+HH2/iMZ1ik="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/e2/e2b4da356ab75c565ad72e8cfc5537de129be51743cd008f" data-crypto-key="cryptpad:yhhFgwZqTHny2kjQATW4ajxtH8bwzFhJA3vaGbtB2R4="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/74/7456997263b569403b96c9624909567ff3216edf1c63514f" data-crypto-key="cryptpad:3ltGaqtgUXSzoNbYbzb/NlRBiH6w/CS9yZ6/gO0cXBk="></media-tag>
|
||||||
|
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
ip access-list extended CEPH_EXCLUDE_TESTS_VLAN10
|
||||||
|
deny tcp 176.16.10.0 0.0.0.255 176.16.40.0 0.0.0.255 range 6800 7300
|
||||||
|
permit icmp any any
|
||||||
|
permit ip any any
|
||||||
|
exit
|
||||||
|
ip access-list extended CEPH_EXCLUDE_TESTS_VLAN20
|
||||||
|
deny tcp 176.16.20.0 0.0.0.255 176.16.40.0 0.0.0.255 range 6800 7300
|
||||||
|
deny tcp 176.16.20.0 0.0.0.255 176.16.40.0 0.0.0.255 eq 3300
|
||||||
|
deny tcp 176.16.20.0 0.0.0.255 176.16.40.0 0.0.0.255 eq 6789
|
||||||
|
permit icmp any any
|
||||||
|
permit ip any any
|
||||||
|
exit
|
||||||
|
interface Gig0/0/0.10
|
||||||
|
ip access-group CEPH_EXCLUDE_TESTS_VLAN10 in
|
||||||
|
exit
|
||||||
|
interface Gig0/0/0.20
|
||||||
|
ip access-group CEPH_EXCLUDE_TESTS_VLAN20 in
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
# FIN
|
||||||
|
|
||||||
|
Ps : moins de 20/20 on débarque chez toi Cédric (dans minecraft)
|
||||||
BIN
Semaine_02/Supports_de_cours/01. Introduction à Ceph/CEPH.pdf
Normal file
BIN
Semaine_02/Supports_de_cours/01. Introduction à Ceph/CEPH.pdf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,117 @@
|
|||||||
|
# Mettre en place des VLANs et du trunk
|
||||||
|
|
||||||
|
### Step 2
|
||||||
|
|
||||||
|
- Accédez à Switch 2 en CLI
|
||||||
|
|
||||||
|
### Step 3
|
||||||
|
|
||||||
|
- Configurez le VLAN 1 et affectez lui l'interface 10.1.1.12/24
|
||||||
|
|
||||||
|
```
|
||||||
|
SW1(config)#interface vlan 1
|
||||||
|
SW1(config-if)#ip address 10.1.1.12 255.255.255.0
|
||||||
|
SW1(config-if)#exit
|
||||||
|
```
|
||||||
|
- Créons les VLANs supplémentaire, à faire sur Switch 1 ET Switch 2 !!
|
||||||
|
|
||||||
|
```
|
||||||
|
SW1(config)# vlan 10
|
||||||
|
SW1(config-vlan)#exit
|
||||||
|
SW1(config)# vlan 20
|
||||||
|
SW1(config-vlan)#exit
|
||||||
|
```
|
||||||
|
Attribuez l'interface fa 0/1 de CHAQUE SWITCH à son VLAN :
|
||||||
|
|
||||||
|
SW1#conf t
|
||||||
|
SW1(config-vlan)#int fa0/1
|
||||||
|
SW1(config-if)#switchport mode access
|
||||||
|
SW1(config-if)#switchport access vlan 10
|
||||||
|
|
||||||
|
SW2#conf t
|
||||||
|
SW2(config-vlan)#int fa0/1
|
||||||
|
SW2(config-if)#switchport mode access
|
||||||
|
SW2(config-if)#switchport access vlan 20
|
||||||
|
|
||||||
|
- Configurez l'interface FA 0/3 comme trunk sur **CHAQUE SWITCH**
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
SW1(config) interface fastethernet 0/3
|
||||||
|
SW1(config-if)# switchport mode trunk
|
||||||
|
SW1(config-if)#switchport nonegotiate
|
||||||
|
SW1(config-if)# switchport trunk allowed vlan 1,10,20
|
||||||
|
SW1(config-if)# no shutdown
|
||||||
|
|
||||||
|
```
|
||||||
|
- Configurez l'interface FA0/13 comme trunk sur Switch 1 uniquement, puisqu'il
|
||||||
|
fait face au routeur :
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
SW1(config-if)#int fa0/13
|
||||||
|
SW1(config-if)#switchport mode trunk
|
||||||
|
SW(config-if)#switchport nonegotiate
|
||||||
|
SW1(config-if)#switchport trunk allowed vlan 1,10,20
|
||||||
|
|
||||||
|
```
|
||||||
|
### Step 7
|
||||||
|
|
||||||
|
- Faites un ping vers l'autre VLAN depuis PC1. Le ping doit échouer, pourquoi ?
|
||||||
|
|
||||||
|
*Parce qu'il n'y a pas de routage entre les VLANs, il faudrait configurer le
|
||||||
|
routeur*
|
||||||
|
|
||||||
|
## TASK 2 : Configurez un Trunk sur le routeur
|
||||||
|
|
||||||
|
### Step 1
|
||||||
|
|
||||||
|
- Accédez au Routeur en CLI
|
||||||
|
|
||||||
|
### Step 2
|
||||||
|
|
||||||
|
- Allez dans l'interface gi 0/0
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
R(config)#enable
|
||||||
|
R(config)#conf t
|
||||||
|
R(config)#int gi0/0
|
||||||
|
|
||||||
|
```
|
||||||
|
### Step 3
|
||||||
|
|
||||||
|
- Éteignez l'interface
|
||||||
|
|
||||||
|
|
||||||
|
R(config)#shutdown
|
||||||
|
|
||||||
|
### Step 4
|
||||||
|
|
||||||
|
- Supprimez toutes les adresses IP existantes sur cette interface
|
||||||
|
|
||||||
|
|
||||||
|
R(config-if)#no ip address
|
||||||
|
|
||||||
|
- Créez 3 sous-interfaces sur Gigabit 0/0, chacun avec les IP spécifiées dans
|
||||||
|
l'énoncé, en déclarant ces interfaces comme devant décoder les paquets tagués
|
||||||
|
à la norme 802.1q
|
||||||
|
|
||||||
|
|
||||||
|
R(config)#interface gi 0/0.1
|
||||||
|
R(config)#encapsulation dot1q 1 native
|
||||||
|
R(config)#ip address 10.1.1.1 255.255.255.0
|
||||||
|
R(config)#no shutdown
|
||||||
|
R(config)#interface gi 0/0.10
|
||||||
|
R(config)#encapsulation dot1q 10
|
||||||
|
R(config)#ip address 10.1.10.1 255.255.255.0
|
||||||
|
R(config)#no shutdown
|
||||||
|
R(config)#interface gi 0/0.20
|
||||||
|
R(config)#encapsulation dot1q 20
|
||||||
|
R(config)#ip address 10.1.20.1 255.255.255.0
|
||||||
|
R(config)#no shutdown
|
||||||
|
R(config)#interface giga 0/0
|
||||||
|
R(config)#no shutdown
|
||||||
|
|
||||||
|
**TOUT devrait être fonctionnel à ce stade.**
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,61 @@
|
|||||||
|
# Troubleshooting VLAN
|
||||||
|
|
||||||
|
## TASK 1 : Dépannez la connectivité des VLANs
|
||||||
|
|
||||||
|
### Step 5
|
||||||
|
|
||||||
|
- L'interface se trouve dans le VLAN 10, or, elle est inactive, ce qui veut dire qu'on a oublié de créer le VLAN 10 !
|
||||||
|
|
||||||
|
Sur le switch ou ce vlan est absent, simplement taper "vlan 10" en mode conf terminal
|
||||||
|
|
||||||
|
### Step 7
|
||||||
|
|
||||||
|
- Entrez ces commandes sur le Switch 2 :
|
||||||
|
|
||||||
|
SW2(config)#interface FastEthernet0/3
|
||||||
|
SW2(config-if)#switchport mode trunk
|
||||||
|
SW2(config-if)#switchport nonegociate
|
||||||
|
|
||||||
|
### Step 9
|
||||||
|
|
||||||
|
- Entrez ces commandes sur le Switch 1 :
|
||||||
|
|
||||||
|
SW1(config)#interface FastEthernet0/3
|
||||||
|
SW1(config-if)#switchport mode trunk
|
||||||
|
SW1(config-if)#switchport nonegociate
|
||||||
|
|
||||||
|
### Step 13
|
||||||
|
|
||||||
|
- Entrez ces commandes sur le Switch 1 pour rétablir le bon vlan natif :
|
||||||
|
|
||||||
|
SW1(config)#interface FastEthernet0/3
|
||||||
|
SW1(config-if)#switchport trunk native vlan 1
|
||||||
|
|
||||||
|
### Step 14
|
||||||
|
|
||||||
|
- Entrez ces commandes sur le Switch 2 :
|
||||||
|
|
||||||
|
SW2(config)#interface FastEthernet0/3
|
||||||
|
SW2(config-if)#switchport trunk native vlan 1
|
||||||
|
|
||||||
|
### Step 16
|
||||||
|
|
||||||
|
- Entrez ces commandes sur le Switch 1 :
|
||||||
|
|
||||||
|
SW1(config)#copy running-config startup-config
|
||||||
|
|
||||||
|
- Entrez ces commandes sur le Switch 2 :
|
||||||
|
|
||||||
|
SW2(config)#copy running-config startup-config
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
@@ -0,0 +1,52 @@
|
|||||||
|
# TP : Mise en œuvre du protocole HSRP dans un réseau redondant
|
||||||
|
|
||||||
|
## 🎯 Objectif
|
||||||
|
Mettre en place une **redondance de passerelle** à l’aide du protocole **HSRP (Hot Standby Router Protocol)**, afin d’assurer la **continuité de service** en cas de défaillance d’un routeur.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
🧱 **Réseau partagé** : 192.168.1.0/24
|
||||||
|
🎯 **Passerelle virtuelle HSRP** : 192.168.1.1
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚙️ Étapes du TP
|
||||||
|
|
||||||
|
### 1️⃣ Configuration IP de base
|
||||||
|
Configurer les adresses IP sur les deux routeurs et le PC selon le schéma ci-dessus.
|
||||||
|
Vérifier la connectivité entre les équipements avec la commande `ping`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 2️⃣ Configuration HSRP
|
||||||
|
Configurer HSRP sur les deux routeurs afin de partager une adresse IP virtuelle (192.168.1.1).
|
||||||
|
Le **Router1** doit être prioritaire.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 3️⃣ Vérification
|
||||||
|
Utiliser les commandes de vérification pour observer :
|
||||||
|
- Le routeur **actif**
|
||||||
|
- Le routeur **standby**
|
||||||
|
- L’adresse IP virtuelle et l’adresse MAC virtuelle associée
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 4️⃣ Test de bascule
|
||||||
|
1. Vérifier le rôle initial de chaque routeur.
|
||||||
|
2. Désactiver l’interface G0/0 de Router1 pour simuler une panne.
|
||||||
|
3. Vérifier le basculement automatique du rôle actif vers Router2.
|
||||||
|
4. Réactiver Router1 et observer le retour automatique à l’état initial.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 5️⃣ Questions de réflexion
|
||||||
|
|
||||||
|
1. Quelle est la différence entre HSRP et VRRP ?
|
||||||
|
2. Pourquoi configure-t-on la commande `preempt` ?
|
||||||
|
3. Que se passerait-il si les deux routeurs avaient la même priorité ?
|
||||||
|
4. Quelle est la différence entre HSRP et une agrégation de liens (EtherChannel) ?
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Fin du TP.**
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
# Correction du TP : Mise en œuvre du protocole HSRP dans un réseau redondant
|
||||||
|
|
||||||
|
## 🎯 Objectif
|
||||||
|
Mettre en œuvre une **redondance de passerelle IP** avec **HSRP**, afin d'assurer une continuité de service réseau en cas de panne d'un routeur.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🧩 Topologie mise en place
|
||||||
|
|
||||||
|
```
|
||||||
|
+-------------------+
|
||||||
|
| Router1 |
|
||||||
|
| G0/0 : 192.168.1.2|
|
||||||
|
+-------------------+
|
||||||
|
|
|
||||||
|
|
|
||||||
|
+-------------+
|
||||||
|
| SW1 |
|
||||||
|
+-------------+
|
||||||
|
|
|
||||||
|
+-------------------+
|
||||||
|
| Router2 |
|
||||||
|
| G0/0 : 192.168.1.3|
|
||||||
|
+-------------------+
|
||||||
|
|
|
||||||
|
+------+
|
||||||
|
| PC1 |
|
||||||
|
|192.168.1.10|
|
||||||
|
+------+
|
||||||
|
```
|
||||||
|
|
||||||
|
🧱 **Réseau partagé** : 192.168.1.0/24
|
||||||
|
🎯 **Passerelle virtuelle HSRP** : 192.168.1.1
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚙️ Étapes de configuration
|
||||||
|
|
||||||
|
### 1️⃣ Configuration IP de base
|
||||||
|
|
||||||
|
#### Router1
|
||||||
|
```bash
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface g0/0
|
||||||
|
ip address 192.168.1.2 255.255.255.0
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Router2
|
||||||
|
```bash
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface g0/0
|
||||||
|
ip address 192.168.1.3 255.255.255.0
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
```
|
||||||
|
|
||||||
|
#### PC1
|
||||||
|
```
|
||||||
|
Adresse IP : 192.168.1.10
|
||||||
|
Masque : 255.255.255.0
|
||||||
|
Passerelle : 192.168.1.1
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 2️⃣ Configuration HSRP
|
||||||
|
|
||||||
|
#### Sur Router1 (routeur prioritaire)
|
||||||
|
```bash
|
||||||
|
interface g0/0
|
||||||
|
standby 1 ip 192.168.1.1
|
||||||
|
standby 1 priority 110
|
||||||
|
standby 1 preempt
|
||||||
|
no shutdown
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Sur Router2
|
||||||
|
```bash
|
||||||
|
interface g0/0
|
||||||
|
standby 1 ip 192.168.1.1
|
||||||
|
standby 1 priority 90
|
||||||
|
standby 1 preempt
|
||||||
|
no shutdown
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 3️⃣ Vérification
|
||||||
|
|
||||||
|
Commande :
|
||||||
|
```bash
|
||||||
|
show standby
|
||||||
|
```
|
||||||
|
|
||||||
|
**Router1 (actif) :**
|
||||||
|
```
|
||||||
|
GigabitEthernet0/0 - Group 1
|
||||||
|
State is Active
|
||||||
|
Virtual IP address is 192.168.1.1
|
||||||
|
Active router is local
|
||||||
|
Standby router is 192.168.1.3
|
||||||
|
Priority 110 (configured 110)
|
||||||
|
```
|
||||||
|
|
||||||
|
**Router2 (standby) :**
|
||||||
|
```
|
||||||
|
GigabitEthernet0/0 - Group 1
|
||||||
|
State is Standby
|
||||||
|
Virtual IP address is 192.168.1.1
|
||||||
|
Active router is 192.168.1.2
|
||||||
|
Priority 90 (configured 90)
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 4️⃣ Test de bascule (failover)
|
||||||
|
|
||||||
|
1. Depuis le PC, tester la connectivité :
|
||||||
|
```bash
|
||||||
|
PC1> ping 192.168.1.1
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Simuler la panne du routeur actif :
|
||||||
|
```bash
|
||||||
|
Router1(config)# interface g0/0
|
||||||
|
Router1(config-if)# shutdown
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Vérifier que Router2 devient actif :
|
||||||
|
```bash
|
||||||
|
Router2# show standby
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Rétablir Router1 :
|
||||||
|
```bash
|
||||||
|
Router1(config-if)# no shutdown
|
||||||
|
```
|
||||||
|
|
||||||
|
Grâce à la commande `preempt`, Router1 reprend automatiquement le rôle d'actif.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🧭 Réponses aux questions de réflexion
|
||||||
|
|
||||||
|
1. **Différence HSRP / VRRP :**
|
||||||
|
HSRP est propriétaire Cisco, VRRP est standard (RFC 3768). Les deux assurent une redondance de passerelle.
|
||||||
|
|
||||||
|
2. **Commande `preempt` :**
|
||||||
|
Permet à un routeur prioritaire de redevenir actif après un retour en service.
|
||||||
|
|
||||||
|
3. **Même priorité sur les deux routeurs :**
|
||||||
|
En cas d’égalité, le routeur ayant l’adresse IP la plus élevée devient actif.
|
||||||
|
|
||||||
|
4. **HSRP vs EtherChannel :**
|
||||||
|
HSRP redonde des routeurs (couche 3), EtherChannel agrège des liens physiques (couche 2).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ✅ Bilan
|
||||||
|
|
||||||
|
- HSRP assure une **redondance de passerelle** sans intervention du poste client.
|
||||||
|
- Une **IP et MAC virtuelles** sont partagées entre deux routeurs.
|
||||||
|
- La **bascule** est transparente pour le réseau local.
|
||||||
|
- **Packet Tracer** supporte parfaitement HSRP (contrairement à VRRP).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Fin de la correction.**
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,78 @@
|
|||||||
|
# CORRECTION TP 3 - Filtrage par ACLs
|
||||||
|
|
||||||
|
## Task 1
|
||||||
|
|
||||||
|
### Step 2 :
|
||||||
|
|
||||||
|
Avant toute chose, le 1er réflexe est de vérifier la présence d'ACL sur l'appareil, `show ip access list`.
|
||||||
|
|
||||||
|
Sur le routeur branch, on remarque justement une ACL déjà présente avec cette commande, de type standard, qui permet tout le traffic depuis le réseau 10.1.1.0. Rajouter une règle interdisant l'hôte 10.1.1.101 sera inefficace puisque la règle précédente laissera tout passer !
|
||||||
|
|
||||||
|
Il faut donc l'annuler :
|
||||||
|
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
no ip access-list standard 1
|
||||||
|
|
||||||
|
Puis créez l'ACL demandée :
|
||||||
|
|
||||||
|
#### Créer l'ACL :
|
||||||
|
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
ip access-list extended Telnet
|
||||||
|
deny tcp host 10.1.1.101 host 172.16.1.100 eq telnet
|
||||||
|
permit ip any any
|
||||||
|
exit
|
||||||
|
|
||||||
|
**Notez l'importance ici du "permit ip any any" en fin d'ACL en tant que dernière règle, il stipule que tout ce qui ne concorde pas avec la 1ère règle peut passer, autrement la politique par défaut sur Cisco, implicite, est de refuser tout ce qui ne matche pas avec les règles précédentes !!! Il est en effet plus logique et rapide de dire ce qu'on autorise, et interdire tout le reste que l'inverse, d'ou le choix par Cisco du "deny ip any any" implicite.**
|
||||||
|
|
||||||
|
#### Attribuer cet ACL à une interface :
|
||||||
|
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface gi0/0
|
||||||
|
ip access-group Telnet in
|
||||||
|
exit
|
||||||
|
|
||||||
|
## Task 2
|
||||||
|
|
||||||
|
### Step 7
|
||||||
|
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface gi0/0
|
||||||
|
no ip access-group Telnet out
|
||||||
|
ip access-group Telnet in
|
||||||
|
exit
|
||||||
|
|
||||||
|
### Step 9
|
||||||
|
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
no ip access-list extended Telnet
|
||||||
|
ip access-list extended Telnet
|
||||||
|
deny tcp host 10.1.1.101 host 172.16.1.100 eq telnet
|
||||||
|
permit ip any any
|
||||||
|
exit
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,25 @@
|
|||||||
|
# CORRECTION TP 4 - Troubleshoot de connectivité IP ayant pour cause les ACL
|
||||||
|
|
||||||
|
|
||||||
|
## Task 1 – Réparer la route par défaut :
|
||||||
|
|
||||||
|
sur le routeur Branch :
|
||||||
|
|
||||||
|
Branch(config) #ip route 0.0.0.0 0.0.0.0 209.165.201.2
|
||||||
|
|
||||||
|
Ici, toute IP d'un réseau de n'importe quelle taille sera joignable par le biais de l'adresse `209.165.201.2`
|
||||||
|
|
||||||
|
## Task 2 – Réparer une ACL :
|
||||||
|
|
||||||
|
entrer ces commandes (ou équivalent) sur le routeur branch :
|
||||||
|
|
||||||
|
Branch(config) #ip access-list extended Outbound-ACL
|
||||||
|
Branch(config-ext-nacl)#permit tcp any any eq Telnet
|
||||||
|
Branch(config-ext-nacl)#permit tcp any any eq www
|
||||||
|
|
||||||
|
Si vous souhaitez réessayer la commande traceroute, il faut aussi penser à autoriser le trafic UDP
|
||||||
|
|
||||||
|
## Task 3 – Réparer la passerelle par défaut et la résolution de noms :
|
||||||
|
|
||||||
|
Il suffit d’aller dans la configuration de PC1 pour lui passer la bonne passerelle par défaut.
|
||||||
|
Packet Tracer n’émulant pas un système d’exploitation Windows complet, il n’y a pas de fichier Host à rectifier. Il faut simplement rectifier la passerelle par défaut le PC, et refaire un ping test, mais avec l'adresse IP du serveur cette fois, pas le choix !
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
531
Semaine_03/Esteban-Gauvain-Floren.md
Normal file
531
Semaine_03/Esteban-Gauvain-Floren.md
Normal file
@@ -0,0 +1,531 @@
|
|||||||
|
*Esteban, Floren, Gauvain*
|
||||||
|
|
||||||
|
# Projet 1
|
||||||
|
|
||||||
|
## Génèse
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/01/01967ebf4084a1992b8cb524d00bc243f2601c69c8615881" data-crypto-key="cryptpad:PhVMSz9E3GYukXUfxxVlGcaIA0HBYtDQPC06m3+uP4A="></media-tag>
|
||||||
|
|
||||||
|
### 1. Préparation du projet
|
||||||
|
|
||||||
|
- Floren : l'architecte
|
||||||
|
- Esteban : le soutien moral
|
||||||
|
- Gauvain : la petite secrétaire
|
||||||
|
|
||||||
|
#### Notes
|
||||||
|
|
||||||
|
Il se peut que les lignes de code affichées dans les captures d'écran ne soient pas 100% conformes avec les blocs de code tapés au-dessus. C'est normal : nous expérimentons au fur et à mesure, et quand la capture d'écran est faite, il se peut que nous ne nous apercevions d'une coquille ou d'un oubli que bien plus tard. Et qu'un paquet installé (genre NMAP) soit désinstallé plus tard, faute d'usage. Règle du **"moins de paquet = moins de surface d'attaque"**.
|
||||||
|
|
||||||
|
Le résultat est normalement affiché en capture d'écran, mais en cas de discordance, les blocs de code commentés font foi.
|
||||||
|
|
||||||
|
### 2. Définir l'architecture
|
||||||
|
|
||||||
|
#### A. Les Machines Virtuelles
|
||||||
|
|
||||||
|
[ROCKY_LINUX - Installation](https://docs.rockylinux.org/9/guides/9_6_installation/)
|
||||||
|
|
||||||
|
- Rocky Linux sur Hyperviseur
|
||||||
|
- Deux connexions réseau : en Accès par Pont ou Réseau NAT
|
||||||
|
- Pas de GUI
|
||||||
|
|
||||||
|
Nous avons décidé d'utiliser :
|
||||||
|
- 3 VMs Rocky Linux 9.7 (version Boot), les infos sur la version 10 faisant état d'une version peu stabilisée
|
||||||
|
- sur VirtualBox (par simplicité)
|
||||||
|
- En réseau NAT (pour avoir une plage réseau vraiment isolée)
|
||||||
|
- Pas de GUI
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo dnf update -y
|
||||||
|
sudo dnf install -y firewalld nano curl wget
|
||||||
|
|
||||||
|
sudo systemctl enable --now firewalld
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/b0/b0e3f7b2c5672bcc99c1663edcf15c117a3f17174327a5cf" data-crypto-key="cryptpad:W8ya4WJHC8JFuL91qShLtU5NlcOqTtAY5NhRnDa28Ww="></media-tag>
|
||||||
|
|
||||||
|
Synchronisation des serveurs avec `chrony` :
|
||||||
|
*Sur MON/MR*
|
||||||
|
```
|
||||||
|
nano /etc/chrony.conf
|
||||||
|
|
||||||
|
allow 10.0.10.0/24
|
||||||
|
```
|
||||||
|
|
||||||
|
*Sur OSD1*
|
||||||
|
```
|
||||||
|
nano /etc/chrony.conf
|
||||||
|
|
||||||
|
server 10.0.10.11 iburst
|
||||||
|
peer 10.0.10.13 iburst
|
||||||
|
```
|
||||||
|
|
||||||
|
*Sur OSD2*
|
||||||
|
```
|
||||||
|
nano /etc/chrony.conf
|
||||||
|
|
||||||
|
server 10.0.10.11 iburst
|
||||||
|
peer 10.0.10.12 iburst
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/b7/b7e033a10900c45e580f68f01397eb757d842eec7d93f382" data-crypto-key="cryptpad:bG9old1RTNdNOsmzGAg+COvQIxTE3SfkufJLR4P76ks="></media-tag>
|
||||||
|
|
||||||
|
Et on change les noms des machines :
|
||||||
|
```
|
||||||
|
sudo hostnamectl set-hostname ['monmgr', 'osd1', 'osd2']
|
||||||
|
```
|
||||||
|
|
||||||
|
#### B. Configuration du **bonding**
|
||||||
|
|
||||||
|
[REDHAT - Configure Network Bonding](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/networking_guide/ch-configure_network_bonding)
|
||||||
|
|
||||||
|
[Bonding in Rocky Linux](https://www.server-world.info/en/note?os=Rocky_Linux_10&p=bonding)
|
||||||
|
|
||||||
|
- Mode [*active-backup*](https://www.ibm.com/docs/en/linux-on-systems?topic=recommendations-bonding-modes)
|
||||||
|
- Bridge dédié au **bond** *active-backup* dans le Ceph
|
||||||
|
|
||||||
|
Ajouter le bond :
|
||||||
|
```
|
||||||
|
sudo nmcli connection add type bond con-name bond0 ifname bond0 mode active-backup
|
||||||
|
|
||||||
|
sudo nmcli connection add type ethernet ifname enp0s3 master bond0
|
||||||
|
sudo nmcli connection add type ethernet ifname enp0s8 master bond0
|
||||||
|
|
||||||
|
sudo nmcli connection modify bond0 \
|
||||||
|
ipv4.method manual \
|
||||||
|
ipv4.addresses 10.0.10.[11,12,13]/24 \
|
||||||
|
ipv4.gateway 10.0.10.1 \
|
||||||
|
ipv4.dns 1.1.1.1
|
||||||
|
|
||||||
|
sudo nmcli connection up bond0
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/52/5279bfcf999a38ee607e1541ddd33f28e66496900d734aec" data-crypto-key="cryptpad:BTUFNaWv3J08TA3JXDprbwITT99IgroCiZHP9jQ2G8k="></media-tag>
|
||||||
|
|
||||||
|
Vérifications :
|
||||||
|
```
|
||||||
|
cat /proc/net/bonding/bond0
|
||||||
|
|
||||||
|
sudo nmcli device
|
||||||
|
sudo nmcli connection
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/2e/2edba240650f6d1e7590f8c9158507e48065fbd90795b6bc" data-crypto-key="cryptpad:6/8X/hK2S2XkS5fa4Ciwg0rBI98BbGaDwxE4FJcjrcs="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/79/791e0bbb425373c202dcf441deb5d8547725b96207a7d000" data-crypto-key="cryptpad:uljqcx6jWwLfyqWPg6ES6ud/LOySsY+Ct4NB9Yv0csw="></media-tag>
|
||||||
|
|
||||||
|
Vérification de la redondance en débranchant une NIC dans la VM :
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/6f/6ffc89e214d2459839bcc46048e0c279bf02f00cca18a1ef" data-crypto-key="cryptpad:C3mIRrhfg0sBPfjiW9tlGHm9QOG2dJaJyexnPz7RMTk="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/4c/4c99131e6dddbe858c608688f6e2cf252f991e2f878986e0" data-crypto-key="cryptpad:Wkw6FmyqY69XxN1p0S18P6Xz1OdABF057EBDdyNjwxQ="></media-tag>
|
||||||
|
|
||||||
|
#### C. Réglages du pare-feu
|
||||||
|
|
||||||
|
[REDHAT - Using and configurind firewalld](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/configuring_firewalls_and_packet_filters/using-and-configuring-firewalld_firewall-packet-filters)
|
||||||
|
|
||||||
|
- Zone personnalisée : `ceph-mcs2025`
|
||||||
|
- Associée à l'interface du **bond0**
|
||||||
|
- [Autorisation des ports nécessaires à CEPH](https://docs.redhat.com/fr/documentation/red_hat_ceph_storage/5/html/configuration_guide/ceph-firewall-ports_conf) et associés
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo firewall-cmd --permanent --new-zone=ceph-mcs2025
|
||||||
|
|
||||||
|
# Pour vérifier
|
||||||
|
sudo firewall-cmd --reload
|
||||||
|
sudo firewall-cmd --get-zones
|
||||||
|
|
||||||
|
sudo firewall-cmd --permanent --zone=ceph-mcs2025 --add-interface=bond0
|
||||||
|
sudo firewall-cmd --permanent --zone=ceph-mcs2025 --add-service=ssh
|
||||||
|
|
||||||
|
sudo firewall-cmd --permanent --zone=ceph-mcs2025 --add-port=80/tcp
|
||||||
|
sudo firewall-cmd --permanent --zone=ceph-mcs2025 --add-port=443/tcp
|
||||||
|
sudo firewall-cmd --permanent --zone=ceph-mcs2025 --add-port=3300-3303/tcp
|
||||||
|
sudo firewall-cmd --permanent --zone=ceph-mcs2025 --add-port=6789/tcp
|
||||||
|
sudo firewall-cmd --permanent --zone=ceph-mcs2025 --add-port=6800-7300/tcp
|
||||||
|
sudo firewall-cmd --permanent --zone=ceph-mcs2025 --add-port=7480/tcp
|
||||||
|
sudo firewall-cmd --permanent --zone=ceph-mcs2025 --add-port=8443/tcp
|
||||||
|
|
||||||
|
sudo firewall-cmd --permanent --zone=ceph-mcs2025 --add-port=123/udp
|
||||||
|
sudo firewall-cmd --permanent --zone=ceph-mcs2025 --add-port=6800-7300/udp
|
||||||
|
|
||||||
|
sudo firewall-cmd --reload
|
||||||
|
```
|
||||||
|
|
||||||
|
Et on vérifie :
|
||||||
|
```
|
||||||
|
sudo firewall-cmd --info-zone=ceph-mcs2025
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/a2/a2ac2b8a91755f1e2f5b8a18bbe32dcc87104db8c402d26f" data-crypto-key="cryptpad:uS+oAUopcYI7IMTpuFEuv5+ZaAQHQPI26N+xYSiROKQ="></media-tag>
|
||||||
|
|
||||||
|
### 3. Installer et configurer Ceph
|
||||||
|
|
||||||
|
#### A. Choix du Ceph
|
||||||
|
|
||||||
|
On a décidé d'utiliser RGW pour diverses raisons :
|
||||||
|
1. c'est celui que nous connaissons le moins (raison éducative)
|
||||||
|
2. c'est un système basé sur une technologie qui devient un standard nuagique (avec AWS S3 repris même par les concurrents)
|
||||||
|
3. parce que pourquoi pas
|
||||||
|
|
||||||
|
#### B. Préparation des noeuds
|
||||||
|
|
||||||
|
[CEPH - cephadm](https://docs.ceph.com/en/squid/cephadm/) | [CEPH - Host Management](https://docs.ceph.com/en/squid/cephadm/host-management/)
|
||||||
|
|
||||||
|
- Installer `cephadm` version **`squid`** (*les deux dernières, `latest` et `tentacles` étant non stabilisées*)
|
||||||
|
- Déployer le moniteur **MON** et gestionnaire **MGR** sur le premier noeud, ajout des deux autres comme **OSD**
|
||||||
|
|
||||||
|
Sur les trois noeuds :
|
||||||
|
```
|
||||||
|
sudo dnf install -y centos-release-ceph-squid
|
||||||
|
sudo dnf install -y cephadm
|
||||||
|
|
||||||
|
# Pour les dépendances liées au déploiement de configurations
|
||||||
|
sudo dnf install -y python3-yaml python3-jinja2
|
||||||
|
```
|
||||||
|
|
||||||
|
Sur les deux noeuds OSD :
|
||||||
|
```
|
||||||
|
sudo cephadm add-repo --release squid
|
||||||
|
sudo cephadm install ceph-common
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/04/04bfeb6849b12b28965abf54e6cc91ddf9125915416f9c25" data-crypto-key="cryptpad:Wjy8vSEIcoiBF0pMfanPIn3XDIHjeMCzKg3xo5akk10="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/66/66c00f924c77439a0dd943f61fad5eda03026d620212dd01" data-crypto-key="cryptpad:z+le7TirXV8Bw8ErK4rzqX2c2RzlRRR6mm3IXRCm+es="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/ae/aed1ef80f77a90b5755d1afac29278c7437b40fcdfeb538c" data-crypto-key="cryptpad:7KlTiZrmMyCgXEXivmt1csEL347pQvnwVkav3OpxVkQ="></media-tag>
|
||||||
|
|
||||||
|
Bootstrap du cluster sur le noeud principal :
|
||||||
|
```
|
||||||
|
sudo cephadm bootstrap \
|
||||||
|
--mon-ip 10.0.10.11 \
|
||||||
|
--allow-fqdn-hostname \
|
||||||
|
--initial-dashboard-user admin \
|
||||||
|
--initial-dashboard-password 'Dashboard123!'
|
||||||
|
|
||||||
|
# Copie de la clef publique du MON/MGR sur les OSD
|
||||||
|
ssh-copy-id -f -i /etc/ceph/ceph.pub root@10.0.10.12
|
||||||
|
ssh-copy-id -f -i /etc/ceph/ceph.pub root@10.0.10.13
|
||||||
|
|
||||||
|
# Vérification
|
||||||
|
sudo ceph orch host ls
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/37/3753d7159bcb3e4a806ed81440e9b68a5153ed77c1dd3178" data-crypto-key="cryptpad:cwb1S464Sg2YC5IlOx1GLuWSyhEjFAKYLwDn02LeiJM="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/05/051b3bf8bc97c29ced6e2cc28505a196a4596b12ce6b2a9c" data-crypto-key="cryptpad:xsWlXVU0+hRImJI3iOr+BzMGnMQFZvq5FzTaj4Zy/eE="></media-tag>
|
||||||
|
|
||||||
|
Copie de la configuration du MON/MGR sur les OSD :
|
||||||
|
```
|
||||||
|
scp /etc/ceph/ceph.conf root@10.0.10.12:/etc/ceph/
|
||||||
|
scp /etc/ceph/ceph.conf root@10.0.10.13:/etc/ceph/
|
||||||
|
scp /etc/ceph/ceph.client.admin.keyring root@10.0.10.12:/etc/ceph/
|
||||||
|
scp /etc/ceph/ceph.client.admin.keyring root@10.0.10.13:/etc/ceph/
|
||||||
|
ssh root@10.0.10.12 "chmod 600 /etc/ceph/*.keyring && chmod 644 /etc/ceph/ceph.conf"
|
||||||
|
ssh root@10.0.10.13 "chmod 600 /etc/ceph/*.keyring && chmod 644 /etc/ceph/ceph.conf"
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/b6/b69984ee1490f1eb4385c1ea4f069680665ae6224ae54d8f" data-crypto-key="cryptpad:420QFw4Et9opABYI8n+pWGVTdcF7OwbvW4ckzJ3i0Jk="></media-tag>
|
||||||
|
|
||||||
|
Ajout des hôtes dans le cluster **Ceph** :
|
||||||
|
```
|
||||||
|
sudo ceph orch host add osd1 10.0.10.12
|
||||||
|
sudo ceph orch host add osd2 10.0.10.13
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/2a/2a21e37f16b7c508b955b0023363e9a113206221b717ac84" data-crypto-key="cryptpad:Xe+iyeh5eB3HySd2PUUjIEWK5TDbX8mf9wls3igXNxI="></media-tag>
|
||||||
|
|
||||||
|
[Ajout des **OSD** dans le cluster :](https://docs.ceph.com/en/squid/cephadm/services/osd/)
|
||||||
|
```
|
||||||
|
sudo ceph orch device ls
|
||||||
|
|
||||||
|
# Si on veut tout asservir sans distinction
|
||||||
|
sudo ceph orch apply osd --all-available-devices
|
||||||
|
|
||||||
|
# Si on veut asservir un panel précis de volumes
|
||||||
|
sudo ceph orch daemon add osd monmgr:/dev/sdb
|
||||||
|
sudo ceph orch daemon add osd osd1:/dev/sdb
|
||||||
|
sudo ceph orch daemon add osd osd2:/dev/sdb
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/43/438c9972b4f3cfbcf1e1ea817e3349feb26db85a85316599" data-crypto-key="cryptpad:BqGJbSrjy4PjKLFx4VoNswvY3yDo0Ed6KSAzkFD0vHU="></media-tag>
|
||||||
|
|
||||||
|
#### C. Déployer le service RGW
|
||||||
|
|
||||||
|
https://docs.ceph.com/en/squid/radosgw/
|
||||||
|
https://docs.ceph.com/en/squid/radosgw/s3/
|
||||||
|
|
||||||
|
- Créer un *daemon* RGW avec `ceph orch apply rgw`
|
||||||
|
- Configurer le domaine S3, clefs d'accès et politiques des seaux
|
||||||
|
|
||||||
|
[Déploiement du service RGW :](https://docs.ceph.com/en/latest/cephadm/services/rgw/)
|
||||||
|
```
|
||||||
|
sudo ceph orch apply rgw rgw-mcs \
|
||||||
|
--realm=realm-mcs \
|
||||||
|
--zone=zone-mcs \
|
||||||
|
--placement="2 osd1 osd2"
|
||||||
|
|
||||||
|
# Ou en version "triviale"
|
||||||
|
sudo ceph orch apply rgw rgw-mcs
|
||||||
|
```
|
||||||
|
|
||||||
|
Vérifier l'intégrité du cluster RGW :
|
||||||
|
```
|
||||||
|
sudo ceph orch ps --daemon_type rgw
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/9d/9d1aadd4922a53bb5121747b354cb4c8d305e1ce91813289" data-crypto-key="cryptpad:kp2Y514w4Q5euJSkYzERMRkhHRlF24G08IudZA597w0="></media-tag>
|
||||||
|
|
||||||
|
[Créer un admin S3 :](https://docs.ceph.com/en/squid/man/8/radosgw-admin/)
|
||||||
|
```
|
||||||
|
sudo dnf install -y epel-release
|
||||||
|
sudo dnf install -y ceph-radosgw
|
||||||
|
|
||||||
|
sudo radosgw-admin user create --uid=egf2025 --display-name="EstGauFlo 2025"
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/d7/d71d32e03c04b6092da7a8a1f282f6f3a5344478806ff089" data-crypto-key="cryptpad:PuJEHV5LYY0an9GXKK2OOi5zF2Kd4IswUW1QXoSg7PQ="></media-tag>
|
||||||
|
|
||||||
|
Modifier le ceph.conf :
|
||||||
|
```
|
||||||
|
sudo nano /etc/ceph/ceph.conf
|
||||||
|
[client.radosgw.gateway]
|
||||||
|
host = [monmgr, osd1, osd2]
|
||||||
|
keyring = /etc/ceph/ceph.client.radosgw.gateway.keyring
|
||||||
|
rgw_frontends = "beast port=7480"
|
||||||
|
|
||||||
|
sudo systemctl start ceph-radosgw@rgw.gateway
|
||||||
|
|
||||||
|
sudo nano /etc/ceph/ceph.client.radosgw.keyring
|
||||||
|
[client.admin]
|
||||||
|
key = *******
|
||||||
|
caps mds = "allow *"
|
||||||
|
caps mgr = "allow *"
|
||||||
|
caps mon = "allow *"
|
||||||
|
caps osd = "allow *"
|
||||||
|
```
|
||||||
|
|
||||||
|
Vérifier la santé du cluster Ceph :
|
||||||
|
```
|
||||||
|
sudo ceph -s
|
||||||
|
sudo ceph health detail
|
||||||
|
```
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/00/008175712685740833165d4189973388037dece6e97ca258" data-crypto-key="cryptpad:ETLbKix9PaqPO1JmCAV61rgOmEoKNVpp1ZsH9KZSFoo="></media-tag>
|
||||||
|
|
||||||
|
Configurer l'accès S3 :
|
||||||
|
```
|
||||||
|
sudo dnf install -y awscli
|
||||||
|
|
||||||
|
aws configure set aws_access_key_id XXOKHTFX8OUAW4YEFBVT
|
||||||
|
aws configure set aws_secret_access_key b3Cn2vYARkbnGWlPVdCg16ZYUZ3IczXC4SvtBBMy
|
||||||
|
aws s3 ls --endpoint-url http://10.0.10.11:7480
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Notes sur le précédent bloc
|
||||||
|
Ca ne sert à rien de copier le couple ID-Clef, ce sont des utilisateurs locaux, mais ce sont bien des vraies. On sait ce qu'on fait présentement, mais il est évident qu'on ne fait jamais ça en production.
|
||||||
|
|
||||||
|
La solution de niveau 1 c'est d'utiliser une variable d'environnement temporaire (`AWS_ID="XXOKHTFX8OUAW4YEFBVT"` et ensuite appeler avec un `$AWS_ID` dans le shell pour une expiration à déconnexion), et la solution de niveau 2 serait de déployer un serveur Consul/Vault sur le réseau pour gérer des secrets.
|
||||||
|
|
||||||
|
Vérifications :
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/f5/f57c10f5f901f528d6161d4d4068212ad93682ca281af5c7" data-crypto-key="cryptpad:YBGemuMRbe+2XHP9QCHhpOQkhVytwDubUkZI3SR2E5o="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/a4/a4fc092b1f622e66df15a15038578d0baa96519918acd3f0" data-crypto-key="cryptpad:vUWHK4CoxoVNirRj6IrZwIuuegv0UlciycL+B8Y8Qk0="></media-tag>
|
||||||
|
|
||||||
|
Et ensuite faire un test de téléversement dans un seau S3 avec la [documentation officielle](https://docs.aws.amazon.com/cli/latest/reference/s3/)
|
||||||
|
|
||||||
|
```
|
||||||
|
aws s3 cp ./fichier s3://bucket/ --endpoint-url http://10.0.10.11:7480
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/aa/aa5dbaeb6794883b7e00b8d66d35f76512f605cc5deb26b2" data-crypto-key="cryptpad:1kSGzofa2tLeZC8F7U/f+6eXyN7U9ypJmZ7Ves5rleU="></media-tag>
|
||||||
|
|
||||||
|
#### D. (Bonus) Vérifier sur le Dashboard
|
||||||
|
|
||||||
|
Nous avons rajouté dans le réseau NAT (mais pas le Ceph) une machine tierce avec interface graphique, Rocky Linux ou Debian pour se connecter sur le dashboard :
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/15/15ff2edb30fde6ac61678c0a12459ce0a1e73ec6c03b2df9" data-crypto-key="cryptpad:TfjK9Mvvdxl2s0EnNbmA4o5i+HWP5qRipw2qv/MeJIk="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/73/7349a2e0f870321fc439f01406a04fec1e2153761419e757" data-crypto-key="cryptpad:Lz8yvNg+wuSZHY2+z2ffd0aw3R9equWXoLai67IChnA="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/18/18483faba0aa6472152e2e25004209389f95fb03aa6b79e3" data-crypto-key="cryptpad:wQhByOE8wrLo9VaRw8zGBQF9QKCi6gud35MpIlqmaTs="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/46/46360ecf4ee7840bf56ba19b7c07fdd1c8320d7e8887df93" data-crypto-key="cryptpad:FSxbRr2sEJt5GqipjMVW99t/9BwsrU65HkTOYpiZoEk="></media-tag>
|
||||||
|
|
||||||
|
### 4. Cisco Packet Tracer
|
||||||
|
|
||||||
|
#### A. Créer la topologie en GUI
|
||||||
|
|
||||||
|
- VLAN unique pour les 3
|
||||||
|
- Switchs Layer 2 (un ou plusieurs)
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/f4/f48ef893820e0e9f0e2e0d6d2cd73d82308f65e4eb7b9598" data-crypto-key="cryptpad:a/qRxMjOGyuDXlxG2mmFWi3dkbXG6JrT3KSQ3RqquTI="></media-tag>
|
||||||
|
|
||||||
|
#### B. Créer la topologie en CLI
|
||||||
|
|
||||||
|
Création des LAGs :
|
||||||
|
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface range fa0/[1-7]-[3-9]
|
||||||
|
channel-group [1,2,3] mode active
|
||||||
|
no shutdown
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/6a/6a2509b4f6e2a366356a13e288b33f91adec0b78a8ceb857" data-crypto-key="cryptpad:WKXQB4Poov7EL8/82WjJLs235J/qzfAWJIaoXAGi2/I="></media-tag>
|
||||||
|
|
||||||
|
Créer les VLAN :
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
vlan 10
|
||||||
|
name CephCluster
|
||||||
|
exit
|
||||||
|
interface fa0/24
|
||||||
|
switchport mode access
|
||||||
|
switchport access vlan 10
|
||||||
|
no shutdown
|
||||||
|
exit
|
||||||
|
interface port-channel [1,2,3]
|
||||||
|
switchport mode trunk
|
||||||
|
switchport trunk native vlan 1
|
||||||
|
switchport trunk allowed vlan 1,10
|
||||||
|
no shutdown
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/4e/4ebbd4130db94e2c9051ce3f63dedbe02c0d0c96f3874b60" data-crypto-key="cryptpad:ZMyW0x6++/MqFWxH57+l+YJi3L8ORaHU3rhZdzRUGIM="></media-tag>
|
||||||
|
|
||||||
|
[Créer la passerelle HSRP sur les routeurs :](https://routeur.clemanet.com/hsrp-cisco.php)
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
ip routing
|
||||||
|
interface Gig0/0/1.10
|
||||||
|
encapsulation dot1q 10
|
||||||
|
ip address 10.0.10.[2,3] 255.255.255.0
|
||||||
|
standby 1 ip 10.0.10.1
|
||||||
|
standby 1 priority [100, 150]
|
||||||
|
standby 1 preempt
|
||||||
|
no shutdown
|
||||||
|
end
|
||||||
|
show standby
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/c1/c1b0fc95b8db907a0d8b16cf9baab1a88a85807eb1e82f21" data-crypto-key="cryptpad:GW5Jz8ObOkwJRZFeJeQyawDCZzdw2ROwaVZM6SXB77U="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/68/68898c849a7ced544cd2a612db570ab61ef0b8b6da7a0185" data-crypto-key="cryptpad:gNGAPg+atpRGsPz7O2vsAaOHrhAnVIRaRXMcM1P1jzE="></media-tag>
|
||||||
|
|
||||||
|
Et on vérifie par un PING d'un OSD à un autre :
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/2c/2cc0b941a4e1e3fdce2c9475ff3c7e02eb1e172656fec99c" data-crypto-key="cryptpad:vjbMi/mYJ9kYxJb7+1M5g79yTdepCQkA0/sPd8iXaVk="></media-tag>
|
||||||
|
|
||||||
|
Et on teste avec un routeur éteint :
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/7a/7ada1d6e9098e316cf4406bf3a7bc5fe44b91457c7de19f8" data-crypto-key="cryptpad:Rzu93JyAnvomJsPvRxnCX7ixzTlWYl9k/P+6+xuReps="></media-tag>
|
||||||
|
|
||||||
|
#### C. Sécurisation
|
||||||
|
|
||||||
|
https://www.cisco.com/c/deleteme/sec/b_1710_sec_9300_cg/port_security.html
|
||||||
|
|
||||||
|
- Limiter le *MAC-address learning*
|
||||||
|
- Activer *port-security* en mettant 1 dresse MAC maximum
|
||||||
|
- Configurer les ports d'administration (console/VTY) avec authentification locale
|
||||||
|
- Activer le SSH sur les switchs avec restriction aux adresses du VLAN
|
||||||
|
- Autoriser le trafic Ceph, IMCP et SNMP uniquement depuis les adresses de gestion
|
||||||
|
|
||||||
|
Sécurité des ports :
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
interface range fa0/#-# // ports non utilisés
|
||||||
|
shutdown
|
||||||
|
exit
|
||||||
|
interface range fa0/#-# // ports en usage
|
||||||
|
switchport port-security
|
||||||
|
switchport port-security maximum 1
|
||||||
|
switchport port-security violation restrict
|
||||||
|
switchport port-security mac-address sticky
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/19/19fd8194668ad082d5178f227c62b35b07bebbdd8dfa63d3" data-crypto-key="cryptpad:A6jmhR4OuaxQHMm+KbU31knsTnGw2MRaj755o8T51zw="></media-tag>
|
||||||
|
|
||||||
|
Activer le SSH :
|
||||||
|
```
|
||||||
|
ip domain-name mcs2025.local
|
||||||
|
username admin secret mcs2025
|
||||||
|
crypto key generate rsa general-keys modulus 2048
|
||||||
|
ip ssh version 2
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/18/1881a74fa8065efcf42ced3373d7b136cc098dfab1d7db2a" data-crypto-key="cryptpad:3enRu+/ilQvxeyLU+yFdIGZ2b9TyHqycSwKOJE3qHO0="></media-tag>
|
||||||
|
|
||||||
|
Protection par mot de passe :
|
||||||
|
```
|
||||||
|
enable
|
||||||
|
conf t
|
||||||
|
enable password encryption
|
||||||
|
line console 0
|
||||||
|
password CisCanne
|
||||||
|
login local
|
||||||
|
line vty 0 4
|
||||||
|
login local
|
||||||
|
transport input ssh
|
||||||
|
enable secret Conf-Iture
|
||||||
|
end
|
||||||
|
write memory
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/c7/c7489db8ed0d3e567414d3fee430ac312b66ccc0c5a48dd1" data-crypto-key="cryptpad:ozAr3/lNIaY4eBJ3JXGM5jpt92XkuZbk1NcXjrqniTA="></media-tag>
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/50/50e9db450cf23ccaac173476143752a85743a76917af5373" data-crypto-key="cryptpad:tlpugQJH1eSRGkBL1FihnusGElULFGzFj0ggsgTIZqQ="></media-tag>
|
||||||
|
|
||||||
|
ACL pour le trafic Ceph :
|
||||||
|
```
|
||||||
|
ip access-list extended CEPH-ALLOW
|
||||||
|
permit tcp any any eq 80
|
||||||
|
permit tcp any any eq 443
|
||||||
|
permit tcp any any eq 6789
|
||||||
|
permit tcp any any eq 7480
|
||||||
|
permit tcp any any eq 8443
|
||||||
|
permit tcp any any range 3300 3303
|
||||||
|
permit tcp any any range 6800 7300
|
||||||
|
permit udp any any range 6800 7300
|
||||||
|
permit icmp any any
|
||||||
|
permit udp any any eq 161
|
||||||
|
deny ip any any
|
||||||
|
```
|
||||||
|
|
||||||
|
<media-tag src="https://files.cryptpad.fr/blob/35/35b58a27fc74a43af2a5ffd1e81ce446a53b1d632d013459" data-crypto-key="cryptpad:Lu/trK9ciZxIK+6hk476MVpMttad4JY2BndgxC3ouMY="></media-tag>
|
||||||
|
|
||||||
|
# Liens utiles
|
||||||
|
|
||||||
|
## Bibliographie
|
||||||
|
### Ceph
|
||||||
|
[Tutoriel Scaleway d'un cluster Ceph](https://www.scaleway.com/en/docs/tutorials/ceph-cluster/)
|
||||||
|
|
||||||
|
[Tutoriel d'installer Ceph sur Rocky Linux](https://www.linkedin.com/pulse/step-by-step-instructions-install-ceph-rocky-linux-saman-salamat/)
|
||||||
|
|
||||||
|
[Configuration RGW sur RedHat](https://docs.redhat.com/de/documentation/red_hat_ceph_storage/3/html/object_gateway_guide_for_red_hat_enterprise_linux/rgw-configuration-reference-rgw)
|
||||||
|
|
||||||
|
[Cephadm pour RGW](https://docs.ceph.com/en/reef/cephadm/services/rgw/)
|
||||||
|
|
||||||
|
[Déployer Ceph sur Rocky Linux 9](https://random-it-blog.de/ceph/ceph-storage-cluster-deployment-on-rocky-linux-9-centos-9/)
|
||||||
|
|
||||||
|
### Pare-feu Rocky
|
||||||
|
[Mettre en place FirewallD](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-using-firewalld-on-rocky-linux-8)
|
||||||
|
|
||||||
|
[Ports pour cluster Ceph](https://docs.redhat.com/en/documentation/red_hat_ceph_storage/5/html/configuration_guide/ceph-firewall-ports_conf)
|
||||||
|
|
||||||
|
[FirewallD par Stéphane Robert](https://blog.stephane-robert.info/docs/securiser/reseaux/firewalld/)
|
||||||
|
|
||||||
|
### Détails sur la configuration
|
||||||
|
["Beast" pour RadosGW](https://documentation.suse.com/fr-fr/ses/7.1/single-html/ses-admin/book-storage-admin.html#config-ogw)
|
||||||
|
|
||||||
|
## Ressources
|
||||||
|
[Rocky Linux](https://rockylinux.org/fr-FR/download)
|
||||||
12
Semaine_03/Jour_01.md
Normal file
12
Semaine_03/Jour_01.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# Projet 1
|
||||||
|
|
||||||
|
## Enoncé
|
||||||
|
|
||||||
|
Mettre en place une infrastructure :
|
||||||
|
- serveurs sur VirtualBox
|
||||||
|
- appareils réseaux sur Cisco Packet Tracer
|
||||||
|
|
||||||
|
### Système
|
||||||
|
|
||||||
|
- 3 VMs Rocky Linux => 9 faisant un cluster sous CEPH (CephFS, RBD, RGW au choix).
|
||||||
|
- Pare-feu natif à la famille de distribution des règles autorisant les noeuds à se "parler en Ceph", le tout dans une "zone" dédiée, avec interface virtuelle dédiée à cette zone. Cette interface virtuelle est composée de 2 interfaces réseau physiques réunies dans un bonding (avec l'hyperviseur, en accès par pont + réseau NAT, mais PAS en NAT)
|
||||||
BIN
Semaine_03/Semaine_03_CEPH_Network.pkt
Normal file
BIN
Semaine_03/Semaine_03_CEPH_Network.pkt
Normal file
Binary file not shown.
BIN
Semaine_03/Semaine_03_Examen.pdf
Normal file
BIN
Semaine_03/Semaine_03_Examen.pdf
Normal file
Binary file not shown.
BIN
Semaine_03/Énoncé MCS.pdf
Normal file
BIN
Semaine_03/Énoncé MCS.pdf
Normal file
Binary file not shown.
Reference in New Issue
Block a user