Étape 1 : Configurer R1
Désactiver la recherche DNS :
arduino
Copier le code
R1(config)# no ip domain-lookup
Nom de l’hôte :
arduino
Copier le code
R1(config)# hostname R1
R1(config)# banner motd #Bienvenue sur R1#
R1(config)# line console 0
R1(config-line)# password ciscopass
R1(config-line)# login
R1(config)# username admin privilege 15 secret adminpass
R1(config)# line vty 0 4
R1(config-line)# password ciscopass
R1(config-line)# login
R1(config)# security passwords min-length 10
R1(config)# interface g0/0/1
R1(config-if)# description Lien-IPv6R1(config-if)# ipv6 address fe80::1 link-local
R1(config)# interface loopback 0
R1(config-if)# ipv6 address fe80::1 link-local
Étape 2 : Configurer S1 et S2
Désactiver la recherche DNS :
switch base
S1(config)# no ip domain-lookup
S1(config)# hostname S1
S1(config)# banner motd #Bienvenue sur S1#
S1(config)# line console 0
S1(config-line)# password ciscopass
S1(config-line)# login
S1(config)# username admin privilege 15 secret adminpass
S1(config)# line vty 0 4
S1(config-line)# password ciscopass
S1(config-line)# login
S1(config)# ip domain-name [Link]
S1(config)# crypto key generate rsa
S1(config)# line vty 0 4
S1(config-line)# transport input ssh
S1(config)# vlan 2
S1(config-vlan)# name nom_de_visiteurs
S1(config-vlan)# exit
S1(config)# vlan 3
S1(config-vlan)# name nom_de_trikes
S1(config-vlan)# exit
S1(config)# vlan 4
S1(config-vlan)# name nom_de_gestion
S1(config-vlan)# exit
Créer des trunks 802.1Q qui utilisent le VLAN natif :
S1(config)# interface range f0/1 - 2
S1(config-if-range)# switchport mode trunk
S1(config-if-range)# switchport trunk native vlan 1
S1(config-if-range)# switchport trunk allowed vlan 2,3,4
Créer un groupe de ports EtherChannel avec le protocole LACP :
S1(config)# interface range f0/1 - 2
S1(config-if-range)# channel-group 1 mode active
S1(config-if-range)# exit
S1(config)# interface port-channel 1
S1(config-if)# switchport mode trunk
S2(config)# vlan 2
S2(config-vlan)# name nom_de_visiteurs
S2(config-vlan)# exit
S2(config)# vlan 3
S2(config-vlan)# name nom_de_trikes
S2(config-vlan)# exit
S2(config)# vlan 4
S2(config-vlan)# name nom_de_parking
S2(config-vlan)# exit
Créer des trunks 802.1Q qui utilisent le VLAN natif :
S2(config)# interface range f0/1 - 2
S2(config-if-range)# switchport mode trunk
S2(config-if-range)# switchport trunk native vlan 1
S2(config-if-range)# switchport trunk allowed vlan 2,3,4
Créer un groupe de ports EtherChannel avec LACP :
S2(config)# interface range f0/1 - 2
S2(config-if-range)# channel-group 1 mode active
S2(config-if-range)# exit
S2(config)# interface port-channel 1
S2(config-if)# switchport mode trunk
Configurer le port d’accès pour le VLAN 3 :
S2(config)# interface f0/18
S2(config-if)# switchport mode access
S2(config-if)# switchport access vlan 3
R1(config)# ip dhcp pool VLAN2
R1(dhcp-config)# network
R1(dhcp-config)# default-router
R1(dhcp-config)# dns-server
R1(dhcp-config)# exit
R1(config)# ip dhcp pool VLAN2
R1(dhcp-config)# network [Link] [Link]
R1(dhcp-config)# default-router [Link]
R1(dhcp-config)# dns-server [Link]
R1(dhcp-config)# exit
Exclure les 10 dernières adresses de l'attribution automatique :
R1(config)# ip dhcp excluded-address [Link] [Link]
scss
Copier le code
R1(config)# ip dhcp pool VLAN3
R1(dhcp-config)# network [Link] [Link]
R1(dhcp-config)# default-router [Link]
R1(dhcp-config)# dns-server [Link]
R1(dhcp-config)# exit
Exclure les 10 dernières adresses de l'attribution automatique :
R1(config)# ip dhcp excluded-address [Link] [Link]
Copier le code
ipconfig /all
Cela affichera les adresses assignées par le serveur DHCP, y compris GUA (Global
Unicast Address) et Link-Local.
R1(config)# access-list 10 permit [Link] [Link]
Exemple 2 : Bloquer un hôte spécifique
Objectif : Bloquer l’hôte [Link] et permettre le reste du réseau.
Configuration :
arduino
Copier le code
R1(config)# access-list 10 deny [Link]
R1(config)# access-list 10 permit any
Appliquer une ACL Standard à une interface
Appliquer une ACL à l’interface pour contrôler le trafic entrant ou sortant.
arduino
Copier le code
R1(config)# interface g0/0
R1(config-if)# ip access-group 10 in
2. Configuration des ACL Étendues
Les ACL étendues permettent de filtrer le trafic en fonction de plusieurs
critères : adresse source, adresse destination, protocoles, et ports.
Exemple 1 : Autoriser le trafic HTTP d’un réseau vers un serveur
Objectif : Autoriser le réseau [Link]/24 à accéder au serveur [Link]
uniquement via HTTP (port 80).
R1(config)# access-list 100 permit tcp [Link] [Link] host [Link] eq 80
Exemple 2 : Bloquer le trafic ICMP (ping) d’un réseau vers une destination
Objectif : Bloquer le réseau [Link]/24 d’envoyer des requêtes ICMP à
[Link]/24.
Configuration :
arduino
Copier le code
R1(config)# access-list 100 deny icmp [Link] [Link] [Link] [Link]
R1(config)# access-list 100 permit ip any any
Exemple 3 : Autoriser le trafic FTP (port 21) et SSH (port 22) vers un serveur
spécifique
Objectif : Permettre au réseau [Link]/24 d’accéder au serveur [Link] via FTP
et SSH.
R1(config)# access-list 100 permit tcp [Link] [Link] host [Link] eq 21
R1(config)# access-list 100 permit tcp [Link] [Link] host [Link] eq 22
Appliquer une ACL Étendue à une interface
Appliquer une ACL à l’interface :
arduino
Copier le code
R1(config)# interface g0/1
R1(config-if)# ip access-group 100 in
R1# show access-lists
Vérifier les ACL appliquées sur une interface :
Copier le code
R1# show ip interface g0/0