:::info
# <center>Procédures Cisco Niveau 1</center>
#### **Rédacteur** : Corentin MARC
#### **Classe**: ASR 10
#### **Professeur** : Boris DOMOUR
**Note** : *Les procédures qui vont suivre se veulent généralistes. Elles pourront donc être réutilisées dans des contextes d'entreprise différents*
:::
## 1. Configuration de base d'un Switch Cisco
**I. Objectif.**
Ce document a pour objectif de décrire les différentes étapes de configuration de base d'un switch Cisco.
**I. Configuration du nom et du nom de domaine.**
Configuration du nom d’hôte.
> Switch> enable
> Switch# conf t
> Switch(config)# hostname [nom_périphérique]
> Switch(config)# ex
> Switch# wr
Suppression du nom d’hôte.
> Switch> enable
> Switch# conf t
> Switch(config)# no hostname
> Switch(config)# ex
> Switch# wr
Configuration du nom de domaine.
> Switch> enable
> Switch# conf t
> Switch(config)# ip domain-name [nom_domaine]
> Switch(config)# ex
> Switch# wr
Suppression du nom de domaine.
> Switch> enable
> Switch# conf t
> Switch(config)# no ip domain-name
> Switch(config)# ex
> Switch# wr
**II. Configuration réseau.**
Paramétrer la configuration réseau.
> Switch> enable
> Switch# conf t
> Switch(config)# vlan 1
> Switch(config-vlan)# ex
> Switch(config)# interface vlan1
> Switch(config-if)# ip address [adresse_ip] [masque]
> Switch(config-if)# ip default-gateway [adresse_gateway]
> Switch(config)# ex
> Switch# wr
Supprimer la configuration réseau.
> Switch> enable
> Switch# conf t
> Switch(config)# interface vlan1
> Switch(config-if)# no ip address
> Switch(config-if)# ex
> Switch(config)# no ip default-gateway
> Switch(config)# ex
> Switch# wr
**III. Configuration de l’authentification.**
Configurer l’accès au commutateur.
> Switch> enable
> Switch# conf t
> Switch(config)# service password-encryption
> Switch(config)# line con 0
> Switch(config-line)# password [mot_de_passe]
> Switch(config-line)# login
> Switch(config-line)# ex
> Switch(config)#ex
> Switch# wr
Supprimer l’accès au commutateur.
> Switch> enable
> Switch# conf t
> Switch(config)# line con 0
> Switch(config-line)# no password
> Switch(config-line)# ex
> Switch(config)#ex
> Switch# wr
Configurer l’accès au mode privilège.
> Switch> enable
> Switch# conf t
> Switch(config)# enable secret [mot_de_passe]
> Switch(config)# ex
> Switch# wr
Supprimer l’accès au mode privilège.
> Switch> enable
> Switch# conf t
> Switch(config)# no enable secret
> Switch(config)# ex
> Switch# wr
**IV. Configuration de l’heure.**
Configurer l’heure.
> Switch> enable
> Switch# conf t
> Switch(config)# clock timezone CET 1
> Switch(config)# ex
> Switch# show clock
> Switch# wr
## 2. Configuration de l'accès SSH.
**I. Objectif.**
Ce document a pour objectif de décrire les différentes étapes de configuration de l'accès SSH sur un switch Cisco.
**II. Configuration de l’accès SSH.**
Déterminer la version de l'OS.
> Switch> show version
*Note : Le numéro de version doit contenir k9 pour supporter le ssh.*
Configuration de la clé de chiffrement.
> Switch> en
> Switch# conf t
> Switch(config)# crypto key generate rsa
*Note : On choisira une clé sur 2048 bits.*
Configuration de l'accès ssh.
> Switch> en
> Switch# conf t
> Switch(config)# ip ssh version 2
> Switch(config)# line vty 0 4
> Switch(config-line)# transport input ssh
> Switch(config-line)# login local
> Switch(config-line)# ex
> Switch(config)# ex
> Switch# wr
Création d'un compte local.
> Switch> en
> Switch# conf t
> Switch(config)# username [nom_compte] password [mot_de_passe]
> Switch(config)# ex
> Switch# wr
## 3. Configuration des VLAN.
**I. Objectif.**
Ce document a pour objectif de décrire les différentes étapes de configuration d'un réseau virtuel (VLAN) sur un switch Cisco.
**II. Configuration d'un VLAN.**
Créer un VLAN.
> Switch> enable
> Switch# conf t
> Switch(config)# vlan [numéro_vlan]
> Switch(config-vlan)# name [nom_vlan]
> Switch(config-vlan)# ex
> Switch(config)# ex
> Switch# wr
Affecter un VLAN à un port.
> Switch> enable
> Switch# conf t
> Switch(config)# interface GigabitEthernet [numéro_interface]
> Switch(config-if)# switchport access vlan [numéro_vlan]
> Switch(config-if)# no shutdown
> Switch(config-if)# ex
> Switch(config)# ex
> Switch# wr
Affecter plusieurs VLAN à un port.
> Switch> enable
> Switch# conf t
> Switch(config)# interface GigabitEthernet [numéro_interface]
> Switch(config-if)# switchport mode trunk
> Switch(config-if)# switchport trunk allowed vlan [vlan_un] [vlan_deux]
> Switch(config-if)# no shutdown
> Switch(config-if)# ex
> Switch(config)# ex
> Switch# wr
**III. Configuration de l'inter-VLAN.**
Configuration du routage inter-vlan sur un commutateur de niveau 3.
> Switch> enable
> Switch# conf t
> Switch(config)# interface vlan [numéro_vlan]
> Switch(config-if)# ip address [ip_passerelle_vlan] [masque]
> Switch(config-if)# ex
> Switch(config)# ip routing
> Switch(config)# ex
> Switch# wr
Configuration des interfaces virtuels et du routage inter-vlan sur le routeur.
> Router> enable
> Router# conf t
> Router(config)# interface GigabitEthernet [numéro_interface.[interface_virtuel]]
> Router(config-if)#encapsulation dot1Q [numéro_vlan]
> Router(config-if)# ip address [ip_passerelle_vlan] [masque]
> Router(config-if)# no shutdown
> Router(config-if)# ex
> Router(config)# ex
> Router# wr
## 4. Configuration du routeur DHCP
**I. Objectif.**
Ce document a pour objectif de décrire les différentes étapes de configuration d'un serveur DHCP sur un routeur Cisco.
**II. Configuration du service DHCP.**
Configuration du pool.
> Router> enable
> Router# conf t
> Router(config)# ip dhcp pool [nom_pool]
> Router(dhcp-config)# network [adresse_réseau] [masque]
> Router(dhcp-config)# dns-server [adresse_serveur_dns]
> Router(dhcp-config)# default-router [adresse_routeur]
> Router(dhcp-config)# lease [jour] [heure] [minute]
> Router(dhcp-config)# ex
> Router(config)# ex
> Router# wr
Exclure des adresses de la plage.
> Router> enable
> Router# conf t
> Router(config)# ip dhcp excluded-address [[adresse_IP_1] à [adresse_IP₂]]
> Router(config)# ip dhcp excluded-address [adresse_IP]
> Router(config)# ex
> Router# wr
Réserver des adresses de la plage.
> Router> enable
> Router# conf t
> Router(config)# ip dhcp pool [nom_pool]
> Router(dhcp-config)# host [adresse_IP] [masque]
> Router(dhcp-config)# hardware-address [adresse_mac]
> Router(dhcp-config)# ex
> Router(config)# ex
> Router# wr
**III. Administration du service DHCP.**
Désactiver service DHCP.
> Router> enable
> Router# conf t
> Router(config)# no service dhcp
> Router(config)# ex
> Router# wr
Activer service DHCP.
> Router> enable
> Router# conf t
> Router(config)# service dhcp
> Router(config)# ex
> Router# wr
Visualiser les baux.
> Router> enable
> Router# show ip dhcp binding
Vider les baux.
> Router> enable
> Router# clear ip dhcp binding *
**IV. Configuration du relais DHCP.**
Configuration du relais DHCP.
> Router> enable
> Router# conf t
> Router(config)# interface GigabitEthernet [numéro_interface]
> Router(config-if)# ip helper-address [adresse_serveur_DHCP]
> Router(config-if)# no shutdown
> Router(config-if)# ex
> Router(config)# ex
> Router# wr
*Note : L’IP helper doit être activé sur l’interface où sont les clients.*
## 5. Configuration du DHCP Snooping
**I. Objectif.**
Ce document a pour objectif de décrire les différentes étapes de configuration du DHCP Snooping afin de contrer les attaques par DHCP Spoofing
**II. Configuration du DHCP Snooping.**
Configuration du DHCP Snooping.
> Switch> enable
> Switch# conf t
> Switch(config)# ip dhcp snooping
> Switch(config)# ip dhcp snooping vlan [vlan_1],[vlan_2],[vlan_3]
> Switch(config)# ip dhcp snooping information option
> Switch(config)# interface GigabitEthernet [numéro_interface]
> Switch(config-if)# ip dhcp snooping trust
> Switch(config-if)# ip dhcp snooping limit rate [nombre_requêtes_maximum]
> Switch(config-if)# ex
> Switch(config)# ex
> Switch# wr
Visualiser la configuration du DHCP Snooping.
> Switch> enable
> Switch# show ip dhcp snooping
## 6. Sécurisation des ports d'un switch
**I. Objectif.**
Ce document a pour objectif de décrire les différents moyens à mettre en oeuvre pour sécuriser les ports d'un switch Cisco.
**II. Sécurisation de l'accès.**
Sécurisation manuel de l’accès.
> Switch> enable
> Switch# conf t
> Switch(config)# interface GigabitEthernet [numéro_interface]
> Switch(config-if)# switchport mode access
> Switch(config-if)# switchport port-security
> Switch(config-if)# switchport port-security mac-address [adresse_mac]
> Switch(config-if)# ex
> Switch(config)# ex
> Switch# wr
*Note : Le format de l’addresse mac doit se noter sous la forme UUVV:WWXX:YYZZ*
Sécurisation automatique de l’accès.
> Switch> enable
> Switch# conf t
> Switch(config)# interface GigabitEthernet [numéro_interface]
> Switch(config-if)# switchport mode access
> Switch(config-if)# switchport port-security
> Switch(config-if)# switchport port-security mac-address sticky
> Switch(config-if)# ex
> Switch(config)# ex
> Switch# wr
**III. Règles de violation.**
Configurer la règle de violation.
| Règle | Description |
| -------- | -------- |
| shutdown | Désactive l’interface lorsqu’il y a violation |
| protect | l’adresse MAC inconnu est bloquée |
| restrict | Alerte SNMP est envoyé + MAC bloquée |
> Switch> enable
> Switch# conf t
> Switch(config)# interface GigabitEthernet [numéro_interface]
> Switch(config-if)# switchport mode access
> Switch(config-if)# switchport port-security
> Switch(config-if)# switchport port-security violation [règle_violation]
> Switch(config-if)# ex
> Switch(config)# ex
> Switch# wr
Spécifier le nombre de MAC associées à un port.
> Switch> enable
> Switch# conf t
> Switch(config)# interface GigabitEthernet [numéro_interface]
> Switch(config-if)# switchport port-security maximum [nombre_adresses]
> Switch(config-if)# ex
> Switch(config)# ex
> Switch# wr
Réactiver une interface.
> Switch> enable
> Switch# conf t
> Switch(config)# interface GigabitEthernet [numéro_interface]
> Switch(config-if)# shutdown
> Switch(config-if)# no shutdown
> Switch(config-if)# ex
> Switch(config)# ex
> Switch# wr
Supprimer la sécurisation de l’accès.
> Switch> enable
> Switch# conf t
> Switch(config)# interface GigabitEthernet [numéro_interface]
> Switch(config-if)# no switchport port-security
> Switch(config-if)# ex
> Switch(config)# ex
> Switch# wr
**IV. Commandes d'administration.**
Voir la politique de sécurité globale.
> Switch> enable
> Switch# show port-security
Voir la politique de sécurité appliquée à chaque port.
> Switch> enable
> Switch# show port-security address
Voir la politique de sécurité détaillé d’un port.
> Switch> enable
> Switch# show port-security address GigabitEthernet [numéro_interface]
## 7. Configuration du routage
**I. Objectif.**
Ce document a pour objectif de décrire les différents moyens afinde créer des routes static ou dynamique à l'aide du protocol RIP.
**II. Configuration de l'interface du routeur.**
Configuration d’une interface du routeur.
> Router> enable
> Router# conf t
> Router(config)# interface GigabitEthernet [numéro_interface]
> Router(config-if)# ip address [adresse_ip] [masque]
> Router(config-if)# no shutdown
> Router(config-if)# ex
> Router(config)# ex
> Router# wr
**III. Configuration d'une route static.**
Configuration d’une route static.
> Router> enable
> Router# conf t
> Router(config)# ip route [réseau_à_atteindre] [masque] [ip_interface]
> Router(config)# ex
> Router# wr
Visualiser les routes.
> Router> enable
> Router# show ip route
**IV. Configuration d'une route dynamique avec RIP.**
Configuration d’une route RIP.
> Router> enable
> Router# conf t
> Router(config)# router rip
> Router(config-router)# version 2
> Router(config-router)# network [IP_reseau]
> Router(config-router)# ex
> Router(config)# ex
> Router# wr