ssh
Execute batch SSH operations on GNS3 network nodes. Configure sessions, run commands, and disconnect, with support for local execution to test connectivity before device access.
Instructions
Execute SSH operations (BATCH-ONLY)
v0.47.0: Batch-only SSH tool. Individual SSH tools removed (aggressive consolidation). v0.28.0: Local execution support with node_name="@"
Local Execution Support:
Use node_name="@" in any operation for local execution on SSH proxy container
Mix local and remote operations in same batch
Useful for: connectivity tests before device access, ansible playbooks
SSH Proxy Services (v0.3.0):
TFTP Server: Available on port 69/udp at /opt/gns3-ssh-proxy/tftp (use tftp tool)
HTTP/HTTPS Reverse Proxy: Access device web UIs at http://proxy:8023/http-proxy/:/
HTTP Client Tool: Make GET requests to device APIs (use http_client tool)
Two-phase execution prevents partial failures:
VALIDATE ALL operations (check required params, valid types)
EXECUTE ALL operations (only if all valid, sequential execution)
Supported operation types:
"configure": Configure SSH session (equivalent to old ssh_configure)
"command": Execute command (equivalent to old ssh_command, supports local with "@")
"disconnect": Disconnect SSH session
Args: operations: List of operation dicts, each with: - type (str): Operation type (required) - node_name (str): Node name (or "@" for local execution) (required) - Additional params specific to operation type
Returns: JSON with execution results including completed/failed indices
Examples: # Configure session + run commands: >>> ssh(operations=[ ... {"type": "configure", "node_name": "R1", "device_dict": { ... "device_type": "cisco_ios", "host": "10.1.0.1", ... "username": "admin", "password": "cisco123" ... }}, ... {"type": "command", "node_name": "R1", "command": "show version"}, ... {"type": "command", "node_name": "R1", "command": "show ip route"} ... ])
# Same command on multiple nodes:
>>> ssh(operations=[
... {"type": "command", "node_name": "R1", "command": "show ip int brief"},
... {"type": "command", "node_name": "R2", "command": "show ip int brief"}
... ])
# Configuration commands:
>>> ssh(operations=[{
... "type": "command",
... "node_name": "R1",
... "command": [
... "interface GigabitEthernet0/0",
... "ip address 10.1.1.1 255.255.255.0",
... "no shutdown"
... ]
... }])
# Local execution - test connectivity before device access:
>>> ssh(operations=[
... {"type": "command", "node_name": "@", "command": "ping -c 2 10.1.1.1"},
... {"type": "command", "node_name": "@", "command": "ping -c 2 10.1.1.2"},
... {"type": "command", "node_name": "R1", "command": "show ip int brief"},
... {"type": "command", "node_name": "R2", "command": "show ip int brief"}
... ])Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operations | Yes | List of SSH operations (command/disconnect) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |