Gestionreseau Wiki
Advertisement

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
Screenshot

Configuration de base pour router :[]

  1. Router> enable
  2. Router# configure terminal
  3. Router (config)# no ip domain-lookup
  4. Router (config)# hostname <router name>
  5. R1 (config)# banner motd # --- Attention : prive, acces interdit ! --- #
  6. R1 (config)# line console 0
  7. R1 (config-line)# password <password1>
  8. R1 (config-line)# login
  9. R1 (config-line)# exit
  10. R1 (config)# line vty 0 4
  11. R1 (config-line)# password <password2>
  12. R1 (config-line)# login
  13. R1 (config-line)# exit
  14. R1 (config)# enable password <password3>
  15. R1 (config)# service password-encryption
  16. R1 (config)# exit
  17. R1# copy running-config startup-config
Screenshot

Pour un routeur ― configurer tous les interfaces à utiliser (on peut le faire aussi via tab :

  1. R1# configure terminal
  2. R1 (config)# interface fastEthernet 0/0
  3. R1 (config-if)# ip address 192.168.1.1 255.255.255.0
  4. R1 (config-if)# end
  5. R1# configure terminal

Pour un switch ― ajouter la configuration d'interface virtuelle :

  1. S1# configure terminal
  2. S1 (config)# interface vlan 1
  3. S1 (config-if)# ip address 192.168.1.254 255.255.255.0
  4. S1 (config-if)# no shutdown
  5. S1 (config-if)# exit
  6. S1 (config)# ip default-gateway 192.168.1.1

Attention ! Ne pas oublier de sauvgarder la configuration !

  1. 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
Screenshot

Configuration de SSH :[]

  1. S1# configure terminal
  2. S1 (config)# ip domain name <domain name>
  3. S1 (config)# ip ssh version 2
  4. S1 (config)# crypto key generate rsa
  5. S1 (config)# username <admin> password <password> <- ou username <admin> secret <password>
  6. S1 (config)# line vty 0 15
  7. S1 (config)# transport input ssh <- pour enable ssh (no transport input ssh pour desactiver)
  8. S1 (config)# login local
  9. S1 (config)# end
Advertisement