Connect Two Devices
connect_two_devicesCable a port on one device to a port on another in Packet Tracer, automatically selecting the cable type when set to auto.
Instructions
Cable a port on one device to a port on another and return the cable type used. Both ports must exist and be free; use get_interfaces_for_device to find port names. cable="auto" (default) picks like Packet Tracer's GUI: serial for Serial ports, console for console ports, straight-through between a switch and a host/router, crossover between like devices.
Examples:
"Connect R1 Gi0/0 to SW1 Gi0/1"
"Cable PC0 FastEthernet0 to the switch's Fa0/1"
"Add a serial link between R1 Serial0/1/0 and R2 Serial0/1/0"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cable | No | auto | |
| port_a | Yes | Full port name (e.g. 'GigabitEthernet0/0', 'FastEthernet0', 'Serial0/1/0') | |
| port_b | Yes | Full port name (e.g. 'GigabitEthernet0/0', 'FastEthernet0', 'Serial0/1/0') | |
| device_a | Yes | Device display name as shown in Packet Tracer (e.g. 'Router0', 'PC1') | |
| device_b | Yes | Device display name as shown in Packet Tracer (e.g. 'Router0', 'PC1') |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |