Configuration Basique des Switch

hostname

Switch#conf
Switch(config)#hostname SW1
SW1(config)#

logs

SW1(config)#service sequence-numbers
SW1(config)#end
000068: %SYS-5-CONFIG_I: Configured from console by console

SW1(config)#service timestamps log
SW1(config)#end
000069: 02:20:27: %SYS-5-CONFIG_I: Configured from console by console

SW1(config)#service timestamps log datetime msec localtime
SW1(config)#end
000073: *Mar  1 02:25:49.851 UTC: %SYS-5-CONFIG_I: Configured from console by console

Syslog

SW1(config)#logging 10.1.1.30
SW1(config)#logging facility local4

Clock

SW1#clock set 14:56:00 23 March 2012
SW1#show clock
14:56:12.011 UTC Fri Mar 23 2012

ntp

SW1(config)#ntp server 10.1.1.10

Dns

SW1(config)#ip domain-name test.local
SW1(config)#ip name-server 10.1.1.10

Sans Dns

SW1(config)#no ip domain-lookup

Résolution local (/etc/host)

SW1(config)#ip host MY-SERVER 10.1.1.10

Banner

SW1(config)#banner motd X
Enter TEXT message.  End with the character 'X'.
Voici mon message d'acceuil ....
       .... Welcome !!!!

X

Snmp

SW1#conf t
SW1(config)#snmp-server host 10.1.1.10 version 2c cisco
SW1(config)#snmp-server community TEST-RO ro
SW1(config)#snmp-server community TEST-RW rw

SW1(config)#snmp-server location PARIS
SW1(config)#snmp-server contact Fred J.

Snmp Traps

SW1(config)#snmp-server host 10.1.1.10 traps version 2c cisco
SW1(config)#snmp-server enable traps ?
  bgp               Enable BGP traps
  bridge            Enable SNMP STP Bridge MIB traps
  bulkstat          Enable Data-Collection-MIB Collection notifications
  cef               Enable SNMP CEF traps
  cluster           Enable Cluster traps
  config            Enable SNMP config traps
  config-copy       Enable SNMP config-copy traps
  config-ctid       Enable SNMP config-ctid traps
  copy-config       Enable SNMP config-copy traps
  cpu               Allow cpu related traps
  eigrp             Enable SNMP EIGRP traps
  entity            Enable SNMP entity traps
  envmon            Enable SNMP environmental monitor traps
  errdisable        Enable SNMP errdisable notifications
  flash             Enable SNMP FLASH notifications
  hsrp              Enable SNMP HSRP traps
  ipmulticast       Enable SNMP ipmulticast traps
  ipsec             Enable IPsec traps
  isakmp            Enable ISAKMP traps traps
  mac-notification  Enable SNMP MAC Notification traps
  msdp              Enable SNMP MSDP traps
  ospf              Enable OSPF traps
  pim               Enable SNMP PIM traps
  port-security     Enable SNMP port security traps
  power-ethernet    Enable SNMP power ethernet traps
  rtr               Enable SNMP Response Time Reporter traps
  snmp              Enable SNMP traps
  storm-control     Enable SNMP storm-control trap parameters
  stpx              Enable SNMP STPX MIB traps
  syslog            Enable SNMP syslog traps
  transceiver       Enable SNMP transceiver traps
  tty               Enable TCP connection traps
  vlan-membership   Enable SNMP VLAN membership traps
  vlancreate        Enable SNMP VLAN created traps
  vlandelete        Enable SNMP VLAN deleted traps
  vtp               Enable SNMP VTP traps

Snmp Traps – Exemple d’envoi de traps toute les 30 second lors de l’apprentissage des MAC adresses sur l’interface fa0/10

SW1#conf t
SW1(config)#snmp-server host 192.168.1.1 traps private
SW1(config)#snmp-server enable traps mac-notification
SW1(config)#
SW1(config)#mac address-table notification change interval 30
SW1(config)#mac address-table notification change history-size 200

SW1(config)#int fa0/10
SW1(config-if)#snmp trap mac-notification added
SW1(config-if)#snmp trap mac-notification removed
SW1#show mac address-table notification change interface fa0/10

MAC Notification Feature is Enabled on the switch
Interface            MAC Added Trap MAC Removed Trap
---------            -------------- ----------------
FastEthernet0/10     Enabled        Enabled

Storm-control – limitation du trafic broadcast, multicast ou unicast

SW1#conf t
SW1(config)#int fastEthernet 0/10
SW1(config-if)#storm-control broadcast level 10
SW1(config-if)#storm-control multicast level 10
SW1(config-if)#storm-control unicast level 50

SW1(config-if)#storm-control action ?
  shutdown  Shutdown this interface if a storm occurs
  trap      Send SNMP trap if a storm occurs
SW1#show storm-control
Interface  Filter State   Upper        Lower        Current
---------  -------------  -----------  -----------  ----------
Fa0/10     Link Down        10.00%       10.00%        0.00%
Fa0/18     Forwarding       50.00%       50.00%        0.00%

mac address-table aging-time
SW1(config)#mac address-table aging-time 180
SW1(config)#mac address-table aging-time 60 vlan 100
SW1(config)#mac address-table aging-time 300 vlan 200

SW1#show mac address-table aging-time
Global Aging Time:  180
Vlan    Aging Time
----    ----------
 200     300
 100      60

Erase configuration

Par défaut, le répertoire de travail est le système de fichier flash:

SW1#pwd
flash:/

SW1#dir
Directory of flash:/

    2  -rwx     9707290   Mar 1 1993 20:53:40 +00:00  c3550-ipservicesk9-mz.122-44.SE6.bin
    3  -rwx        1932   Mar 1 1993 00:01:00 +00:00  private-config.text
    4  -rwx        4120   Mar 1 1993 00:01:00 +00:00  multiple-fs
    6  -rwx        4844   Mar 1 1993 00:01:00 +00:00  config.text
    7  -rwx          18   Mar 1 1993 00:01:49 +00:00  env_vars
    8  -rwx           0   Mar 1 1993 00:01:49 +00:00  system_env_vars
    9  -rwx         804  Mar 24 2012 03:46:30 +00:00  vlan.dat

15998976 bytes total (6277120 bytes free)

Suppression de la configuration et de la base des VLANs

SW1#delete config.text
Delete filename [config.text]?
Delete flash:/config.text? [confirm]

SW1#delete vlan.dat
Delete filename [vlan.dat]?
Delete flash:/vlan.dat? [confirm]

SW1#reload
Proceed with reload? [confirm]
This entry was posted in L2 Bridging & Switching. Bookmark the permalink.

Comments are closed.