You add multiple network interfaces when you create an instance.
-
On the Console, you add network interfaces on the Create an Instance page, in the Networking -> Network interfaces section.
-
On the gcloud command line tool, use the instances create command. Include the --network-interface flag for each interface, followed by any appropriate networking keys, such as ([network | subnet], private-network-ip, address).
The first interface is always created as nic0 and it is always the default interface.
-
Go to the Create an instance page in the Google Cloud Platform Console.
-
Complete the sections for the instance name, zone, machine type, and other basic aspects of the instance.
-
Complete fields on the Management and Disks tabs.
-
On the Networking tab, click Add network interface.
-
Choose a network.
-
If there are multiple subnets in the VPC network, choose a subnet.
-
To assign a custom internal IP address to the interface, on the Internal IP drop-down menu, choose Custom and then type in the IP address.
-
To indicate that you do not want an external IP address, on the External IP drop-down menu, choose None.
-
To assign a static external IP address, on the External IP drop-down menu, choose New static IP, type in the Name and description and click Reserve.
-
To enable IP forwarding, choose On on the IP forwarding drop-down menu.
-
To add more network interfaces, click Add network interface and follow steps 5-10 above