4 avr. 2013

Cisco: STP

Le but ici est de supprimer les boucles de couche 2 en desactivant certains ports.

Fichier a telecharger: stp_clean.pkt
Logiciel: packet tracer


  • Faire les vlan 10 (impair) et 20 (pair)
  • SW0 doit être Root Bridge pour le vlan 20
    SW1 doit être Root Bridge pour le vlan 10
  • Mettre en place portfast
  • Configurer le routeur en tant que server DHCP
  • Sécuriser les échanges (BPDUguard et Root Guard)
  • Port security => Restrict et 1 MAC apprise automatiquement
  • Configurer un acces Telnet Distant pour les Root bridge via les IP
    10.0.10.0/24
  • Faire du rapid STP































****************************************************
Correction
****************************************************

Spanning Tree est tres actif: ports oranges sur certains switchs.


0. Reinitialiser les switchs
----------------------------------------------

Switch[10-20;A-D]#delete flash:vlan.dat
        #erase start
        #reload

no ip domain-lookup
line console 0
loggin sync



1. Mettre en place vtp pour diffuser le vlan.dat
-----------------------------------------------------------------------------

Server
''''''''''''''''
Switch[10-20]#conf t
    (config)#vtp mode server
    (config)#vtp domain egilia
    (config)#vtp password learning


Client
'''''''''''''
Switch[A-D]#conf t
    (config)#vtp mode client
    (config)#vtp domain egilia
    (config)#vtp password learning



2. Show vtp status
----------------------------------------------

Switch[10-20]#show vtp status
    VTP Version                                       : 2
    Configuration Revision                      : 4
    Maximum VLANs supported locally : 255
    Number of existing VLANs                : 7
    VTP Operating Mode                         : Server
    VTP Domain Name                            : egilia
    VTP Pruning Mode                            : Disabled
    VTP V2 Mode                                    : Disabled
    VTP Traps Generation                       : Disabled
    MD5 digest                                        : 0xBE 0x09 0x8F 0x1E 0x3A 0x4E 0x88 0xDB
    Configuration last modified by 0.0.0.0 at 3-1-93 00:16:35
    Local updater ID is 0.0.0.0 (no valid interface found)

Switch[A-D]#show vtp status
    VTP Version                                       : 2
    Configuration Revision                      : 0
    Maximum VLANs supported locally : 255
    Number of existing VLANs               : 5
    VTP Operating Mode                         : Client
    VTP Domain Name                           : egilia
    VTP Pruning Mode                           : Disabled
    VTP V2 Mode                                  : Disabled
    VTP Traps Generation                      : Disabled
    MD5 digest                                       : 0x0A 0x3D 0x07 0x2F 0x3B 0xDF 0xC3 0x2A
    Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00


3. Creer les vlan
----------------------------------------------

Switch[10-20]
'''''''''''''''''''''''''''''
Switch(config)#vlan 10
    (config-vlan)#name IMPAIR
    (config-vlan)#vlan 20
    (config-vlan)#name PAIR
Switch#show vlan brief

    VLAN Name                             Status    Ports
    ---- -------------------------------- --------- -------------------------------
    1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4
                                                    Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                    Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                    Fa0/13, Fa0/14, Fa0/15, Fa0/16
                                                    Fa0/17, Fa0/18, Fa0/19, Fa0/20
                                                    Fa0/21, Fa0/22, Fa0/23, Fa0/24
                                                    Gig1/1, Gig1/2
    10   IMPAIR                           active   
    20   PAIR                                active   
    1002 fddi-default                    active   
    1003 token-ring-default          active
    1004 fddinet-default               active   
    1005 trnet-default                   active

remarque: configuration du VTP VLAN n'est pas authorise quand les switchs sont en mode CLIENT.


4. Lien trunk entre les switch
-------------------------------------------------

Switch[10-20]
''''''''''''''''''''''''''''
    (config)#int range f0/1-4
    (config-if-range)#switchport mode trunk


Switch[A,D]
'''''''''''''''''''''''''
    (config)#int range f0/1-2
    (config-if-range)#switchport mode trunk


Switch[B-C]
''''''''''''''''''''''''
    (config)#int range f0/1-4
    (config-if-range)#switchport mode trunk



5. Configurer les interfaces clients - se proteger contre BPDU
----------------------------------------------------------------------------------------------------

Switch[A,D]
'''''''''''''''''''''''''
    (config-if)#int f0/3
    (config-if)#switchport mode access
    (config-if)#switchport access vlan 10
    (config-if)#int f0/4
    (config-if)#switchport mode access
    (config-if)#switchport access vlan 20
   
    (config)#spanning-tree portfast default
  <== si boucle detecte sur le port client => shutdown
    (config)#int range f0/3-4
    (config-if-range)#spanning-tree bpduguard enable
    (config-if-range)#spanning-tree guard root


Switch[B-C]
'''''''''''''''''''''''''
    (config-if)#int f0/5
    (config-if)#switchport mode access
    (config-if)#switchport access vlan 10
    (config-if)#int f0/6
    (config-if)#switchport mode access
    (config-if)#switchport access vlan 20

    (config)#spanning-tree portfast default
    (config)#int range f0/5-6
    (config-if-range)#spanning-tree bpduguard enable
    (config-if-range)#spanning-tree guard root


Switch20
'''''''''''''''''''
    (config)#spanning-tree vlan 20 root primary
    (config)#spanning-tree vlan 20 priority 0
    (config)#spanning-tree vlan 10 root secondary
    (config)#spanning-tree vlan 10 priority 28672
<== multiple de 4092; valeur par defaut est 32768 (32768-4092=28672)

    (config)#interface f0/4
    (config-if)#spanning-tree portfast
<== a activer uniquement que sur les ports lies a un seul hote; la connection d'un hub/switch/bridge a ce port peut provoquer des loops, d'ou l'interet d'activer le bpduguard ==> port sera place en mode error disable state

Switch10
''''''''''''''''''''
    (config)#spanning-tree vlan 10 root primary
    (config)#spanning-tree vlan 10 priority 0
    (config)#spanning-tree vlan 20 root secondary
    (config)#spanning-tree vlan 20 priority 28672

    (config)#interface f0/4
    (config-if)#spanning-tree portfast



6. Show vlan
----------------------------

Switch[A,D]
'''''''''''''''''''''''''
Switch#show vlan brief
    VLAN Name                             Status    Ports
    ---- -------------------------------- --------- -------------------------------
    10   IMPAIR                             active    Fa0/3
    20   PAIR                                  active    Fa0/4

Switch[B-C]
''''''''''''''''''''''''
Switch#show vlan brief
    VLAN Name                             Status    Ports
    ---- -------------------------------- --------- -------------------------------
    10   IMPAIR                            active    Fa0/5
    20   PAIR                                 active    Fa0/6



7. Show spanning tree vlan 20
----------------------------------------------

Switch20#sho spanning-tree vlan 20
VLAN0020
  Spanning tree enabled protocol ieee
  Root ID    Priority    20
             Address     00D0.FF1A.CCE6
             This bridge is the root
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    20  (priority 0 sys-id-ext 20)
             Address     00D0.FF1A.CCE6
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1            Desg FWD 19        128.1    P2p
Fa0/2            Desg FWD 19        128.2    P2p
Fa0/3            Desg FWD 19        128.3    P2p

Switch10#show spanning-tree vlan 20
VLAN0020
  Spanning tree enabled protocol ieee
  Root ID    Priority    20
             Address     00D0.FF1A.CCE6
             Cost        19
             Port        3(FastEthernet0/3)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    28692  (priority 28672 sys-id-ext 20)
             Address     000C.CF5E.BD7C
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1            Altn BLK 19        128.1    P2p
Fa0/2            Desg FWD 19        128.2    P2p
Fa0/3            Root FWD 19        128.3    P2p

SwitchA#sho spanning-tree vlan 20
VLAN0020
  Spanning tree enabled protocol ieee
  Root ID    Priority    20
             Address     00D0.FF1A.CCE6
             Cost        19
             Port        2(FastEthernet0/2)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32788  (priority 32768 sys-id-ext 20)
             Address     0001.97ED.D454
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1            Altn BLK 19        128.1    P2p
Fa0/2            Root FWD 19      128.2    P2p
Fa0/4            Desg FWD 19      128.4    P2p



8. Configurer le router
----------------------------------------------

Router(config)#int range f0/0-1
Router(config-if-range)#no shutdown
Router(config-if-range)#no ip address

Router(config)#int f0/0.20
    (config-subif)#encapsulation dot1Q 20
    (config-subif)#ip address 10.0.20.254 255.255.255.0
    (config-subif)#no shutdown

Router(config)#int f0/0.10
    (config-subif)#encapsulation dot1Q 10
    (config-subif)#ip address 10.0.10.254 255.255.255.0
    (config-subif)#no shutdown

Router(config-subif)#int f0/1.20
    (config-subif)#encapsulation dot1Q 20
    (config-subif)#ip address 192.168.20.254 255.255.255.0
    (config-subif)#no shutdown

Router(config-subif)#int f0/1.10
    (config-subif)#encapsulation dot1Q 10
    (config-subif)#ip address 192.168.10.254 255.255.255.0
    (config-subif)#no shutdown



9. Access a telnet
----------------------------------------------

Router(config)#line vty 0 4
Router(config-line)#login
Router(config-line)#password learning



10. Mise en place de la non negociate - pour supprimer les DTP (Dynamic trunking protocol)
---------------------------------------------------------------------------------------------------------------------------------------------

Switch[A,D]
'''''''''''''''''''''''''
    (config)# int range f0/3, f0/4
    (config-if-range)#switchport nonegotiate
    (config-if-range)#switchport port-security maximum 1
    (config-if-range)#switchport port-security violation shutdown
    (config-if-range)#switchport port-security mac-address stick


Switch[B,C]
''''''''''''''''''''''''
    (config)# int range f0/5, f0/6
    (config-if-range)#switchport nonegotiate
    (config-if-range)#switchport port-security maximum 1
    (config-if-range)#switchport port-security violation shutdown
    (config-if-range)#switchport port-security mac-address stick



11. Mise en place de dhcp
----------------------------------------------

Router(config)#ip dhcp pool LAN20
    (dhcp-config)#network 10.0.20.0 255.255.255.0
    (dhcp-config)#default-router 10.0.20.254
    (dhcp-config)#dns-server 8.8.8.8

Router(config)#ip dchp pool LAN10
    (dhcp-config)#network 10.0.10.0 255.255.255.0
    (dhcp-config)#default-router 10.0.10.254
    (dhcp-config)#dns-server 8.8.8.8



12. Mise en place du rapid-spanning tree partout
-------------------------------------------------------------------------------

Convergence STP est lent. RSTP a ete cree pour palier a cette lenteur.

Switch_X(config)# spanning-tree mode rapid-pvst

Note1: PVST, Per VLAN Spanning Tree.
Note2: aucune frame ne peut etre envoyee tant que la convergence n'est pas terminee.

Fichier contenant la correction a telecharger: stp_correction.pkt

Aucun commentaire:

Enregistrer un commentaire