# AJOUT DE TEMPLATE SUR GNS3 VM

#### Prérequis

- Avoir installé GNS3
- Avoir installé GNS3 VM
- Avoir des les ISOs dont vous avez besoins
- Pour Cisco avoir le script de génération de licence

#### Ajout d'un template

- Ajoutez un template  
    [![image.png](https://book.techoops.fr/uploads/images/gallery/2023-11/scaled-1680-/3gVimage.png)](https://book.techoops.fr/uploads/images/gallery/2023-11/3gVimage.png)
    
    [![image.png](https://book.techoops.fr/uploads/images/gallery/2023-11/scaled-1680-/zJfimage.png)](https://book.techoops.fr/uploads/images/gallery/2023-11/zJfimage.png)
- Mettez à jour la registry  
    [![image.png](https://book.techoops.fr/uploads/images/gallery/2023-11/scaled-1680-/wLLimage.png)](https://book.techoops.fr/uploads/images/gallery/2023-11/wLLimage.png)
- Sélectionnez le template qu'il vous faut  
    [![image.png](https://book.techoops.fr/uploads/images/gallery/2023-11/scaled-1680-/V2gimage.png)](https://book.techoops.fr/uploads/images/gallery/2023-11/V2gimage.png)
    
    [![image.png](https://book.techoops.fr/uploads/images/gallery/2023-11/scaled-1680-/7Smimage.png)](https://book.techoops.fr/uploads/images/gallery/2023-11/7Smimage.png)
- Il se peut que votre version ne soit pas la bonne dans ce cas créée la nouvelle version  
    [![image.png](https://book.techoops.fr/uploads/images/gallery/2023-11/scaled-1680-/m42image.png)](https://book.techoops.fr/uploads/images/gallery/2023-11/m42image.png)
    
    [![image.png](https://book.techoops.fr/uploads/images/gallery/2023-11/scaled-1680-/G5qimage.png)](https://book.techoops.fr/uploads/images/gallery/2023-11/G5qimage.png)
    
    [![image.png](https://book.techoops.fr/uploads/images/gallery/2023-11/scaled-1680-/3vJimage.png)](https://book.techoops.fr/uploads/images/gallery/2023-11/3vJimage.png)
- Importez l'image  
    [![image.png](https://book.techoops.fr/uploads/images/gallery/2023-11/scaled-1680-/yciimage.png)](https://book.techoops.fr/uploads/images/gallery/2023-11/yciimage.png)
    
    [![image.png](https://book.techoops.fr/uploads/images/gallery/2023-11/scaled-1680-/Ohcimage.png)](https://book.techoops.fr/uploads/images/gallery/2023-11/Ohcimage.png)
- Installez l'image  
    [![image.png](https://book.techoops.fr/uploads/images/gallery/2023-11/scaled-1680-/HTXimage.png)](https://book.techoops.fr/uploads/images/gallery/2023-11/HTXimage.png)
- A cette étape vous ne pourrez pas démarrer le routeur car vous n'avez pas la license  
    [![image.png](https://book.techoops.fr/uploads/images/gallery/2023-11/scaled-1680-/uqlimage.png)](https://book.techoops.fr/uploads/images/gallery/2023-11/uqlimage.png)

#### Ajout de la licence Cisco

- Connectez-vous au serveur en sftp via la console CMD 
    - L'Ip pour la connexion à la VM GNS3 est disponible depuis la console de la VM
    - Déplacez vous dans le répertoire contenant le script python
    - ```bash
        sftp gns3@192.168.95.128
        ```
- Envoyez le fichier sur la VM  
    ```powershell
    C:\Users\kvega\Documents>sftp gns3@192.168.95.128
    The authenticity of host '192.168.95.128 (192.168.95.128)' can't be established.
    ED25519 key fingerprint is SHA256:L6yg+SeXGwPI6JsYFu4q4uNLRRisd100BdY/gJAGJNw.
    This key is not known by any other names
    Are you sure you want to continue connecting (yes/no/[fingerprint])?
    Warning: Permanently added '192.168.95.128' (ED25519) to the list of known hosts.
    gns3@192.168.95.128's password:
    Connected to 192.168.95.128.
    sftp> put CiscoIOUKeygen3f.py
    Uploading CiscoIOUKeygen3f.py to /home/gns3/CiscoIOUKeygen3f.py
    CiscoIOUKeygen3f.py
    ```
- Se connecter à la Vm en ssh   
    [![image.png](https://book.techoops.fr/uploads/images/gallery/2023-11/scaled-1680-/4wgimage.png)](https://book.techoops.fr/uploads/images/gallery/2023-11/4wgimage.png)
- Exécutez le script  
    [![image.png](https://book.techoops.fr/uploads/images/gallery/2023-11/scaled-1680-/Sqyimage.png)](https://book.techoops.fr/uploads/images/gallery/2023-11/Sqyimage.png)
- Le retour du script nous indique de mettre un bloc d'instruction dans un fichier .iourc 
    - Copiez le bloc
    - ajouter le dans le fichier .iourc  
        [![image.png](https://book.techoops.fr/uploads/images/gallery/2023-11/scaled-1680-/GELimage.png)](https://book.techoops.fr/uploads/images/gallery/2023-11/GELimage.png)
        
        [![image.png](https://book.techoops.fr/uploads/images/gallery/2023-11/scaled-1680-/pMbimage.png)](https://book.techoops.fr/uploads/images/gallery/2023-11/pMbimage.png)
    - Faites CTRL+x pour quitter le fichier
- Tentez de démarrer le router ajouté  
    [![image.png](https://book.techoops.fr/uploads/images/gallery/2023-11/scaled-1680-/O49image.png)](https://book.techoops.fr/uploads/images/gallery/2023-11/O49image.png)
    
    <p class="callout success">[![image.png](https://book.techoops.fr/uploads/images/gallery/2023-11/scaled-1680-/cXBimage.png)](https://book.techoops.fr/uploads/images/gallery/2023-11/cXBimage.png)  
    Le Routeur est bien démarré !!  
    </p>