When I create an instance in the default VPC, and check ifconfig, it says netmask is /32, as shown below:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1460
        inet  netmask  broadcast
        inet6 fe80::4001:aff:fe8a:2  prefixlen 64  scopeid 0x20<link>
        ether 42:01:0a:8a:00:02  txqueuelen 1000  (Ethernet)
        RX packets 4728  bytes 39926123 (38.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3900  bytes 442039 (431.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet  netmask
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

The issue is the application I try to install does not allow /32 subnet. I tried creating a test VPC network, but I cannot ssh to the instances anymore if I use that. If tried adding secondary ranges to default subnet without success. I have tried to expand the netmask with sudo ifconfig eth0 netmask only to have the ssh connection freeze (using web browser to ssh). And after that I cannot ssh to instance. What would be other approaches for this?

I see question here, but does not look like it has been answered: Google Cloud Compute set /20 subnet mask to internal interface

  • 1
    Fix the broken application. I don't think you can make Google do networking differently. – Michael Hampton Feb 24 '18 at 1:52

Unfortunately this parameters are set that way to have a better integration with Google Cloud Platform.

Regarding why you can not SSH when you create a new VPC, you must create new firewall rules, as they only apply to one VPC, so the old firewall rules do not apply to the new VPC.

I strongly recommend to open an issue with the support of the application in order to have integration with Google Cloud Platform.


For anyone getting here from a Google search, here's what I found in GCE documentation. Verbatim quote:

To configure interfaces with a netmask other than /32, you should create an image using the flag --guest-os-features MULTI_IP_SUBNET and use it to create your instance. For example, if you are using a debian-9 based image, you can create an image using following command:

gcloud compute images create debian-9-multi-ip-subnet \
     --source-disk debian-9-disk \
     --source-disk-zone us-west1-a \
     --guest-os-features MULTI_IP_SUBNET

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.