Send commands to multiple devices at the same time using SecureCRT

Network engineers often have the task of performing a series of identical actions on a large number of equipment. The main way to do this quickly is to write actions to notepad and copy / past to each device. There is a way to speed up this already fast process using SecureCRT software and Command window functionality. Which allows you to send commands to multiple devices at the same time.
What is this article for? This article is from the Fast Start cycle and aims to save time for network engineers when setting up equipment (one task) on multiple devices. It uses SecureCRT software and built-in Command window functionality.




Introduction


In the process of setting up network equipment, often tasks arise of performing simple and identical actions on a large number of devices. To perform these tasks, you can use the standard method: Notepad + Copy / Paste. And you can use the built-in SecureCRT functionality - command window - a special window in which you can edit the command before sending it to the equipment. And additional functionality: send a command not only to the current session, but also to several open sessions.

Using Command window:


Call Command window, setting operating modes


The command window is called up via the menu: SecureCRT Menu => View => Command window. Or SecureCRT Menu => View => Chat window.


Modes of operation may be:
  • Edit mode
  • Real-time ("Send Characters Immediately")

Editing mode - allows you to edit the command before sending it to the device.
Real-time mode - any keypress is automatically sent to the device - whether it is a space or a keypress (alphabetic or Enter).

The command forwarding setting has the following operation modes:
  • Forward to the active session (only the current one).
  • In all sessions.
  • To the selected group (tab) or group.

Officially, the options are as follows:
Active Session — Send commands only to the active session. This is the default.
All Sessions — Send commands to all your open sessions at once.
Selected Tab Group(s) — Send commands to one or more tab groups. This setting is automatically selected when you right-click on a tab and enable Send Commands to This Group. When commands are being sent to selected tab groups, the tabs of the sessions that commands will be sent to contain an asterisk in front of the session name.
Visible Sessions — Send commands to all visible tabbed sessions. When there are multiple tab groups, commands will be sent to the currently active session in each tab group.

The real-time mode setting is enabled using the context-sensitive menu in the Command window. (Right-click on the Command Window - a context-sensitive menu pops up and select the "Send Characters Immediately" menu item)
Command forwarding settings are also called up using the context-sensitive menu in the Command window. (Right-click on the Command Window - a context-sensitive menu pops up, select "Send Commands To", select the menu sub-item {"All sessions" | "Selected tab" | "Active session")


Using Command window to configure multiple devices at the same time


Very often, to work, you need to execute simple commands simultaneously on several devices. To do this, it’s very convenient (because fast) to use the Command window to send data to multiple devices simultaneously.
To configure multiple devices:
  1. We are connected to all devices of the same type.
  2. In the SecureCRT menu, call Command window
  3. In the context menu of the Command window, select All sessions.
  4. We enter commands as a single unit or one at a time. (In a single swap, commands are entered through Control + Enter. - line feed without transferring to equipment.)

This is usually a standard set of commands:
screen-len 0 tem
dis cu
save
y
q

Example:


Real-world example: Configuring 15 switches at the same time. It is necessary to configure snmp v3 on 15 new switches, ports 1 to 44 in Access + storm-control. c 45 to 48 - for printers. The easiest way (= fastest) seemed to use a bunch:
SecureCRT command window all sessions + interface range gi0 / 0/1 to gi0 / 0/46.
The second real example: When working on equipment using RFC: “Point 1. Create Backup Configurations”: quickly open the necessary sessions (in SecureCRT this is really done quickly) and execute a standard set of commands on a range of devices from one vendor.

Quick connect to multiple sessions


Select the sessions that we want to connect to at the same time and press Enter.

We send commands to all devices simultaneously:
ter len 0
show ip int br

Please do not be scared - the Tile image mode - for clarity, show that the commands were entered in all active sessions (working in this form is inconvenient, but clear):

In order not to frighten, I switched the display mode as Tabs (standard operating mode)


Using the Command window to configure multiple devices in real time at the same time.


What can real-time input be used and really used? Answer: when identical parameters are configured, but with a slight difference. Example hostname, ip address on the interface.
How it looks in reality:
1. Sessions are opened where it is necessary to enter almost the same parameters.

2. The operating mode of the command window is configured: "Send Characters Immediately" + "Send commands to: All Sessions".

3. The following data is entered into the command window:
interface gi0/0/0.10
dot1q termination vid 10
ip address 172.31.255.

4. The cursor is transferred using the mouse from the Command window to the session window and for each device in the session the necessary address is configured:
R1 – 1
R2 – 2
R3 – 3

5. The cursor is transferred using the mouse to the Command window and the suffix is ​​added:
 255.255.255.0
quit
dis ip int br


Little trick. To check the spelling - first I check the spelling in one session. After verification, the command is sent to all sessions.


Conclusion


You must always be careful.
In some cases, it’s faster to disconnect from all sessions. Connect only to custom sessions. Enter commands in Command windows. After connecting to all other sessions. Connecting to SecureCRT is very fast. And reconnecting does not cause problems.
Very often, after entering group commands, the work in each session is checked (using the [ctrl + tab] combination, we switch over all windows and compare the result of the command in each window). We check the correctness of the execution of all commands, errors that could occur in any one session. Example: when connected to 3 Huawei routers, one of them by default connected to user mode. To work in the general thread, I switched the configuration mode to privileged mode.


About SecureCRT:
: 99$ ( SecureCRT )

1 , ( ), .
1: Screen-shot SecureCRT 6.1 — Windows 6.7 20 2011 . 6.1 Command window, «Chat window».
Mac OS X Windows.

Command Window ( )
Serial/Telnet/SSH1/SSH2/Shell

All Articles