I have a VM running on GCE, and a local CentOS 7 VM running on VirtualBox.
I'm trying to create an IAP tunnel from my local VM to the GCE one, and I'm getting the following error:
Using the same command I'm able to create the tunnel from my Windows 10 machine to the GCE VM, and a colleague of mine managed to create the tunnel on his CentOS VM.
I'm also able to SSH from my local VM into the GCE VM using its external IP.
So it doesn't look like it's an issue with the GCE VM's configuration, or with the connection between the VMs (pings are working just fine).
I'd appreciate any ideas you have in solving this. Thanks!
DEBUG: Running [gcloud.compute.start-iap-tunnel] with arguments: [--project: "[redacted]", --verbosity: "debug", --zone: "[redacted]", INSTANCE_NAME: "instance-1", INSTANCE_PORT: "22" ]
Picking local unused port [21324].
Testing if tunnel connection works.
DEBUG: credentials type for _GetAccessTokenCallback is [<googlecloudsdk.core.credentials.google_auth_credentials.UserCredWithReauth object at 0x7f38c7fa0e20>].
DEBUG: Error during WebSocket processing.
Traceback (most recent call last):
File "/usr/lib64/google-cloud-sdk/lib/third_party/websocket/_app.py", line 248, in run_forever
self.sock.connect(
File "/usr/lib64/google-cloud-sdk/lib/third_party/websocket/_core.py", line 222, in connect
self.sock, addrs = connect(url, self.sock_opt, proxy_info(**options),
File "/usr/lib64/google-cloud-sdk/lib/third_party/websocket/_http.py", line 120, in connect
sock = _open_socket(addrinfo_list, options.sockopt, options.timeout)
File "/usr/lib64/google-cloud-sdk/lib/third_party/websocket/_http.py", line 189, in _open_socket
raise error
File "/usr/lib64/google-cloud-sdk/lib/third_party/websocket/_http.py", line 172, in _open_socket
sock.connect(address)
OSError: [Errno 101] Network is unreachable
INFO: Error during WebSocket processing:
OSError: [Errno 101] Network is unreachable
DEBUG: (gcloud.compute.start-iap-tunnel) While checking if a connection can be made: Error while connecting [[Errno 101] Network is unreachable].
Traceback (most recent call last):
File "/usr/lib64/google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/iap_tunnel.py", line 723, in Run
self._TestConnection()
File "/usr/lib64/google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/iap_tunnel.py", line 750, in _TestConnection
websocket_conn = self._InitiateWebSocketConnection(
File "/usr/lib64/google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/iap_tunnel.py", line 644, in _InitiateWebSocketConnection
new_websocket.InitiateConnection()
File "/usr/lib64/google-cloud-sdk/lib/googlecloudsdk/api_lib/compute/iap_tunnel_websocket.py", line 144, in InitiateConnection
self._WaitForOpenOrRaiseError()
File "/usr/lib64/google-cloud-sdk/lib/googlecloudsdk/api_lib/compute/iap_tunnel_websocket.py", line 393, in _WaitForOpenOrRaiseError
raise ConnectionCreationError(error_msg)
googlecloudsdk.api_lib.compute.iap_tunnel_websocket.ConnectionCreationError: Error while connecting [[Errno 101] Network is unreachable].
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib64/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 987, in Execute
resources = calliope_command.Run(cli=self, args=args)
File "/usr/lib64/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 809, in Run
resources = command_instance.Run(args)
File "/usr/lib64/google-cloud-sdk/lib/surface/compute/start_iap_tunnel.py", line 160, in Run
iap_tunnel_helper.Run()
File "/usr/lib64/google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/iap_tunnel.py", line 725, in Run
raise iap_tunnel_websocket.ConnectionCreationError(
googlecloudsdk.api_lib.compute.iap_tunnel_websocket.ConnectionCreationError: While checking if a connection can be made: Error while connecting [[Errno 101] Network is unreachable].
ERROR: (gcloud.compute.start-iap-tunnel) While checking if a connection can be made: Error while connecting [[Errno 101] Network is unreachable].