Accéder au contenu principal

Les commandes de base des switchs


Commandes
enable
o Depuis le mode utilisateur permet d'accéder au mode privilégié.
configure terminal
o Depuis le mode privilégié permet d'accéder au mode de configuration globale.
show version
o Permet de vérifier la version de l'IOS et la valeur du registre de configuration.
show running-config
o Permet d'afficher le fichier de configuration actif.
show interface FastEthernet [numéro de l'interface]
o Affiche le statut de l'interface, le débit, l'auto négociation et les statistiques de l'interface.
show ip interface brief
o Voir tous les ports du Switch
show flash ou dir:flash
o Affiche la version de l'image de l'IOS contenue dans la mémoire flash, la taille de la mémoire et la
mémoire utilisée. 


show interface status
o Affiche le mode opérationnel du port.
show controllers ethernet-controller
o Affiche les statistiques sur les données reçues et envoyées au niveau matériel. 
show post
o Indique si le routeur a effectué le POST.
reload
o Redémarre le commutateur.
erase startup-config
o Efface le fichier de configuration de sauvegarde.
delete flash:vlan.dat
o Supprime la base de donnée de VLAN. Sûr les Catalyst 1900 c'est la commande delete nvram qui
est employée.
show mac-address-table
o Permet d'afficher les adresses MAC apprises par le commutateur.
clear mac-address-table
o Permet d'effacer les entrées de tables configurées par l'administrateur.
mac-address table static [adresse MAC de l'hôte] interface Fast Ethernet [numéro de l'interface]
vlan [numéro du vlan]
o Permet d'attribuer une adresse MAC statique à une interface.
show port security
o Permet de vérifier le statut de sécurité appliqué aux ports.
interface [type] [numéro/sous numéro]
o Permet de passer dans le mode configuration de l'interface.
interface range [type] [numéro/premier numéro – dernier numéro]
o Permet de passer dans le mode de configuration de plusieurs interfaces.

 Configuration du nom du switch, du domaine DNS, puis enregistrement de la configuration.

Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#
Switch(config)#hostname 2960-RG
2960-RG(config)#ip domain-name mondomaine.local
2960-RG(config)#end
2960-RG#wr
Building configuration...
[OK]
2960-RG#


Pour supprimer le nom du commutateur et le nom de domaine, il faut saisir les commandes suivantes

2960-RG(config)#no hostname
Switch(config)#no ip domain-name
Switch(config)#

Adressage IP du switch:
2960-RG(config)#vlan 2
2960-RG(config-vlan)#exit
2960-RG(config)#interface vlan2
2960-RG(config-if)#ip address 192.168.100.25 255.255.255.0
2960-RG(config-if)#ex
2960-RG(config)#ip default-gateway 192.168.100.1


Vérification de la configuration du vlan d'administration

2960-RG#sh run int vlan2
Building configuration...

Current configuration : 64 bytes

!
interface Vlan2
ip address 192.168.100.25 255.255.255.0
end


Suppression de l'adresse IP et de la passerelle par défaut

2960-RG(config)#interface vlan2
2960-RG(config-if)#no ip address
2960-RG(config-if)#ex
2960-RG(config)#no ip default-gateway



Ajout de mot de passe pour l'authentification
Switch(config)#service password-encryption

Création des mots de passe et configuration de la console et des lignes virtuelles.
2960-RG(config)#enable secret M02p@55
2960-RG(config)#line con 0
2960-RG(config-line)#password P@55w0rd
2960-RG(config-line)#login
2960-RG(config-line)#exit
2960-RG(config)#line vty 0 15
2960-RG(config-line)#password P@55w0rd
2960-RG(config-line)#login
2960-RG(config-line)#end
2960-RG#


Configuration et affichage de l'heure
switch#clock set 16:20:05 6 april 2014
switch#
switch#show clock
16:20:05.609 CEST Mon Apr 6 2014
switch#

Commentaires

Posts les plus consultés de ce blog

cPanel DDOS attack - Mitigate Slowloris Attacks - mod_qos

Apache mod_evasive Mod_evasive is a module available for the Apache HTTP server that can automatically block attacks by rate-limiting any IP that sends too many requests in a short time. Start by installing the module from WHM’s  EasyApache 4  interface. Select the  Currently Installed Packages  profile, search for  mod_evasive  in the  Apache Modules  section, and then install it. The default settings are good for most servers, but you can tweak them further by editing the configuration file  /etc/apache2/conf.d/300-mod_evasive.conf . You can also whitelist specific IP addresses or classes, so legitimate requests are not blocked. Configure CSF to block attacks While  mod_evasive  works very well, it only protects the Apache webserver. In order to harden other services as well, you can install the free  ConfigServer Security & Firewall  (CSF), which also includes a WHM plugin. As the  root  user, install CSF with these terminal commands: cd /usr/src rm -fv csf.tgz wget https://down

Spool file is locked (another process is handling this message)

LOG: MAIN cwd=/usr/local/cpanel/whostmgr/docroot 4 args: /usr/sbin/exim -v -Mrm 1dUoey-0006YJ-3A Message 1dUoey-0006YJ-3A is locked LOG: skip_delivery MAIN Spool file is locked (another process is handling this message) To do this you can run the following commands. |exim -Mt 1dUoey-0006YJ-3A |exim -Mrm 1dUoey-0006YJ-3A I am also providing the following page in case you want more information regarding the exim command options. http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html

Open Media Vault NAS change password

Known Root Password Login to the OMV using the root user and the current password via SSH or Console enter the following command passwd root The new password is now active. Unknown Root Password, but Admin Access to OMV GUI is Available In this scenario we still can help ourselves with the GUI. The method we use is, that we create a cron job for the root user which then resets the password. Navigate to System -> Cron Jobs Press the +Add button UN-tick the enabled box, so that the cronjob does not run automatically. put into the command field the following line, replace newpasswd with your password: echo "root:newpasswd" | chpasswd press okay select the newly created cron job Click the run button. in the opening window click the start button. It will shortly deactivate and activate again. open ssh or console and login as root with your new password. Root and Admin Password Unknown If you do not know the root password, you need to boot with a Li