Skip to content

Instantly share code, notes, and snippets.

@kitchen
Created November 22, 2019 23:46
Show Gist options
  • Save kitchen/14d64ef245fe10f5eff9aa990d31a115 to your computer and use it in GitHub Desktop.
Save kitchen/14d64ef245fe10f5eff9aa990d31a115 to your computer and use it in GitHub Desktop.
gcloud ssh iap fun
➜  gcloud compute instances list
NAME            ZONE           MACHINE_TYPE  PREEMPTIBLE  INTERNAL_IP  EXTERNAL_IP  STATUS
teensybox-c86x  us-central1-a  f1-micro                   10.128.0.7                RUNNING
teensybox-d7nw  us-central1-a  f1-micro                   10.128.0.8                RUNNING
➜  ping 10.128.0.7
PING 10.128.0.7 (10.128.0.7): 56 data bytes
36 bytes from 4.68.38.153: Destination Net Unreachable
Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
 4  5  00 5400 cefa   0 0000  3c  01 7090 192.168.115.239  10.128.0.7

Request timeout for icmp_seq 0
36 bytes from 4.68.38.153: Destination Net Unreachable
Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
 4  5  00 5400 2a31   0 0000  3c  01 155a 192.168.115.239  10.128.0.7

^C
--- 10.128.0.7 ping statistics ---
2 packets transmitted, 0 packets received, 100.0% packet loss
➜  cat ~/.ssh/config
Include ~/.ssh/config.d/*

host teensybox-*
	user kitchen_scriptkitchen_com
	proxycommand gcloud compute start-iap-tunnel --listen-on-stdin %h %p
➜  ssh teensybox-c86x hostname
teensybox-c86x
➜  ssh teensybox-d7nw hostname
teensybox-d7nw

:yayoctopus:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment