info Скрипт базовой конфигурации QoS

Скрипт создает и конфигурирует EAPS домен, конфигурирует EAPS и control vlan, добавляет protected vlan и включает EAPS. Изменив под свою сеть, скрипт даст возможность быстро разворачивать EAPS кольца на сети и менять их настройки.

Скрипт:

enable cli scripting

# @METADATASTART

#@DetailDescriptionStart

#############################################################################

#

# Script    : EAPSConfig

# Revision   : 1.1

# Last Updated : April 4, 2008

#

# Purpose: This script provides an example of Ethernet Automatic Protection

#     Switching (EAPS) for an ExtremeXOS™ switch. In this example:

#

#      1. An EAPS domain is created and assigned a name

#      2. EAPS is configured for the switch

#      3. EAPS control VLAN is configured

#      4. EAPS control VLAN is added to EAPS domain

#      5. Optionally, EAPS protected VLAN is configured and added to EAPS domain

#      6. Optionally, EAPS is enabled (switch and domain)

#

# Note:  The EAPS domain name must begin with an alpha.

#

#############################################################################

#@DetailDescriptionEnd

#############################################################################

# EAPS Variable Definitions

#############################################################################

 

# @VariableFieldLabel «If this script encounters errors, do you wish to abort or ignore?»

set var clierrormode abort

# @VariableFieldLabel «Create a new EAPS Ring? (yes or no, switch must be part of EAPS)»

set var yneaps yes

# @VariableFieldLabel «Will this switch be a master or transit? (master or transit)»

set var eapsMT master

# @VariableFieldLabel «Name of EAPS domain»

set var eapsdomain e1-domain

# @VariableFieldLabel «EAPS Primary port number»

set var eapsprimary 23

# @VariableFieldLabel «EAPS Secondary port number»

set var eapssecondary 24

# @VariableFieldLabel «Name of EAPS control VLAN»

set var eapscontrol ecvlan

# @VariableFieldLabel «Tag for EAPS control VLAN»

set var eapscontroltag 4000

# @VariableFieldLabel «Add the VLAN you are connected to currently? (yes or no)»

set var yneapscurrent yes

# @VariableFieldLabel «Name of VLAN you are on now?»

set var eapscurrent default

# @VariableFieldLabel «Enable EAPS on the Switch? (yes or no)»

set var yneapsenable yes

# @MetaDataEnd

#############################################################################

# Create an EAPS Domain and Add Control and Protected VLANs to the EAPS Domain

#############################################################################

 

if (!$match($clierrormode,ignore)) then

 configure cli mode scripting ignore-error

 create log entry «CLI mode set for Ignore on Error»

else

 configure cli mode scripting abort-on-error

 create log entry «CLI mode set for Abort on Error»

endif

 

if (!$match($yneaps,yes)) then

 create log entry «Starting EAPS Configuration on Switch»

 configure eaps config-warnings off

 create eaps $eapsdomain

 configure eaps $eapsdomain mode $eapsMT

 configure eaps $eapsdomain primary port $eapsprimary

 configure eaps $eapsdomain secondary port $eapssecondary

 create vlan $eapscontrol

 configure vlan $eapscontrol qosprofile qp8

 configure vlan $eapscontrol tag $eapscontroltag

 configure vlan $eapscontrol add port $eapsprimary tagged

 configure vlan $eapscontrol add port $eapssecondary tagged

 configure $eapsdomain add control $eapscontrol

 create log entry «Finished EAPS Configuration on Switch»

endif

 

if (!$match($yneapscurrent,yes)) then

 configure vlan $eapscurrent add port $eapsprimary tagged

 configure vlan $eapscurrent add port $eapssecondary tagged

 configure $eapsdomain add protect $eapscurrent

 create log entry «Default VLAN added to EAPS domain»

endif

 

if (!$match($yneapsenable,yes)) then

 enable eaps

 enable eaps $eapsdomain

 create log entry «EAPS Enabled on Switch»

endif