Configuration des switchs Cisco
un switch a cinq type de port au minimumm:
port ethernet pour pc, port gigabit pour routeur et autre switch,port console,port electrique et les
led
nb:pour le premier demarage connecter le cable console et lancer le programme terminal avant de
brancher le cable electrique
Il y a trois techniques pour se connecter à un switch : par Telnet (ssh), par web, ou par
Port serie (connexion "console"). La méthode à utiliser lors d'une première connexion en vue
de configuration, ou bien en cas de dépannage ou de reconfiguration, est celle de la
connexion en mode
console.
Nb : En port serie Il s'agit de connecter un câble série (bleu) du port console du switch à un
des ports "COM" d'un PC muni d’un émulateur terminal.
En connexion ssh il faut avoir accees au reseau local et avoir un logiciel client ssh
1) mode utilisateur
Commandes utilisé:
connect Open a terminal connection
disable Turn off privileged commands
disconnect Disconnect an existing network connection
enable Turn on privileged commands
exit Exit from the EXEC
logout Exit from the EXEC
ping Send echo messages
resume Resume an active network connection
show Show running system information
telnet Open a telnet connection
terminal Set terminal line parameters
traceroute Trace route to destination
2) mode administrateur
les commande a utiliser:
clear Reset functions
clock Manage the system clock
configure Enter configuration mode
connect Open a terminal connection
copy Copy from one file to another
debug Debugging functions (see also 'undebug')
delete Delete a file
dir List files on a filesystem
disable Turn off privileged commands
disconnect Disconnect an existing network connection
enable Turn on privileged commands
erase Erase a filesystem
exit Exit from the EXEC
logout Exit from the EXEC
more Display the contents of a file
no Disable debugging informations
ping Send echo messages
reload Halt and perform a cold restart
resume Resume an active network connection
setup Run the SETUP command facility
show Show running system information
ssh Open a secure shell client connection
telnet Open a telnet connection
terminal Set terminal line parameters
traceroute Trace route to destination
undebug Disable debugging functions (see also 'debug')
vlan Configure VLAN parameters
write Write running configuration to memory, network, or terminal
nb : soyez conscient lorsque vous êtes en mode administration car une erreur peut rendre tout le
réseau indisponible ou vulnérable
a) Donner un nom au switch pour le distinguer aux autres
Commande hostname nomswitch
b) Verrifier l’etat des ports
Commande show interface status en mode privilegier
On aura :
Type et Nom Le Le type MDX debit vitesse Temps de Type Nbre de
numero du status et connexion cable paquet(E
port port du numero et S)
port vlan
c) Nommer les ports
Commande : description nompc
d) Pour voir la configuration du switch
Commande : show running –config
e) Pour enregistrer la configuration
Copy running config startup config
F) configurer l’adresse ip pour le switch
Sur l’interface vlan1 taper :
Ip address ad /mask
No shutdown pour activer les ports
f) Configurer un nom de domain pour pouvoir activer une cle ssh
Commande : ip domain –name reseau .bf
g) Generer une cle ssh pour cryper votre communication
Commande crypto key generate rsa
h) Configurer un nom et un mdp
Commande : username nom password mdp
i) Permettre au switch d’etre connecter l’exterieur
Commande : line vty 0 15( transport imput ssh/output ssh)
Résumer des commandes étape par étape pour configurer un switch
Enable
Configure terminal
Hostname NOM_SWITCH
Show running –config
Conf t
Line vty 0 4
Password MOTDEPASSE
Interface vlan 1
IP address ad /mask
No shutdown
Line vty 0 15(transport imput ssh/output ssh)
Username nom password mdp
IP Domain –Name réseau .bf
Crypto key generate rsa
Show interface status
Copy running config startup config
Show vlan
Conf t
Vlan (numerovlan) name (nomvlan)
Exit
Conf t
interface FastEthernet 0/numeroport
switchport mode access
# switchport access vlan numerovlan
End
config t
interface FastEthernet 0/numeroport
switchport mode trunk
show interface trunk
switchport trunk allowed vlan add (numero de vlan autoriser)
switchport trunk encapsulation dot1q
exercice 1 commande de base
Switch>ena
Switch#conf t
Switch(config)#hostname s1
no ip domain -lookup
s1(config)#line vty 0 4
s1(config-line)#password boukes
(config)#line vty 0 15
s1(config-line)#Password boukson
s1(config-line)#transport input ssh
s1(config-line)#transport output ssh
s1(config-line)#login local
s1(config)#interface vlan1
s1(config-if)#ip address 10.10.1.1 255.0.0.0
s1(config)#ip domain-name boukare.bf
s1(config-if)#no shutdown
crypto key generate rsa
How many bits in the modulus [512]: 1024
s1(config)#username boubacar password moi
copy running-config startup-config