Skip to content
This repository was archived by the owner on Oct 20, 2023. It is now read-only.
This repository was archived by the owner on Oct 20, 2023. It is now read-only.

All gateway traffic is unroutable #25

@jwilbur-godaddy

Description

@jwilbur-godaddy

Describe the bug

In the TUI, it appears that gh net manages to resolve DNS names, but it fails to make any of them routable. I see no NAT rules appear in my WSL 2 environment. My team also tried this on Mac OS and got NAT rules to appear, but still, no traffic was routable. I stopped sshd from codespaces and ran sudo /usr/sbin/sshd -dD to get debugging logs, which can be seen below:

debug1: sshd version OpenSSH_8.2, OpenSSL 1.1.1f  31 Mar 2020
debug1: private host key #0: ssh-rsa SHA256:k9VYtTGN4jUIzHj/EKq+6y6uJisj1iY6g9lsVROToaI
debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:ocBy0gcEdSuQoID0LBS3k/g5Q2ph6xyz80/Lh8hdkNs
debug1: private host key #2: ssh-ed25519 SHA256:ba71WhdgVVnBeAfR1y1Tk/iY6czrEsZXzyengW4ESfE
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-dD'
debug1: Set /proc/self/oom_score_adj from 0 to -1000
debug1: Bind to port 2222 on 0.0.0.0.
Server listening on 0.0.0.0 port 2222.
debug1: Bind to port 2222 on ::.
Server listening on :: port 2222.
debug1: Server will not fork when running in debugging mode.
debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8
debug1: sshd version OpenSSH_8.2, OpenSSL 1.1.1f  31 Mar 2020
debug1: private host key #0: ssh-rsa SHA256:k9VYtTGN4jUIzHj/EKq+6y6uJisj1iY6g9lsVROToaI
debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:ocBy0gcEdSuQoID0LBS3k/g5Q2ph6xyz80/Lh8hdkNs
debug1: private host key #2: ssh-ed25519 SHA256:ba71WhdgVVnBeAfR1y1Tk/iY6czrEsZXzyengW4ESfE
debug1: inetd sockets after dupping: 3, 3
Connection from 127.0.0.1 port 39600 on 127.0.0.1 port 2222 rdomain ""
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.5
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4ubuntu0.4
debug1: match: OpenSSH_8.2p1 Ubuntu-4ubuntu0.4 pat OpenSSH* compat 0x04000000
debug1: permanently_set_uid: 105/65534 [preauth]
debug1: list_hostkey_types: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
debug1: SSH2_MSG_KEXINIT sent [preauth]
debug1: SSH2_MSG_KEXINIT received [preauth]
debug1: kex: algorithm: curve25519-sha256 [preauth]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256 [preauth]
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: zlib@openssh.com [preauth]
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: zlib@openssh.com [preauth]
debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
debug1: rekey out after 134217728 blocks [preauth]
debug1: SSH2_MSG_NEWKEYS sent [preauth]
debug1: Sending SSH2_MSG_EXT_INFO [preauth]
debug1: expecting SSH2_MSG_NEWKEYS [preauth]
debug1: SSH2_MSG_NEWKEYS received [preauth]
debug1: rekey in after 134217728 blocks [preauth]
debug1: KEX done [preauth]
debug1: userauth-request for user codespace service ssh-connection method none [preauth]
debug1: attempt 0 failures 0 [preauth]
debug1: PAM: initializing for "codespace"
debug1: PAM: setting PAM_RHOST to "127.0.0.1"
debug1: PAM: setting PAM_TTY to "ssh"
debug1: userauth-request for user codespace service ssh-connection method publickey [preauth]
debug1: attempt 1 failures 0 [preauth]
debug1: userauth_pubkey: test pkalg ssh-ed25519 pkblob ED25519 SHA256:oJusw5Gxu9cT+lVe3ggOqrEyyRuxSe9zFuEzKQMHxpY [preauth]
debug1: temporarily_use_uid: 1000/1000 (e=0/0)
debug1: trying public key file /home/codespace/.ssh/authorized_keys
debug1: fd 4 clearing O_NONBLOCK
debug1: /home/codespace/.ssh/authorized_keys:3: matching key found: ED25519 SHA256:oJusw5Gxu9cT+lVe3ggOqrEyyRuxSe9zFuEzKQMHxpY
debug1: /home/codespace/.ssh/authorized_keys:3: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
Accepted key ED25519 SHA256:oJusw5Gxu9cT+lVe3ggOqrEyyRuxSe9zFuEzKQMHxpY found at /home/codespace/.ssh/authorized_keys:3
debug1: restore_uid: 0/0
Postponed publickey for codespace from 127.0.0.1 port 39600 ssh2 [preauth]
debug1: userauth-request for user codespace service ssh-connection method publickey [preauth]
debug1: attempt 2 failures 0 [preauth]
debug1: temporarily_use_uid: 1000/1000 (e=0/0)
debug1: trying public key file /home/codespace/.ssh/authorized_keys
debug1: fd 4 clearing O_NONBLOCK
debug1: /home/codespace/.ssh/authorized_keys:3: matching key found: ED25519 SHA256:oJusw5Gxu9cT+lVe3ggOqrEyyRuxSe9zFuEzKQMHxpY
debug1: /home/codespace/.ssh/authorized_keys:3: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
Accepted key ED25519 SHA256:oJusw5Gxu9cT+lVe3ggOqrEyyRuxSe9zFuEzKQMHxpY found at /home/codespace/.ssh/authorized_keys:3
debug1: restore_uid: 0/0
debug1: auth_activate_options: setting new authentication options
debug1: do_pam_account: called
Accepted publickey for codespace from 127.0.0.1 port 39600 ssh2: ED25519 SHA256:oJusw5Gxu9cT+lVe3ggOqrEyyRuxSe9zFuEzKQMHxpY
debug1: monitor_child_preauth: codespace has been authenticated by privileged process
debug1: auth_activate_options: setting new authentication options [preauth]
debug1: Enabling compression at level 6. [preauth]
debug1: monitor_read_log: child log fd closed
debug1: PAM: establishing credentials
User child is on pid 26161
debug1: SELinux support disabled
debug1: PAM: establishing credentials
debug1: permanently_set_uid: 1000/1000
debug1: rekey in after 134217728 blocks
debug1: rekey out after 134217728 blocks
debug1: ssh_packet_set_postauth: called
debug1: Enabling compression at level 6.
debug1: active: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Entering interactive session for SSH2.
debug1: server_init_dispatch
debug1: server_input_channel_open: ctype session rchan 0 win 2097152 max 32768
debug1: input_session_request
debug1: channel 0: new [server-session]
debug1: session_new: session 0
debug1: session_open: channel 0
debug1: session_open: session 0: link with channel 0
debug1: server_input_channel_open: confirm session
debug1: server_input_global_request: rtype no-more-sessions@openssh.com want_reply 0
debug1: server_input_channel_req: channel 0 request env reply 0
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req env
debug1: server_input_channel_req: channel 0 request exec reply 1
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req exec
Starting session: command for codespace from 127.0.0.1 port 39600 id 0
 Connection closed by 127.0.0.1 port 39600
debug1: channel 0: free: server-session, nchannels 1
Close session: user codespace from 127.0.0.1 port 39600 id 0
debug1: do_cleanup
debug1: temporarily_use_uid: 1000/1000 (e=1000/1000)
debug1: restore_uid: (unprivileged)
Transferred: sent 4720, received 3336 bytes
Closing connection to 127.0.0.1 port 39600
debug1: compress outgoing: raw data 6410, compressed 2487, factor 0.39
debug1: compress incoming: raw data 5590, compressed 1152, factor 0.21
debug1: PAM: cleanup
debug1: PAM: closing session
debug1: PAM: deleting credentials

The logs seemed to hang on the line starting with "Starting session."

Here are the logs on the client side:

2022-05-23T15:19:17.805020Z  INFO start-command: app:                                                                                                                                                  version: "0.6.4"                                                                                                                                                                                       sha: "8b282b2f1d52abb127ccfb7eca1d04f4344af4df"                                                                                                                                                        built: "Wed, 11 May 2022 23:32:02 +0000"                                                                                                                                                               profile: "release"                                                                                                                                                                                     os: "linux"                                                                                                                                                                                            family: "unix"                                                                                                                                                                                         arch: "x86_64"                                                                                                                                                                                         endian: "little"                                                                                                                                                                                       cores: 16                                                                                                                                                                                              pointer-width: "64"                                                                                                                                                                                    debug: false                                                                                                                                                                                           in codespace: "false"                                                                                                                                                                                  2022-05-23T15:19:17.805085Z  INFO start-command: start command:                                                                                                                                        --dns: "true"                                                                                                                                                                                          --gui: "true"                                                                                                                                                                                          --repo: "github/gh-net"                                                                                                                                                                                --trace: "info"                                                                                                                                                                                        --location: "local"                                                                                                                                                                                    --telemetry: "true"                                                                                                                                                                                    2022-05-23T15:19:19.379916Z  INFO local: run_local is_dns: "true"                                                                                                                                      2022-05-23T15:19:19.379966Z  INFO local: codespace-name: "jwilbur-godaddy-gdcorp-im-account-billing-4j9vrx5pvcjv5j"                                                                                    2022-05-23T15:19:19.383595Z  INFO client: suitable network interfaces: ["lo", "eth0"]                                                                                                                  2022-05-23T15:19:19.383670Z  INFO client: starting 2 network interface jobs                                                                                                                            2022-05-23T15:19:19.383760Z  INFO network: copy queue to stream job started                                                                                                                            2022-05-23T15:19:19.383861Z  INFO network: connected "eth0"                                                                                                                                            2022-05-23T15:19:19.383864Z  INFO stream: connected "eth0"                                                                                                                                             2022-05-23T15:19:19.419967Z  INFO network: connected "lo"                                                                                                                                              2022-05-23T15:19:19.420067Z  INFO stream: connected "lo"                                                                                                                                               2022-05-23T15:19:19.489895Z  INFO stream: copy stream to queue job started                                                                                                                             2022-05-23T15:20:23.859884Z  INFO dns-resolver-sink: DNS hostname solicitation: [Question { qname: Name("vortex.data.microsoft.com"), prefer_unicast: false, qtype: A, qclass: IN }]                   2022-05-23T15:20:23.924659Z  INFO dns-resolver-sink: DNS hostname solicitation: [Question { qname: Name("vortex.data.microsoft.com"), prefer_unicast: false, qtype: AAAA, qclass: IN }]                2022-05-23T15:20:23.977810Z  INFO dns-resolver-sink: no records, adding NXDOMAIN responses                                                                                                             2022-05-23T15:20:43.931318Z  INFO dns-resolver-sink: DNS hostname solicitation: [Question { qname: Name("mobile.events.data.microsoft.com"), prefer_unicast: false, qtype: A, qclass: IN }]            2022-05-23T15:20:43.966790Z  INFO dns-resolver-sink: DNS hostname solicitation: [Question { qname: Name("mobile.events.data.microsoft.com"), prefer_unicast: false, qtype: AAAA, qclass: IN }]         2022-05-23T15:20:44.064049Z  INFO dns-resolver-sink: no records, adding NXDOMAIN responses                                                                                                             2022-05-23T15:21:02.710184Z  INFO dns-resolver-sink: DNS hostname solicitation: [Question { qname: Name("az764295.vo.msecnd.net"), prefer_unicast: false, qtype: A, qclass: IN }]                      2022-05-23T15:21:02.734576Z  INFO dns-resolver-sink: DNS hostname solicitation: [Question { qname: Name("az764295.vo.msecnd.net"), prefer_unicast: false, qtype: AAAA, qclass: IN }]                   2022-05-23T15:21:02.778119Z  INFO dns-resolver-sink: no records, adding NXDOMAIN responses                                                                                                             2022-05-23T15:21:06.551310Z  INFO dns-resolver-sink: DNS hostname solicitation: [Question { qname: Name("dc.services.visualstudio.com"), prefer_unicast: false, qtype: A, qclass: IN }]                2022-05-23T15:21:06.649880Z  INFO dns-resolver-sink: DNS hostname solicitation: [Question { qname: Name("dc.services.visualstudio.com"), prefer_unicast: false, qtype: AAAA, qclass: IN }]             2022-05-23T15:21:06.704470Z  INFO dns-resolver-sink: no records, adding NXDOMAIN responses                                                                                                             2022-05-23T15:21:06.706772Z  INFO dns-resolver-sink: DNS hostname solicitation: [Question { qname: Name("json.schemastore.org"), prefer_unicast: false, qtype: A, qclass: IN }]                        2022-05-23T15:21:06.768657Z  INFO dns-resolver-sink: DNS hostname solicitation: [Question { qname: Name("json.schemastore.org"), prefer_unicast: false, qtype: AAAA, qclass: IN }]                     2022-05-23T15:21:06.835240Z  INFO dns-resolver-sink: no records, adding NXDOMAIN responses                                                                                                             2022-05-23T15:25:49.921811Z  INFO dns-resolver-sink: DNS hostname solicitation: [Question { qname: Name("default.exp-tas.com"), prefer_unicast: false, qtype: A, qclass: IN }]                         2022-05-23T15:25:49.945819Z  INFO dns-resolver-sink: DNS hostname solicitation: [Question { qname: Name("default.exp-tas.com"), prefer_unicast: false, qtype: AAAA, qclass: IN }]                      2022-05-23T15:25:49.978747Z  INFO dns-resolver-sink: no records, adding NXDOMAIN responses                                                                                                             2022-05-23T15:36:19.085715Z  WARN stream: no packets left                                                                                                                                              2022-05-23T15:36:19.085715Z  WARN stream: no packets left 

Reproduce steps

  1. On Windows 10, connect to GlobalProtect VPN.
  2. Start WSL 2.
  3. Run gh net start.
  4. Observe that no NAT rules appear in the list. Hosts on the same network as the client machine (Windows 10 / WSL 2) cannot be reached.

Expected behavior

I want to be able to reach a host on my local network from Codespaces.

Desktop (please complete the following information):

  • OS: Windows 10 / WSL 2
  • Version: 10.0.19042 N/A Build 19042
  • Platform architecture: Intel64 Family 6 Model 141 Stepping 1 GenuineIntel ~2496 Mhz

Logs
Please attach logs to created issue. The best way for getting logs is to use VSCode client: connect to a Codespace and run > Codespaces: Export Logs command in command palette. Please note a logs file name shown in the UI.
logs.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions