IP Address Support¶
Networka lets you target devices directly by IP address (single or comma-separated list) without predefining them in configuration files.
Usage examples¶
Single IP address¶
# Run a command
nw run 192.168.1.1 "/system/clock/print" --platform mikrotik_routeros
# SSH to device by IP
nw cli 192.168.1.1 --platform mikrotik_routeros
# (Info requires configured device entries; see notes below)
Multiple IP addresses¶
# Execute command on multiple IPs (comma-separated, no spaces)
nw run "192.168.1.1,192.168.1.2,192.168.1.3" "/system/clock/print" --platform mikrotik_routeros
# SSH to multiple IPs (opens tmux with multiple panes)
nw cli "192.168.1.1,192.168.1.2" --platform mikrotik_routeros
# Mix IPs and configured device names
nw run "192.168.1.1,sw-acc1,192.168.1.2" "/system/clock/print" --platform mikrotik_routeros
With custom port¶
Interactive authentication¶
# Prompt for credentials at runtime
nw run 192.168.1.1 "/system/clock/print" --platform mikrotik_routeros --interactive-auth
Required parameters¶
When using IP addresses, you must specify:
--platform: The device type (network driver), e.g.mikrotik_routeros,cisco_iosxe.
Optional parameters:
--port: SSH port (defaults to 22)--interactive-auth: Prompt for username/password instead of environment--transport: Transport driver to use for the session (supported onrun/cli)
Supported platforms¶
- mikrotik_routeros — MikroTik RouterOS
- cisco_iosxe — Cisco IOS-XE
- cisco_iosxr — Cisco IOS-XR
- cisco_nxos — Cisco NX-OS
- juniper_junos — Juniper JunOS
- arista_eos — Arista EOS
- linux — Linux SSH
Authentication¶
IP-based connections use the same authentication as configured devices:
- Environment variables:
NW_USER_DEFAULTandNW_PASSWORD_DEFAULT - Interactive mode with
--interactive-auth - SSH keys (via the underlying transport)
Error handling¶
If you omit the platform when using IPs:
Error: When using IP addresses, --platform is required
Supported platforms:
mikrotik_routeros: MikroTik RouterOS
cisco_iosxe: Cisco IOS-XE
cisco_iosxr: Cisco IOS-XR
cisco_nxos: Cisco NX-OS
juniper_junos: Juniper JunOS
arista_eos: Arista EOS
linux: Linux SSH
Implementation details¶
When IPs are used as the target:
- Networka detects the IPs in the target argument
- Creates temporary devices with generated names (e.g.
ip_192_168_1_1) - Applies the specified
--platformfor connection parameters - Merges with any configured devices so you can mix both
- Executes commands as usual and supports results storage
Limitations¶
nw inforequires preconfigured devices or groups; it does not accept raw IP addresses.- IP targets are supported on commands that accept the
--platformoption (nw run,nw cli, and other operations built on the device resolver).