Adding Networks in the CLI

The pcloud command line interface provides functionality to add a network interface to a virtual machine.

The command to add the additional network interface is as follows:

pcloud compute instances attach-network <InstanceName> --network <NetworkName[:IPAddress]> [flags]

Flags

FlagDescription
h, –helpHelp for attach-network
-n, –network stringNetwork to attach to the VM Instance value must follow the <NetworkName[:IPAddress]> form.
Note that “NetworkID” can be provided instead of “NetworkName”, “IPAddress” is optional.
Required.
Global FlagsDescription
-F, –format stringAvailable formats: “table”, “yaml”, “json”, “csv”. Default is command specific. Can be used with describe and list subcommands.
-D, –log dir stringOverride Log file Directory
-L, –log file stringOverride Log File Name
-V, –verbosity stringOverride Log Verbosity

After a new interface has been created, the IP address will not automatically be assigned to the interface in the OS. Use the standard procedure for the operating system running in the VM to assign the IP address to the interface and bring it up.