# Config Routeur/SwitchL2-L3 AP

### <span style="color: rgb(186,55,42);">Rappel schéma Infra</span>

[![image.png](https://sioaubusson.fr/uploads/images/gallery/2026-03/scaled-1680-/I7Wimage.png)](https://sioaubusson.fr/uploads/images/gallery/2026-03/I7Wimage.png)

### <span style="color: rgb(186,55,42);">Rappel tableau VLANS</span>

[![image.png](https://sioaubusson.fr/uploads/images/gallery/2026-03/scaled-1680-/F9vimage.png)](https://sioaubusson.fr/uploads/images/gallery/2026-03/F9vimage.png)

### <span style="color: rgb(186,55,42);">Documentation Routeur</span>

<span style="color: rgb(255,255,255);">COM4</span>

<span style="color: rgb(255,255,255);">Utilisateur : cisco</span>

<span style="color: rgb(255,255,255);">Mdp : caribou23000, </span>

<span style="color: rgb(255,255,255);">Tout d'abord nous allons configurer le port de notre routeur qui sera relié au réseau du lycée. Le port gi4 du routeur sera configuré en DHCP.</span>

<span style="color: rgb(255,255,255);">int gi4</span>

<span style="color: rgb(255,255,255);">ip add dhcp</span>

<span style="color: rgb(255,255,255);">Cette commande configure le port gi4 en DHCP ce qui nous permet par la suite d'obtenir une adresse IP du réseau du lycée.</span>

<span style="color: rgb(255,255,255);">Ensuite nous allons configurer le port qui sera donc relié au LAN c'est à dire notre réseau local.</span>

<span style="color: rgb(255,255,255);">int gi5</span>

<span style="color: rgb(255,255,255);">ip add 192.168.80.2 255.255.255.252</span>

<span style="color: rgb(255,255,255);">ip route 0.0.0.0 0.0.0.0 10.123.33.245</span>

<span style="color: rgb(255,255,255);">Pour vérifier la configuration nous pouvons faire la commande :</span>

<span style="color: rgb(255,255,255);"> #sh ip int brief</span>

[![image.png](https://sioaubusson.fr/uploads/images/gallery/2026-03/scaled-1680-/DWiimage.png)](https://sioaubusson.fr/uploads/images/gallery/2026-03/DWiimage.png)

<span style="color: rgb(255,255,255);">L'adresse réseau 192.168.80.0/29 représente le VLAN 9 ou Sortie, de notre réseau LAN GSB.</span>

<span style="color: rgb(255,255,255);">Une fois nos deux port fini de configurer nous pouvons attaquer la NAT, pour cela nous allons définir un port en outside (dehors du réseau) et inside (interne au réseau).</span>

<span style="color: rgb(255,255,255);">Nous allons donc définir le port gi5 en inside et le port gi4 en outside. Ensuite nous allons faire une ACL pour le VLAN 9 à l'aide de l'adresse réseau 192.168.80.0 et le masque générique donc pour 255.255.255.252 cela devient 0.0.0.3.</span>

<span style="color: rgb(255,255,255);">int gi5</span>

<span style="color: rgb(255,255,255);">ip nat inside</span>

<span style="color: rgb(255,255,255);">int gi4</span>

<span style="color: rgb(255,255,255);">ip nat outside</span>

<span style="color: rgb(255,255,255);">access-list 1 permit 192.168.80.0 0.0.0.3 -&gt; VLAN</span>

<span style="color: rgb(255,255,255);">ip nat inside source list 1 interface gi4 overload</span>

<span style="color: rgb(255,255,255);">Si besoin nous pouvons ajouter autant de vlan que nous voulons, dans notre cas nous y ajouterons les VLANS nécessaire pour le réseau GSB pour cela :</span>

<span style="color: rgb(255,255,255);">access-list 2 permit 192.168.10.0 0.0.0.255 -&gt; VLAN Administrateur</span>

<span style="color: rgb(255,255,255);">access-list 2 permit 192.168.20.0 0.0.0.255 -&gt; VLAN Accueil/Visiteur</span>

<span style="color: rgb(255,255,255);">access-list 2 permit 192.168.30.0 0.0.0.255 -&gt; VLAN Direction/DSI</span>

<span style="color: rgb(255,255,255);">access-list 2 permit 192.168.40.0 0.0.0.255 -&gt; VLAN RH</span>

<span style="color: rgb(255,255,255);">access-list 2 permit 192.168.50.0 0.0.0.255 -&gt; VLAN Communication</span>

<span style="color: rgb(255,255,255);">access-list 2 permit 192.168.60.0 0.0.0.255 -&gt; VLAN Commercial</span>

<span style="color: rgb(255,255,255);">access-list 2 permit 192.168.70.0 0.0.0.255 -&gt; VLAN Démonstration/ Salle de Réunion</span>

<span style="color: rgb(255,255,255);">access-list 2 permit 192.168.90.0 0.0.0.15 -&gt; VLAN Front</span>

<span style="color: rgb(255,255,255);">access-list 2 permit 192.168.100.0 0.0.0.15 -&gt; VLAN BACK</span>

<span style="color: rgb(255,255,255);">access-list 2 permit 192.168.110.0 0.0.0.7 -&gt; VLAN Sécurité</span>

<span style="color: rgb(255,255,255);">access-list 2 permit 192.168.120.0 0.0.0.3 -&gt; VLAN Proxmox</span>

<span style="color: rgb(255,255,255);">access-list 2 permit 192.168.130.0 0.0.0.255 -&gt; VLAN Client</span>

<span style="color: rgb(255,255,255);">ip nat inside source list interface gi4 overload</span>

<span style="color: rgb(255,255,255);">Maintenant toutes nos règles NAT sont fini d'être mise en place nous pouvons ainsi commencer la configuration de notre Switch L3.</span>

### <span style="color: rgb(186,55,42);">Documentation Switch L3</span>

<span style="color: rgb(255,255,255);">COM5</span>

<span style="color: rgb(255,255,255);">Utilisateur : cisco</span>

<span style="color: rgb(255,255,255);">Mdp : caribou23000, </span>

<span style="color: rgb(255,255,255);">Dans notre Switch L3 Catalyst-1300 nous y indiquerons tous nos VLANS de notre réseau GSB pour cela nous allons utiliser notre tableau de VLAN, pas besoin de configurer les VLANS qui seront présent dans le PVE car L'OPNsense va de son côté attribuer les adresses aux VLANS.</span>

<span style="color: rgb(255,255,255);">vlan 2,3,4,5,6,7,8,9,10,11,12,13,14,99</span>

<span style="color: rgb(255,255,255);">(conf) int vlan 2</span>

<span style="color: rgb(255,255,255);">ip add 192.168.10.1 255.255.255.0</span>

<span style="color: rgb(255,255,255);">int vlan 3</span>

<span style="color: rgb(255,255,255);">ip add 192.168.20.1 255.255.255.0</span>

<span style="color: rgb(255,255,255);">int vlan 4</span>

<span style="color: rgb(255,255,255);">ip add 192.168.30.1 255.255.255.0</span>

<span style="color: rgb(255,255,255);">int vlan 5</span>

<span style="color: rgb(255,255,255);">ip add 192.168.40.1 255.255.255.0</span>

<span style="color: rgb(255,255,255);">int vlan 6</span>

<span style="color: rgb(255,255,255);">ip add 192.168.50.1 255.255.255.0</span>

<span style="color: rgb(255,255,255);">int vlan 7</span>

<span style="color: rgb(255,255,255);">ip add 192.168.60.1 255.255.255.0</span>

<span style="color: rgb(255,255,255);">int vlan 8</span>

<span style="color: rgb(255,255,255);">ip add 192.168.70.1 255.255.255.0</span>

<span style="color: rgb(255,255,255);">int vlan 9</span>

<span style="color: rgb(255,255,255);">ip add 192.168.80.1 255.255.255.252</span>

<span style="color: rgb(255,255,255);">int vlan 99 -&gt; Correspond au VLAN Vide </span>

<span style="color: rgb(255,255,255);">ip add 192.168.99.1 255.255.255.0</span>

<span style="color: rgb(255,255,255);">Ensuite pour vérifier que tous nos VLANS ont bien été créé nous pouvons faire la commande :</span>

<span style="color: rgb(255,255,255);">\#sh ip int</span>

[![image.png](https://sioaubusson.fr/uploads/images/gallery/2026-03/scaled-1680-/krtimage.png)](https://sioaubusson.fr/uploads/images/gallery/2026-03/krtimage.png)

<span style="color: rgb(255,255,255);">Maintenant que nos VLANS sont tous bien été déclarés, nous pouvons dès à présent configurer les ports du Switch L3.</span>

<span style="color: rgb(255,255,255);">Nous allons commencer par configurer le port reliant notre Switch L3 à notre Routeur et ensuite le port reliant le Switch L3 à notre Switch L2.</span>

<span style="color: rgb(255,255,255);">int gi1 -&gt; Port relié au Routeur</span>

<span style="color: rgb(255,255,255);">switchport mode access</span>

<span style="color: rgb(255,255,255);">switchport access vlan 9 -&gt; VLAN Sortie</span>

<span style="color: rgb(255,255,255);">int gi2 -&gt; Port relié au Proxmox</span>

<span style="color: rgb(255,255,255);">switchport mode trunk</span>

<span style="color: rgb(255,255,255);">switchport trunk allowed vlan add 2,10,11,12,13,14</span>

<span style="color: rgb(255,255,255);">int gi3 -&gt; Port relié au Switch L2</span>

<span style="color: rgb(255,255,255);">switchport mode trunk</span>

<span style="color: rgb(255,255,255);">switchport trunk allowed vlan add 3,4,5,6,7,8</span>

<span style="color: rgb(255,255,255);">int gitX</span>

<span style="color: rgb(255,255,255);">switchport mode access</span>

<span style="color: rgb(255,255,255);">switch access vlan 99 -&gt; Correspond au VLAN Vide </span>

<span style="color: rgb(255,255,255);">switchport trunk allowed vlan remove 99 -&gt; Commande pour retirer un VLAN d'un port</span>

<span style="color: rgb(255,255,255);">Une fois nos configuration faite nous pouvons faire la commande suivante pour voir nos VLANS ainsi que à qu'elles ports sont elles assignées :</span>

[![image.png](https://sioaubusson.fr/uploads/images/gallery/2026-03/scaled-1680-/bYEimage.png)](https://sioaubusson.fr/uploads/images/gallery/2026-03/bYEimage.png)

<span style="color: rgb(255,255,255);">Maintenant que nos VLANS sont configurées nous pouvons à présent attaquer les routes qui reliera tous nos vlan au port de notre routeur gi5 192.168.80.2.</span>

<span style="color: rgb(255,255,255);">ip route 0.0.0.0 0.0.0.0 192.168.80.1 -&gt; Route par défaut</span>

<span style="color: rgb(255,255,255);">ip route 192.168.10.0 255.255.255.0 192.168.80.1</span>

<span style="color: rgb(255,255,255);"> ip route 192.168.20.0 255.255.255.0 192.168.80.1</span>

<span style="color: rgb(255,255,255);"> ip route 192.168.30.0 255.255.255.0 192.168.80.2</span>

<span style="color: rgb(255,255,255);">ip route 192.168.40.0 255.255.255.0 192.168.80.2</span>

<span style="color: rgb(255,255,255);">ip route 192.168.50.0 255.255.255.0 192.168.80.2</span>

<span style="color: rgb(255,255,255);">ip route 192.168.60.0 255.255.255.0 192.168.80.2</span>

<span style="color: rgb(255,255,255);">ip route 192.168.70.0 255.255.255.0 192.168.80.2</span>

<span style="color: rgb(255,255,255);">ip route 192.168.90.0 255.255.255.0 192.168.80.2</span>

<span style="color: rgb(255,255,255);">ip route 192.168.100.0 255.255.255.0 192.168.80.2</span>

<span style="color: rgb(255,255,255);">ip route 192.168.110.0 255.255.255.0 192.168.80.2</span>

<span style="color: rgb(255,255,255);">ip route 192.168.120.0 255.255.255.0 192.168.80.2</span>

<span style="color: rgb(255,255,255);">ip route 192.168.130.0 255.255.255.0 192.168.80.2</span>

<span style="color: rgb(255,255,255);">Dès que nous avons fini nos commandes ip route, pour les vérifier nous pouvons faire la commande suivante :</span>

[![image.png](https://sioaubusson.fr/uploads/images/gallery/2026-03/scaled-1680-/Kgrimage.png)](https://sioaubusson.fr/uploads/images/gallery/2026-03/Kgrimage.png)