How to Reverse a CLI-based Command

  • 0
  • 1
  • Article
  • Updated 5 years ago
  • (Edited)
Article ID: 5542 

Matrix C1
Matrix E1
SecureStack C3
SecureStack C2
SecureStack B3
SecureStack B2
SecureStack A2 

Related to
Command line interface
CLI management 

Reverse / negate / clear / back out a CLI command
Navigate the CLI
CLI help 

With the Command Line Interface based products, it is not always obvious how to back out a command which is displayed via a 'show config'. 

This article presents some simple guidelines for CLI navigation. 

On the CLI-based products; for reversal purposes in some cases one would 'set' the value back to its default, in some cases one would use 'clear' instead of 'set', and in more rare instances one would preface the command with "no  ". This is based on the rules established for each command set, complicated by the fact that these products have at least subtle differences from each other. 

Unless you are familiar with a given product or plan to spend significant amounts of time parsing the Configuration Guide, when navigating the CLI the "?" parameter is your friend. 

As an example, assume that you are unsure how to change a port which has been hard-set for speed and duplex, and configure it back to its default auto-negotiating, 10HD state.
 Matrix N3 Platinum(su)->show config port
This command shows non-default configurations only.
Use 'show config all' to show both default and non-default configurations.

# port
set port duplex ge.1.1 full
set port negotiation ge.1.1 disable
set port speed ge.1.1 1000

Matrix N3 Platinum(su)->clear port ?
advertise Auto-neg advertised capabilities (default: all modes
broadcast Reset port broadcast threshold and/or clear peak rate &
time values.
discard Reset the types of frames being discarded to the factory
default setting.
inlinepower Clear inlinepower parameters.
jumbo Reset jumbo frame support on specified port(s)
lacp 8023ad Link Aggregation
mirroring Remove port mirroring configuration .
priority Priority associated.
priority-queue Priority to transmit queue mapping.
ratelimit Clear ratelimiting parameters
txq Individual transmit queue values.
vlan 802.1Q VLAN/port association.
Matrix N3 Platinum(su)->clear port

Given the lack of 'negotiation', 'speed', and 'duplex' options available with the 'clear' command, one can infer from this that the proper approach is to use the 'set' command.
 Matrix N3 Platinum(su)->set port negotiation ge.1.1 ? 
enable Enable auto-negotiation.
disable Disable auto-negotiation.
Matrix N3 Platinum(su)->set port speed ge.1.1 ?
10 10 Mbps.
100 100 Mbps.
1000 1000 Mbps.
Matrix N3 Platinum(su)->set port duplex ge.1.1 ?
full Full duplex mode.
half Half duplex mode.
Matrix N3 Platinum(su)->set port duplex ge.1.1

For our purposes here, the reversal commands would be
  'set port negotiation ge.1.1 enable'
  'set port speed ge.1.1 10'
  'set port duplex ge.1.1 half

A subsequent 'show config port' (or 'show config') should demonstrate that the original commands are now missing, since the settings are in agreement with the system defaults. 

When unsure of the default value for a command, consult the relevant Configuration Guide, which will list the Factory Default Settings.
For a discussion about clearing SNMP commands, please refer to 10308.
Photo of FAQ User

FAQ User, Official Rep

  • 13,620 Points 10k badge 2x thumb

Posted 5 years ago

  • 0
  • 1

There are no replies.

This conversation is no longer open for comments or replies.