connect_interface
Connect a node interface to another node or to an existing network, automatically selecting an available interface if none specified.
Instructions
Connect one node's interface to another node, or to an existing network.
Exactly one target is required: target_node_id (connects
directly to another node -- EVE-NG has no dedicated "connect
two nodes" API endpoint, so this creates a new bridge network
behind the scenes and wires both nodes' interfaces to it,
exactly what EVE-NG's own GUI does when you draw a line
directly between two node icons; it renders as a plain line,
not a separate network icon, because it ends up with exactly
two node endpoints) or network_id/network_name (connects
to a network you already created yourself, e.g. via
add_lab_network -- this one stays visible on the canvas as
its own icon, same as wiring a cloud/bridge manually in the GUI).
interface/target_interface accept an interface name (e.g.
"Gi0/0"), a 0-based index, or can be omitted to auto-pick that
node's first available (currently unconnected) ethernet
interface. Scoped to ethernet interfaces only.
EVE-NG PRO allows wiring interfaces on running nodes;
Community requires every node involved to be stopped first.
This checks the server's edition automatically and, on
Community only, stops any running node(s) involved before
wiring them -- same stop-if-needed behavior as edit_lab_node.
Args: lab_path: Full path to the .unl lab file. node_id: Id of the node whose interface is being connected. interface: Which interface on node_id -- name, index, or omit to auto-pick the first available one. target_node_id: For a node-to-node connection: id of the other node. target_interface: Which interface on target_node_id -- name, index, or omit to auto-pick the first available one. network_id: For a node-to-network connection: the network's id. network_name: For a node-to-network connection: the network's exact name (case-insensitive), if you don't already know its id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| node_id | Yes | ||
| lab_path | Yes | ||
| interface | No | ||
| network_id | No | ||
| network_name | No | ||
| target_node_id | No | ||
| target_interface | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||