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
Flag | Description |
---|---|
h, –help | Help for attach-network |
-n, –network string | Network 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 Flags | Description |
---|---|
-F, –format string | Available formats: “table”, “yaml”, “json”, “csv”. Default is command specific. Can be used with describe and list subcommands. |
-D, –log dir string | Override Log file Directory |
-L, –log file string | Override Log File Name |
-V, –verbosity string | Override 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.