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 10.138.0.2 netmask 255.255.255.255 broadcast 10.138.0.2
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 127.0.0.1 netmask 255.0.0.0
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 10.138.0.2 netmask 255.255.255.0
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