Issue with default IP on VM with multiple network interfaces

Skip to first unread message

A Bazza

Sep 21, 2021, 12:07:58 PMSep 21
to gce-discussion
I am creating a VM wit gcloud that's being added to a second subnet. On the original subnet a static IP is defined. On the second subnet there is no private network IP. On launch my VM's IP defaults to a value chosen from the second network's CIDR range, not the static IP from the original subnet. How to ensure that my IP is the static IP

Here's the gcloud command:

gcloud compute --project my-proj instances create inst1

--zone europe-west2-b --machine-type n1-standard-32

--network-interface subnet=projects/shared-vpc/regions/europe-west2/subnetworks/cinternal-vpc1-europe-west2,no-address,private-network-ip=

--network-interface network=private-vpc,subnet=cinternal-vpc1-europe-west2-net1,no-address



--image-family xxx-build

--image-project my-proj --boot-disk-size 200 --boot-disk-type pd-standard --boot-disk-device-name boot-disk

--boot-disk-kms-key projects/key-project/locations/europe-west2/keyRings/computeEngine/cryptoKeys/computeEngine


--tags xxx

--metadata enable-oslogin=TRUE,serial-port-logging-enable=true,gcp_module=gcpsim,efx_fqdn=xxx,efx_env=uat,efx_region=europe-west2,app_env=uat



Reply all
Reply to author
0 new messages