Exercice : Configuration de base pour un routeur et un switch[]
Tableau d'adressage pour l'exercice :[]
Nom du
peripherique |
Interface | IP | Mask | Passerelle |
---|---|---|---|---|
R1 / Router | Fa 0/0 | 192.168.1.1 | 255.255.255.0 | ― |
S1 / Switch | Vlan1 | 192.168.1.2 | 255.255.255.0 | 192.168.1.1 |
PC1 | Carte reseau / Fa 0/10 | 192.168.1.100 | 255.255.255.0 | 192.168.1.1 |
PC2 | Carte reseau / Fa 0/11 | 192.168.1.101 | 255.255.255.0 | 192.168.1.1 |
PC3 | Carte reseau / Fa 0/12 | 192.168.1.102 | 255.255.255.0 | 192.168.1.1 |
Configuration de base pour router :[]
- Router> enable
- Router# configure terminal
- Router (config)# no ip domain-lookup
- Router (config)# hostname <router name>
- R1 (config)# banner motd # --- Attention : prive, acces interdit ! --- #
- R1 (config)# line console 0
- R1 (config-line)# password <password1>
- R1 (config-line)# login
- R1 (config-line)# exit
- R1 (config)# line vty 0 4
- R1 (config-line)# password <password2>
- R1 (config-line)# login
- R1 (config-line)# exit
- R1 (config)# enable password <password3>
- R1 (config)# service password-encryption
- R1 (config)# exit
- R1# copy running-config startup-config
Pour un routeur ― configurer tous les interfaces à utiliser (on peut le faire aussi via tab :
- R1# configure terminal
- R1 (config)# interface fastEthernet 0/0
- R1 (config-if)# ip address 192.168.1.1 255.255.255.0
- R1 (config-if)# end
- R1# configure terminal
Pour un switch ― ajouter la configuration d'interface virtuelle :
- S1# configure terminal
- S1 (config)# interface vlan 1
- S1 (config-if)# ip address 192.168.1.254 255.255.255.0
- S1 (config-if)# no shutdown
- S1 (config-if)# exit
- S1 (config)# ip default-gateway 192.168.1.1
Attention ! Ne pas oublier de sauvgarder la configuration !
- R1# copy running-config startup-config
Note ! Les deux commandes font la même chose, mais Cisco recommende d'utiliser « copy » plutôt que « write » :
copy running-config startup -config = write memory
Template : configuration de base pour router et switch (copier / coller) :[]
enable
configure terminal
no ip domain-lookup
banner motd # --- Attention : prive, acces interdit ! --- #
line console 0
password class
login
exit
line vty 0 4
password class
login
line vty 5 15
password class
login
exit
enable secret cisco
service password-encryption
hostname
Configuration de SSH :[]
- S1# configure terminal
- S1 (config)# ip domain name <domain name>
- S1 (config)# ip ssh version 2
- S1 (config)# crypto key generate rsa
- S1 (config)# username <admin> password <password> <- ou username <admin> secret <password>
- S1 (config)# line vty 0 15
- S1 (config)# transport input ssh <- pour enable ssh (no transport input ssh pour desactiver)
- S1 (config)# login local
- S1 (config)# end