venerdì 23 novembre 2012

SWITCH PROFILE

SWITCH PROFILE

 

Prerequisites for Switch Profiles

Switch profiles have the following prerequisites:

·         You must enable CFSoIP distribution over mgmt0 on both switches by entering the cfs ipv4 distribute command.

·         You must configure a switch profile with the same name on both peer-switches by entering the config sync and switch-profile commands.

·         Configure each switch as peer switch by entering the sync-peers destination command

 

Adding or Modifying Switch Profile Commands

To modify a command in a switch profile, add the modified command to the switch profile and enter the commit command to apply the command and synchronize the switch profile to the peer switch if it is reachable.

Follow these guidelines when adding or modifying switch profile commands:

·         Commands that are added or modified are buffered until you enter the commit command.

·         Commands are executed in the same order in which they are buffered

 

SUMMARY STEPS

1. config sync

2. switch-profile name

3. command arugument

4. (Optional) show switch-profile name buffer

5. verify

6. commit

7. (Optional) show switch-profile name status

8. exit

9. (Optional) copy running-config startup-config



DETAILED STEPS

Command or Action

Purpose

Step 1

config sync


Example:

switch# config sync

switch(config-sync)#

Enters configuration synchronization mode.

Step 2

switch-profile name


Example:

switch(config-sync)# switch-profile abc

switch(config-sync-sp)#

Configures the switch profile, names the switch profile, and enters switch profile synchronization configuration mode.

Step 3

command arugument


Example:

switch(config-sync-sp)# interface Port-channel100

switch(config-sync-sp-if)# speed 1000

switch(config-sync-sp-if)# interface Ethernet1/1

switch(config-sync-sp-if)# speed 1000

switch(config-sync-sp-if)# channel-group 100

Adds a command to the switch profile.

Step 4

show switch-profile name buffer


Example:

switch(config-sync-sp)# show switch-profile abc buffer

switch(config-sync-sp)#

(Optional)

Displays the configuration commands in the switch profile buffer.

Step 5

verify


Example:

switch(config-sync-sp)# verify

Verifies the commands in the switch profile buffer.

Step 6

commit


Example:

switch(config-sync-sp)# commit

Saves the commands in the switch profile and synchronizes the configuration with the peer switch.

Step 7

show switch-profile name status


Example:

switch(config-sync-sp)# show switch-profile abc status

switch(config-sync-sp)#

(Optional)

Displays the status of the switch profile on the local switch and the status on the peer switch.

Step 8

exit


Example:

switch(config-sync-sp)# exit

switch#

Exits the switch profile configuration mode.

Step 9

copy running-config startup-config


Example:

switch# copy running-config startup-config

(Optional)

Copies the running configuration to the startup configuration.

 

 

The following example shows how to create a switch profile, configure a peer switch, and add commands to the switch profile.

 

 

switch# configuration terminal

switch(config)# cfs ipv4 distribute

switch(config-sync)# switch-profile abc

switch(config-sync-sp)# sync-peers destination 10.1.1.1

switch(config-sync-sp)# interface port-channel100

switch(config-sync-sp-if)# speed 1000

switch(config-sync-sp-if)# interface Ethernet1/1

switch(config-sync-sp-if)# speed 1000

switch(config-sync-sp-if)# channel-group 100

switch(config-sync-sp)# verify

switch(config-sync-sp)# commit

switch(config-sync-sp)# exit

switch#

 

The following example shows an existing configuration with a defined switch profile. The second example shows how the switch profile command changed by adding the modified command to the switch profile.

 

switch# show running-config

switch-profile abc

  interface Ethernet1/1

    switchport mode trunk

    switchport trunk allowed vlan 1-10

 

Switch# config sync

Switch(config-sync)# switch-profile abc

Switch(config-sync-sp)# interface Ethernet1/1

Switch(config-sync-sp-if)# switchport trunk allowed vlan 5-10

Switch(config-sync-sp-if)# commit

 

Switch# show running-config

switch-profile abc

  interface Ethernet1/1

    switchport mode trunk

    switchport trunk allowed vlan 5-10

 

 

 

 

 

 

 

 

 

 

 

 

WALBOB-BNL-DAT01(config)# configure ?

  <CR>     

  session   Configure the system in a session

  sync      Configure the system in config-sync mode

  terminal  Configure the system from terminal input

 

WALBOB-BNL-DAT01(config)# configure sync

WALBOB-BNL-DAT01(config-sync)#

 

 

WALBOB-BNL-DAT01(config-sync)# ?

  no               Negate a command or set its defaults

  resync-database  Re-synchronize switch-profile database

  switch-profile   Enter switch-profile configuration mode

  end              Go to exec mode

  exit              Exit from command interpreter

  pop              Pop mode from stack or restore from name

  push            Push current mode to stack or save it under name

  where         Shows the cli context you are in

 

WALBOB-BNL-DAT01(config-sync)# switch-profile ?

  WORD  Enter the name of the switch-profile (Max Size 64)

 

WALBOB-BNL-DAT01(config-sync)# switch-profile 5KSync

Switch-Profile started, Profile ID is 1

 

WALBOB-BNL-DAT01(config-sync-sp)# ?

  buffer-delete  Delete buffered command(s)

  buffer-move    Move buffered command(s)

  cdp                    Configure CDP parameters

  class-map         Configure a class map

  commit             Commit the current configuration session

  feature             Command to enable/disable features

  import              Import

  interface          Configure interfaces

  ip                       Configure IP features

  ipv6                  Configure IPv6 features

  lacp                  Configure LACP parameters

  logging            Modify message logging facilities

  mac                  MAC configuration commands

  mac                  MAC

  no                    Negate a command or set its defaults

  policy-map     Configure a policy map

  port-channel   Configure port channel parameters

  port-profile      Configure a port-profile

  resequence     Resequence a list with sequence numbers

  slot                   Configure a slot

  spanning-tree  Spanning Tree Subsystem

  sync-peers       Specify peers to whom configuration needs to be synced

  system             System management commands

  verify               Verify the current configuration session

  vlan                  Vlan commands

  vpc                   Vpc

  wrr-queue      Map traffic priority (CoS) values to L3 Multicast Queues

  end                  Go to exec mode

  exit                  Exit from command interpreter

  pop                 Pop mode from stack or restore from name

  push               Push current mode to stack or save it under name

  where            Shows the cli context you are in

 

WALBOB-BNL-DAT01(config-sync-sp)# interface e101/1/41

WALBOB-BNL-DAT01(config-sync-sp-if)# speed 1000

WALBOB-BNL-DAT01(config-sync-sp-if)# channel-group 100

WALBOB-BNL-DAT01(config-sync-sp-if)# interface port-channel 100

 

 

 

 

WALBOB-BNL-DAT01(config-sync-sp-if)# sh switch-profile 5KSync ?

  buffer           Buffered commands

  peer             Peer info

  session-history  Switch-profile session-history

  status           Switch-profile sync status

 

WALBOB-BNL-DAT01(config-sync-sp-if)# sh switch-profile 5KSync buffer   ß   PERMETTE DI VISUALIZZARE           

                                                                                                                                             AL SEQUENZA DEI COMANDI

 

switch-profile  : 5KSync

----------------------------------------------------------

Seq-no  Command

----------------------------------------------------------

1       interface Ethernet101/1/41

1.1       speed 1000

1.2       channel-group 100

2       interface port-channel100

 

WALBOB-BNL-DAT01(config-sync-sp-if)# verify      ß PERMETTE DI VERIFICARE LA CORRETTEZZA PRIMA DI  

                                                                                               APPLICARLI CON IL COMMIT

Verification Successful

 

 

 

WALBOB-BNL-DAT01(config-sync-sp)# commit

Verification successful...

Proceeding to apply configuration. This might take a while depending on amount of configuration in buffer.

Please avoid other configuration changes during this time.

Commit Successful

 

WALBOB-BNL-DAT01(config-sync)#

 

 

 

 

 

 

 

 

 

 

 

 

 

 

IL RISULTATO DOPO IL COMMIT E’ IL SEGUENTE (IDENTICO SUI 2 peer  NEXUS   5K)

 


WALDOB-BNL-DAT01#        

interface port-channel100

  speed 1000

 

interface Ethernet101/1/41

  speed 1000

  channel-group 100

 

 

WALDOB-BNL-DAT02#         

 

interface port-channel100

  speed 1000

 

interface Ethernet101/1/41

  speed 1000

  channel-group 100

 

 

PROVANDO AD INSERIRE UN ERRORE  ELIMINANDO LE CONFIGURAZIONI REALIZZATE INCORRIAMO IN UN ERRORE NEL COMMIT  ANCHE SE IL VERIFY ERA ANDATO A BUON FINE

 

 

WALBOB-BNL-DAT01(config)# configure sync

WALBOB-BNL-DAT01(config-sync)# switch-profile 5KSync

Switch-Profile started, Profile ID is 1

WALBOB-BNL-DAT01(config-sync-sp)# no int po100

WALBOB-BNL-DAT01(config-sync-sp)# interface e101/1/41

WALBOB-BNL-DAT01(config-sync-sp-if)# no speed 1000

WALBOB-BNL-DAT01(config-sync-sp-if)# no channel-group 100

WALBOB-BNL-DAT01(config-sync-sp-if)# verify

Verification Successful

 

WALBOB-BNL-DAT01(config-sync-sp)# commit

Verification successful...

Proceeding to apply configuration. This might take a while depending on amount of configuration in buffer.

Please avoid other configuration changes during this time.

Failed to Commit: Commit Failed

 

 

L’ERRORE è NELLA SEQUENZA ELIMINO IL PO100 (#1) E DOPO LO ELIMINO DALL’INTERFACCIA(#2.2)

 

WALBOB-BNL-DAT01(config-sync-sp)#

WALBOB-BNL-DAT01(config-sync-sp)# show switch-profile buffer ß MOSTRA LA SEQUENZA DEI COMANDI

 

switch-profile  : 5KSync

----------------------------------------------------------

Seq-no  Command

----------------------------------------------------------

1       no interface port-channel100

2       interface Ethernet101/1/41

2.1       no speed 1000

2.2       no channel-group 100

 

WALBOB-BNL-DAT01(config-sync-sp)# ?

  buffer-delete  Delete buffered command(s)

  buffer-move    Move buffered command(s)

  cdp            Configure CDP parameters

  class-map      Configure a class map

  commit         Commit the current configuration session

  feature        Command to enable/disable features

  import         Import

  interface      Configure interfaces

  ip             Configure IP features

  ipv6           Configure IPv6 features

  lacp           Configure LACP parameters

  logging        Modify message logging facilities

  mac            MAC configuration commands

  mac            MAC

  no             Negate a command or set its defaults

  policy-map     Configure a policy map

  port-channel   Configure port channel parameters

  port-profile   Configure a port-profile

  resequence     Resequence a list with sequence numbers

  slot           Configure a slot

  spanning-tree  Spanning Tree Subsystem

  sync-peers     Specify peers to whom configuration needs to be synced

  system         System management commands

  verify         Verify the current configuration session

  vlan           Vlan commands

  vpc            Vpc

  wrr-queue      Map traffic priority (CoS) values to L3 Multicast Queues

  end            Go to exec mode

  exit           Exit from command interpreter

  pop            Pop mode from stack or restore from name

  push           Push current mode to stack or save it under name

  where          Shows the cli context you are in

 

 

WALBOB-BNL-DAT01(config-sync-sp)# buffer-delete ?

  <1-9999>  Range(whole-number) of command id(s) to be deleted from switch-profile buffer

  WORD      Exact command id (x.x.x format) to be deleted from switch-profile buffer (Max Size 64)

  all       Delete all buffered commands

 

WALBOB-BNL-DAT01(config-sync-sp)# buffer-delete 2.2  ß  USATO PER CANCELLARE il COMANDO 2.2

 

WALBOB-BNL-DAT01(config-sync-sp)# show switch-profile buffer ß  Il COMANDO 2.2 E’ SPARITO

 

switch-profile  : 5KSync

----------------------------------------------------------

Seq-no  Command

----------------------------------------------------------

1       no interface port-channel100

2       interface Ethernet101/1/41

2.1       no speed 1000

 

WALBOB-BNL-DAT01(config-sync-sp)# commit                          ß QUESTA VOLTA IL COMMIT VA BENE

Verification successful...

Proceeding to apply configuration. This might take a while depending on amount of configuration in buffer.

Please avoid other configuration changes during this time.

Commit Successful

 

Importing a Switch Profile

You can import a switch profile based on the set of commands that you want to import. The following three ways can be used to import commands that were added using the configuration terminal mode:

Follow these guidelines when adding switches:

·         Add selected commands to the switch profile.

·         Add supported commands that were specified for an interface.

·         Add supported system-level commands.

When you import commands to a switch profile, the switch profile buffer must be empty.

If new commands are added during the import, the switch profile remains unsaved and the switch remains in the switch profile import mode. You can enter the abort command to stop the import. For additional information importing a switch profile, see the “Switch Profile Import Mode” section.

 

SUMMARY STEPS

1. config sync

2. switch-profile name

3. import {interfaceport/slot | running-config}

4. commit

5. (Optional) abort

6. exit

7. (Optional) show switch-profile

8. (Optional) copy running-config startup-config


DETAILED STEPS

Command or Action

Purpose

Step 1

config sync

Example:

switch# config sync

switch(config-sync)#

Enters the configuration synchronization mode.

Step 2

switch-profile name

Example:

switch(config-sync)# switch-profile abc

switch(config-sync-sp)#

Configures the switch profile, names the switch profile, and enters the switch profile synchronization configuration mode.

Step 3

import {interfaceport/slot | running-config}


Example:

switch(config-sync-sp)# import ethernet 1/2

switch(config-sync-sp-import)#

Identifies the commands that you want to import and enters switch profile import mode.

  • <CR>—Adds selected commands.
  • interfaceAdds the supported commands for a specified interface.
  • running-configAdds supported system-level commands.

Step 4

commit

Example:

switch(config-sync-sp-import)# commit

Imports the commands and saves the commands to the switch profile.

Step 5

abort

Example:

switch(config-sync-sp-import)# abort

(Optional)

Aborts the import process.

Step 6

exit

Example:

switch(config-sync-sp)# exit

switch#

Exits the switch profile import mode.

Step 7

show switch-profile

Example:

switch# show switch-profile

(Optional)

Displays the switch profile configuration.

Step 8

copy running-config startup-config

Example:

switch# copy running-config startup-config

(Optional)

Copies the running configuration to the startup configuration.