Configuration Mode

After starting the TNSR CLI, the administrator is in basic mode and not configuration mode. To enter configuration mode, enter the configure command. This command may be abbreviated to config and it is also acceptable to write terminal after, as a convenience for administrators familiar with IOS who type it out of habit.

All of the following commands are equivalent:

tnsr# configure
tnsr# configure terminal
tnsr# config
tnsr# conf t

After entering any one of the above commands, the prompt changes to reflect the new configuration mode:

tnsr# configure
tnsr(config)#

After entering other configuration commands, the new configuration is stored in the candidate database (Configuration Database). A candidate database may be committed either when all of the required information is present, or when exiting the current context. Some commands are committed immediately.

Removing Configuration Items

Items are removed or negated using no, followed by the option to remove. For example, to remove an interface description:

tnsr(config)# interface GigabitEthernet0/14/1
tnsr(config-interface)# no description

In this case, since there is only one description, removing the description does not require the existing content of that option. In most cases, the no command only requires enough parameters to uniquely identify an entry to be removed or negated.

In certain cases, a partial command may remove multiple items or may be used as a shorthand method of removing a longer entry when the details do not uniquely identify an entry.

For example, this command removes one input ACL from an interface:

tnsr(config-interface)# no access-list input acl idsblock

Where this shorter version will remove all input ACL entries on an interface:

tnsr(config-interface)# no access-list input acl

Finally, this form would remove all ACLs of any type from an interface:

tnsr(config-interface)# no access-list

The ? help command (Finding Help) is useful in determining when these actions are possible. For example, the CLI will show <cr> (“carriage return”) as an available keyword when testing a command:

tnsr(config-interface)# no access-list ?
  <cr>
  acl                   ACL Rule
  input                 ACL applies to ingress packets
  macip                 MACIP Rule
  output                ACL applies to egress packets

Since the help request printed <cr> among the choices, the command may be completed by pressing Enter.

Interactive Large Delete Confirmation

When performing a delete operation in sensitive areas, TNSR checks the size of the pending change when exiting a mode or committing configuration changes. This feature prevents accidental removal of significant sections of the router configuration.

If TNSR considers a change too large to happen automatically, such as removing the entire OSPF configuration, then TNSR will prompt for confirmation before proceeding.

This feature is disabled by default, but may be enabled as follows:

tnsr# configure
tnsr(config)# cli option check-delete-thresholds

To disable the feature, precede it with no:

tnsr# configure
tnsr(config)# no cli option check-delete-thresholds

For example, with the feature enabled, attempting to make a large change results in a confirmation prompt:

tnsr(config)# route dynamic ospf
tnsr(config-frr-ospf)# no server
Really delete that? [yes/no]: y
tnsr(config-frr-ospf)#

Troubleshooting

If a change to the candidate database fails a validation check or application of the change to the system fails for some reason, it is discarded automatically by default. TNSR resets the candidate database to the current contents of the running database to avoid further attempts to apply the faulty configuration contained in the candidate database.

This automatic behavior can be changed, however, in cases where power users want more control to troubleshoot failed configuration transactions:

tnsr# configure
tnsr(config)# no cli option auto-discard

When auto-discard is disabled, if a configuration commit fails the candidate database retains the faulty configuration data. Further configuration commands may apply additional changes to the candidate database. However, until the configuration data which caused the failure is removed or set to a value which can be successfully applied, no further commit will succeed.

Disabling the auto-discard feature only persists for the duration of the current CLI session in which it was disabled. At the start of a new CLI session, auto-discard will again be enabled by default.

To view the status of the auto-discard option, use show cli:

tnsr# show cli
Discard erred candidate database: true

A faulty candidate can be viewed with the show configuration candidate command, as described in Configuration Database

There are three approaches to rectify this situation:

  • Issue alternate commands that directly correct the faulty configuration.

  • Abandon the attempted configuration:

    tnsr# configure
    tnsr(config)# configuration candidate discard
    
  • Remove the fault from the candidate configuration by reverting to the running configuration:

    tnsr# configure
    tnsr(config)# configuration copy running candidate
    tnsr(config)# configuration candidate commit