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

No Connectivity to Local Resources #47

Open
jacobwoffenden opened this issue Nov 9, 2022 · 5 comments
Open

No Connectivity to Local Resources #47

jacobwoffenden opened this issue Nov 9, 2022 · 5 comments
Labels
bug Something isn't working enhancement New feature or request needs-user-input p1

Comments

@jacobwoffenden
Copy link

jacobwoffenden commented Nov 9, 2022

Describe the bug
I am unable to connect to resources local to my device

Reproduce steps
Steps to reproduce the behavior:

  1. Install gh and gh-net on macOS
  2. Launch a GitHub Codespace with following definition
    {
      "name": "devcontainer",
      "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
      "features": {
        "ghcr.io/devcontainers/features/common-utils:1": {
          "installZsh": "true",
          "installOhMyZsh": "true",
          "upgradePackages": "true",
          "nonFreePackages": "false"
        },
        "ghcr.io/devcontainers/features/sshd:1": {},
        "ghcr.io/devcontainers/features/github-cli:1": {}
      }
    }
  3. Start gh-net on macOS
    gh net start --codespace ${CODESPACE_NAME} --trace trace --trace-dest ~/codespace-trace.log

Expected behavior
Connections from GitHub Codespace to local resources work, e.g. SSH to A.B.C.D

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macOS
  • Version: 13.0
  • Platform architecture: Apple M1

Additional context
I have disabled the macOS firewall

Logs
I've dumped my local gh-net log to https://gist.github.com/jacobwoffenden/638a8502792bb88e993c92978ed87f4f, please let me know what specific log you would like from the GitHub Codespace

@jacobwoffenden jacobwoffenden added the bug Something isn't working label Nov 9, 2022
@legomushroom legomushroom added the enhancement New feature or request label Dec 5, 2022
@legomushroom
Copy link
Contributor

legomushroom commented Dec 5, 2022

@jacobwoffenden, the scenario you describe is different from the main flow we've intended to support with this tool, but I'm getting more and more requests to support this, so I will prioritize it.

Could you share more info on how you would expect to reach the local resources? e.g. would you like a reserved DNS name for that, or would you want to request a specific IP address of your machine's network interface IP address?

Related issue: #44

@jacobwoffenden
Copy link
Author

jacobwoffenden commented Dec 5, 2022

Hey @legomushroom,

Apologies if I've misunderstood or worded my issue incorrectly!

Based on:

This GitHub CLI extension allows you to bridge the network between a Codespace and your local machine, so the Codespace can reach out to any remote resource that is reachable from your machine

I assumed I could:

  1. Start a GitHub Codespace
  2. Fire up gh net on my MacBook
  3. Connect from GitHub Codespace to something local to my MacBook

Redoing my test, I've:

  1. Created a GitHub Codespace with the default definition
  2. Installed and setup gh and gh net
  3. Initiated gh net to my GitHub Codespace
  4. Tried to SSH from GitHub Codespace to a machine on the network local to MacBook

In the screenshot, you can see the resolved DNS entries for the machine I'm trying to SSH into

Screenshot 2022-12-05 at 22 37 35

Output of the log:

2022-12-05T22:30:51.564298Z  INFO network: connected ""
2022-12-05T22:30:51.564736Z  INFO network: connected ""
2022-12-05T22:31:02.360230Z  INFO resovle-job: DNS hostname solicitation: [Question { qname: Name("vortex.data.microsoft.com"), prefer_unicast: false, qtype: A, qclass: IN }]
2022-12-05T22:31:02.360230Z  INFO resovle-job: DNS hostname solicitation: [Question { qname: Name("vortex.data.microsoft.com"), prefer_unicast: false, qtype: AAAA, qclass: IN }]
2022-12-05T22:31:49.995939Z  INFO resovle-job: DNS hostname solicitation: [Question { qname: Name("az764295.vo.msecnd.net"), prefer_unicast: false, qtype: A, qclass: IN }]
2022-12-05T22:31:49.995939Z  INFO resovle-job: DNS hostname solicitation: [Question { qname: Name("az764295.vo.msecnd.net"), prefer_unicast: false, qtype: AAAA, qclass: IN }]
2022-12-05T22:31:52.202945Z  INFO resovle-job: DNS hostname solicitation: [Question { qname: Name("mobile.events.data.microsoft.com"), prefer_unicast: false, qtype: A, qclass: IN }]
2022-12-05T22:31:52.202945Z  INFO resovle-job: DNS hostname solicitation: [Question { qname: Name("mobile.events.data.microsoft.com"), prefer_unicast: false, qtype: AAAA, qclass: IN }]
2022-12-05T22:36:08.840137Z  INFO resovle-job: DNS hostname solicitation: [Question { qname: Name("nuc01.int.bny.woffenden.net"), prefer_unicast: false, qtype: AAAA, qclass: IN }]
2022-12-05T22:36:08.840137Z  INFO resovle-job: DNS hostname solicitation: [Question { qname: Name("nuc01.int.bny.woffenden.net"), prefer_unicast: false, qtype: A, qclass: IN }]

@Yarden-zamir
Copy link

I join the question, to me it seems the exact use for gh-net? Having the same issue though

@jacobwoffenden
Copy link
Author

@legomushroom just checking in to see if there are any others logs or diagnostics I can collect for you?

@zackerydev
Copy link

I'm getting the same issue, there is no routable traffic on the NAT side of the TUI

I've tried a bunch of workaround and downgrading gh-net but nothing is working...

FWIW I (and I think the original author of this issue) are just using GH net to access any resources private to our macbook, not just "local" ports.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working enhancement New feature or request needs-user-input p1
Projects
None yet
Development

No branches or pull requests

4 participants