Cisco Packet Tracer Lab Exam – Extended Cheat Sheet (Full Version)
---
## 📘 1. VLAN CONFIGURATION
### ➕ Créer des VLANs
Switch(config)# vlan 10
Switch(config-vlan)# name Faculty
Switch(config)# vlan 20
Switch(config-vlan)# name Students
Switch(config)# vlan 30
Switch(config-vlan)# name Admin
Switch(config)# vlan 100
Switch(config-vlan)# name Native
Switch(config)# vlan 999
Switch(config-vlan)# name Unused_Ports
### 🔌 Attribuer un VLAN à un port en mode access
Switch(config)# interface range fa0/1 - 5
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 10
### 🔐 Sécuriser les ports non utilisés
Switch(config)# interface range fa0/10 - 24
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 999
Switch(config-if-range)# shutdown
### 🔍 Vérification VLAN
Switch# show vlan brief
---
## 🔄 2. TRUNKING (LIAISON TRONQUÉE)
### Configuration Trunk entre switches
Switch(config)# interface g0/1
Switch(config-if)# switchport trunk encapsulation dot1q
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 10,20,30
Switch(config-if)# switchport trunk native vlan 100
### 🔍 Vérifier le trunk
Switch# show interfaces trunk
Switch# show interfaces g0/1 switchport
---
## 🌉 3. INTER-VLAN ROUTING
### 🖧 Méthode Router-on-a-Stick
Router(config)# interface g0/0.10
Router(config-subif)# encapsulation dot1Q 10
Router(config-subif)# ip address [Link] [Link]
### 🔁 Sur switch couche 3 (SVI)
Switch(config)# ip routing
Switch(config)# interface vlan 10
Switch(config-if)# ip address [Link] [Link]
Switch(config-if)# no shutdown
+++++++++++++++++++
for MLS:
Création d'un port LAN sur le MLS :
MLS(config)#int g1/0/24
MLS(config-if)#no switchportMLS(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/24, changed
state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/24, changed
state to up
MLS(config-if)#ip add [Link] [Link]
if it s router on a stick do iterfaves on mls
++++++++++++++++++++++++++
Bassem BEN SALAH10 févr.
Désactivation du protocole CDP :
MLS#conf t
Enter configuration commands, one per line. End with CNTL/Z.
MLS(config)#no cdp run
Bassem BEN SALAH10 févr.
Création des VLANs et configuration des ports non utilisés :
MLS(config)#vlan 10
MLS(config-vlan)#name Faculty
MLS(config-vlan)#vlan 20
MLS(config-vlan)#name Students
MLS(config-vlan)#vlan 30
MLS(config-vlan)#name Admin
MLS(config-vlan)#vlan 100
MLS(config-vlan)#name Native
MLS(config-vlan)#vlan 999
MLS(config-vlan)#name Unused_Ports
---------------------------
MLS(config-if-range)#int range G1/0/3-23 , G1/1/1-4
MLS(config-if-range)#sw mode acc
MLS(config-if-range)#sw acc vlan 999
MLS(config-if-range)#sh
---------------------------
Configuration des liaisons Trunk entre MLS -- S1 et MLS -- S3
MLS(config-if-range)#int range G1/0/3-23 , G1/1/1-4
MLS(config-if-range)#sw mode acc
MLS(config-if-range)#sw acc vlan 999
MLS(config-if-range)#sh
Bassem BEN SALAH10 févr.
Configuration des passerelles par défaut de chaque VLAN (SVI) :
MLS#conf t
Enter configuration commands, one per line. End with CNTL/Z.
MLS(config)#int vlan 10
MLS(config-if)#ip add [Link] [Link]
MLS(config-if)#int vlan 20
MLS(config-if)#ip add [Link] [Link]
MLS(config-if)#int vlan 30
MLS(config-if)#ip add [Link] [Link]
Bassem BEN SALAH10 févr.
Activation du routage :
MLS(config)#ip routing
MLS(config)#do sh ip route connected
C [Link]/24 is directly connected, Vlan10
C [Link]/24 is directly connected, Vlan20
C [Link]/24 is directly connected, Vlan30
Bassem BEN SALAH10 févr.
Création d'un port LAN sur le MLS :
MLS(config)#int g1/0/24
MLS(config-if)#no switchportMLS(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/24, changed
state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/24, changed
state to up
MLS(config-if)#ip add [Link] [Link]
Bassem BEN SALAH17 févr.
MLS(config)#ip route [Link] [Link] G1/0/24
### 🔍 Vérifier
ping <gateway>
show ip route
---
## 🌲 4. SPANNING TREE PROTOCOL (STP)
### 🔁 Activer Rapid PVST
Switch(config)# spanning-tree mode rapid-pvst
### 🏆 Forcer un switch comme racine
Switch(config)# spanning-tree vlan 10 priority 4096
### 🚪 Activer PortFast sur les ports d’accès
Switch(config)# interface range fa0/1 - 5
Switch(config-if-range)# spanning-tree portfast
### 🔍 Vérifier
show spanning-tree vlan 10
---
## 🔗 5. ETHERCHANNEL
### 🟢 LACP (mode actif/passif)
interface range fa0/1 - 2
switchport mode trunk
channel-group 1 mode active
### 🔵 PAgP (Cisco only, mode auto/désirable)
interface range fa0/3 - 4
switchport mode trunk
channel-group 2 mode desirable
### 🔍 Vérification
show etherchannel summary
## acces
Switch(config)# interface Port-channel 1
---
## 📡 6. DHCPv4 (ATTRIBUTION DYNAMIQUE IPV4)
### 💾 Serveur DHCP sur routeur
ip dhcp excluded-address [Link] [Link]
ip dhcp pool VLAN10
network [Link] [Link]
default-router [Link]
dns-server [Link]
### 💻 Client DHCP
interface g0/1
ip address dhcp
### 🔍 Vérifier
show ip dhcp binding
# Adresses IPv6 de multidiffusion bien connues (Well-known multicast)
# Tous les nœuds
ff02::1 -> Tous les nœuds sur le lien local
# Tous les routeurs
ff02::2 -> Tous les routeurs sur le lien local
# Protocoles de routage
ff02::5 -> OSPFv2 - Tous les routeurs OSPF
ff02::6 -> OSPFv2 - Routeur désigné (DR) OSPF
ff02::9 -> RIPng (Routing Information Protocol Next Generation)
ff02::a -> EIGRP (Cisco)
# DHCPv6
ff02::1:2 -> Tous les agents DHCPv6 (serveurs/relayeurs)
ff05::1:3 -> Tous les serveurs DHCPv6 dans le site
# Multicast sollicité (Neighbor Discovery Protocol)
ff02::1:ffXX:XXXX -> Adresse de multidiffusion sollicitée (pour la découverte de
voisins - NDP)
# Autres utiles
ff02::1:ff00:0/104 -> Plage utilisée pour le multicast sollicité basé sur
l’adresse unicast cible
---
## 🌐 7. SLAAC & DHCPv6
### 🧪 SLAAC (configuration automatique IPv6)
interface g0/0
ipv6 address [Link]/64
ipv6 nd prefix [Link]/64
### 🧠 DHCPv6 Stateless (infos via DHCPv6, IP via RA)
ipv6 unicast-routing
ipv6 dhcp pool VLAN10
dns-server [Link]
domain-name [Link]
interface g0/0
ipv6 address [Link]/64
ipv6 nd other-config-flag
ipv6 dhcp server VLAN10
### 📦 DHCPv6 Stateful (IP + DNS via DHCPv6)
ipv6 dhcp pool FULLPOOL
address prefix [Link]/64
dns-server [Link]
interface g0/1
ipv6 address dhcp
ipv6 enable
---
## 8. PORT SECURITY
### 🔐 Configurer la sécurité de port
interface fa0/1
switchport mode access
switchport port-security
switchport port-security maximum 1
switchport port-security violation shutdown
switchport port-security mac-address sticky
### 🔍 Vérifier
show port-security
show port-security interface fa0/1
### 🧽 Réinitialiser MAC sticky
clear port-security sticky interface fa0/1
---
## 🔐 9. SSH, MOT DE PASSE, BANNIÈRES
### Définir nom d’hôte & domaine
hostname SW1
ip domain-name [Link]
### 🔑 Générer clé RSA
crypto key generate rsa
1024
### 👤 Créer un utilisateur
username admin privilege 15 secret cisco123
### 🔒 Activer SSH
ip ssh version 2
### 📞 Lignes VTY
line vty 0 4
login local
transport input ssh
### 🧾 Bannière de connexion
banner motd # UNAUTHORIZED ACCESS IS PROHIBITED #
---
## 🚫 10. ACL – LISTES DE CONTRÔLE D'ACCÈS
### 🟡 ACL standard
access-list 10 permit [Link] [Link]
interface g0/0
ip access-group 10 in
### 🔴 ACL étendue (précise)
access-list 100 permit tcp [Link] [Link] any eq 80
interface g0/0
ip access-group 100 in
### 🔍 Vérifier
show access-lists
show ip interface g0/0
---
## 🔄 HSRP (Hot Standby Router Protocol)
Objectif : Fournir une passerelle virtuelle redondante via une IP partagée.
✅ Configuration – Routeur 1 (actif attendu)
interface g0/1
ip address [Link] [Link]
standby 1 ip [Link] # IP virtuelle partagée
standby 1 priority 110 # Priorité élevée
standby 1 preempt # Peut préempter si retour de panne
✅ Configuration – Routeur 2
interface g0/1
ip address [Link] [Link]
standby 1 ip [Link]
standby 1 priority 100
standby 1 preempt
🔍 Vérification :
show standby
## 🧰 11. COMMANDES DE DIAGNOSTIC
Commandes générales :
show ip interface brief
show running-config
show mac address-table
show vlan brief
show interfaces trunk
show cdp neighbors detail
show lldp neighbors
Tests :
ping <IP>
traceroute <IP>
Débogage :
debug ip packet
undebug all
Sauvegarde :
copy running-config startup-config
reload
---------------------------------------------------------------
---------------------------------------------------------------
!
! ============================
! INSAT TP Exam - Full Configuration
! ============================
!
! STEP 1: Add router GTW and connect interfaces
!
! No CLI required here — physical connections in Packet Tracer:
! - GTW G0/0 <--> SW_CORE-D G0/1
! - GTW G0/1 <--> SW_CORE-D F0/24
! - GTW G0/2 <--> Branch-Router G0/1
!
! STEP 2: VLAN Configuration (on all relevant switches)
!
vlan 21
name VLAN21
vlan 22
name VLAN22
vlan 24
name VLAN24
vlan 25
name VLAN25
vlan 29
name BlackHole
vlan 30
name NativeVLAN
!
! STEP 3: TRUNK + ETHERCHANNEL CONFIG (example for SW_CORE-D)
!
interface range g0/1 - 2
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 21,22,24,25
switchport trunk native vlan 30
switchport mode trunk
switchport nonegotiate
interface Port-channel1
switchport mode trunk
switchport trunk allowed vlan 21,22,24,25
switchport trunk native vlan 30
channel-group 1 mode active ! LACP
!
! STEP 4: Router GTW Inter-VLAN Routing
!
interface g0/0
no shutdown
interface g0/0.22
encapsulation dot1Q 22
ip address [Link] [Link]
interface g0/0.24
encapsulation dot1Q 24
ip address [Link] [Link]
interface g0/0.25
encapsulation dot1Q 25
ip address [Link] [Link]
interface g0/1
encapsulation dot1Q 21
ip address [Link] [Link]
ip routing
!
! STEP 5: DHCP Server Config (on GTW and backup server)
!
ip dhcp excluded-address [Link] [Link]
ip dhcp excluded-address [Link] [Link]
ip dhcp pool VLAN21
network [Link] [Link]
default-router [Link]
dns-server [Link]
domain-name [Link]
ip dhcp pool VLAN22
network [Link] [Link]
default-router [Link]
dns-server [Link]
domain-name [Link]
! On Backup-DHCP Server set pools for .20 to .29 range manually
!
! STEP 6: Telnet Access (for each switch)
!
hostname SW_A
interface vlan 24
ip address [Link] [Link]
no shutdown
line vty 0 4
password pwdvty
login
ip default-gateway [Link]
hostname SW_B
interface vlan 24
ip address [Link] [Link]
no shutdown
line vty 0 4
password pwdvty
login
enable secret pwden
ip default-gateway [Link]
hostname SW_C
interface vlan 24
ip address [Link] [Link]
no shutdown
line vty 0 4
password pwdvty
login
ip default-gateway [Link]
hostname SW_D
interface vlan 24
ip address [Link] [Link]
no shutdown
line vty 0 4
password pwdvty
login
ip default-gateway [Link]
!
! STEP 7: STP (on SW_CORE-D)dhcp
!
spanning-tree vlan 21,22,24,25 priority 0
!
! STEP 8: Layer 2 Security
!
! a. Disable DTP (on all trunks)
interface range g0/1 - 2
switchport nonegotiate
! b. Disable unused ports & move to VLAN 29
interface range fa0/10 - 24
switchport mode access
switchport access vlan 29
shutdown
! c. Port Security (on active access ports)
interface range fa0/1 - 4
switchport mode access
switchport port-security
switchport port-security maximum 1
switchport port-security mac-address sticky
switchport port-security violation restrict
! d. DHCP Snooping
ip dhcp snooping
ip dhcp snooping vlan 21,22
interface g0/1
ip dhcp snooping trust(on trunk ports)
interface range fa0/1 - 4
ip dhcp snooping limit rate 5
! e. PortFast & BPDU Guard(on active access ports)
interface range fa0/1 - 4
spanning-tree portfast
spanning-tree bpduguard enable
! End of Configuration
-----------------------------------------------------------------------------------
------
-----------------------------------------------------------------------------------
------
for MLS:
Création d'un port LAN sur le MLS :
MLS(config)#int g1/0/24
MLS(config-if)#no switchportMLS(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/24, changed
state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/24, changed
state to up
MLS(config-if)#ip add [Link] [Link]
if it s router on a stick do iterfaves on mls
Fin de la fiche de révision complète Cisco Packet Tracer – Examen de labo