# AJOUT DE TEMPLATE

# Ajout template Debian

---

#### PREREQUIS

- Avoir GNS3 et GNS3VM d'installé
- Avoir une connection internet

---

#### AJOUT DU TEMPLATE

[![image.png](https://book.techoops.fr/uploads/images/gallery/2024-01/scaled-1680-/image.png)](https://book.techoops.fr/uploads/images/gallery/2024-01/image.png)

[![image.png](https://book.techoops.fr/uploads/images/gallery/2024-01/scaled-1680-/Eraimage.png)](https://book.techoops.fr/uploads/images/gallery/2024-01/Eraimage.png)

[![image.png](https://book.techoops.fr/uploads/images/gallery/2024-01/scaled-1680-/V6Vimage.png)](https://book.techoops.fr/uploads/images/gallery/2024-01/V6Vimage.png)

[![image.png](https://book.techoops.fr/uploads/images/gallery/2024-01/scaled-1680-/Nk2image.png)](https://book.techoops.fr/uploads/images/gallery/2024-01/Nk2image.png)

[![image.png](https://book.techoops.fr/uploads/images/gallery/2024-01/scaled-1680-/16aimage.png)](https://book.techoops.fr/uploads/images/gallery/2024-01/16aimage.png)  
Une fois télécharger on pourra alors l'ajouter

[![image.png](https://book.techoops.fr/uploads/images/gallery/2024-01/scaled-1680-/M0Vimage.png)](https://book.techoops.fr/uploads/images/gallery/2024-01/M0Vimage.png)  
Attendre la fin de l'import et terminer

[![image.png](https://book.techoops.fr/uploads/images/gallery/2024-01/scaled-1680-/zjVimage.png)](https://book.techoops.fr/uploads/images/gallery/2024-01/zjVimage.png)

---

#### PREMIER DEMARRAGE

1. Faire le shcéma suivant  
    [![image.png](https://book.techoops.fr/uploads/images/gallery/2024-01/scaled-1680-/5n8image.png)](https://book.techoops.fr/uploads/images/gallery/2024-01/5n8image.png)
2. Paramétrer le VPC avec pour ip 192.168.1.1/30
3. Paramétrage du serveur DEBIAN 
    1. L'authentification se fait avec l'utilistateur debian et le mot de passe debian
    2. Passer de l'utilisateur debian a root  
        `sudo -i`
    3. Pour le moment pas de réseau, il va falloir le paramétrer.  
        Il faut modifier le fichier `/etc/network/interfaces` et y mettre l'IP désirée:  
        ```bash
        # Static config for ens4
        auto ens4
        iface ens4 inet static
                address 192.168.1.2
                netmask 255.255.255.252
        #       gateway 192.168.1.1
        #       dns-nameservers 192.168.1.1
        
        ```
    4. Monter la carte réseau:  
        ` ifup ens4`
    5. Le serveur a maintenant une IP  
        ```bash
        root@debian:~# ip a |grep ens4
        2: ens4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
            inet 192.168.1.2/30 brd 192.168.1.3 scope global ens4
        ```
4. Test avec un pinc du vpc à la Debian12

<p class="callout success">Le serveur Debian est paramétrer au niveau du réseau !!</p>

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