Skip to content

feat(cli): add aws check to ping p2p diagnostics #14450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Aug 27, 2024

Continues to address #14244.

If the client or agent's public IP is within an AWS range, coder ping will now report that it is behind a hard NAT, which may impede forming a direct connection.

Additionally informs if the client or agent was unable to contact a STUN server over UDP, if the DERP map contains a STUN server.

Output format:

[...]
✔ Wireguard handshake 12s ago

❗ You are connected via a DERP relay, not directly (p2p)
❗ Network interface eth0 has MTU 1280, (less than 1378), which may degrade the quality of direct connections
Possible client-side issues with direct connection:

 - Reason 1
 
 - Reason 2

Possible agent-side issues with direct connections:

  - Reason 1
  
  - Reason 2

Copy link
Member Author

ethanndickson commented Aug 27, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @ethanndickson and the rest of your teammates on Graphite Graphite

@ethanndickson ethanndickson marked this pull request as ready for review August 27, 2024 09:07

// CheckIP checks if the given IP address is an AWS IP.
func (r *AWSIPRanges) CheckIP(ip netip.Addr) (bool, error) {
if ip.IsLoopback() || ip.IsLinkLocalMulticast() || ip.IsLinkLocalUnicast() || ip.IsPrivate() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't be given these IP classes in coder ping, but this is in case we ever wanted to re-use this util.

@ethanndickson ethanndickson force-pushed the 08-26-feat_cli_add_p2p_diagnostics_to_ping branch from df1bee7 to 9117628 Compare August 28, 2024 02:54
@ethanndickson ethanndickson force-pushed the 08-27-feat_cli_add_aws_check_to_ping_p2p_diagnostics branch from 41ab80f to a92e814 Compare August 28, 2024 02:54
@ethanndickson ethanndickson changed the base branch from 08-26-feat_cli_add_p2p_diagnostics_to_ping to graphite-base/14450 August 28, 2024 05:39
@ethanndickson ethanndickson force-pushed the 08-27-feat_cli_add_aws_check_to_ping_p2p_diagnostics branch from a92e814 to 15438e6 Compare August 28, 2024 05:39
@ethanndickson ethanndickson changed the base branch from graphite-base/14450 to main August 28, 2024 05:39
@ethanndickson ethanndickson force-pushed the 08-27-feat_cli_add_aws_check_to_ping_p2p_diagnostics branch 5 times, most recently from 461723e to 788ff3a Compare August 29, 2024 05:08
Copy link
Contributor

@spikecurtis spikecurtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, not necessarily in this PR, but part of this work is that every diagnostic check should have a corresponding page/section in our docs and we should include the link in the CLI output

a la

You are connected via a DERP relay, not directly, peer-to-peer (p2p).

Possible client-side issues with direct connection:

- We detected an endpoint firewall that could be blocking UDP from the agent.
  https://docs.coder.com/<whatever>

@ethanndickson ethanndickson force-pushed the 08-27-feat_cli_add_aws_check_to_ping_p2p_diagnostics branch from 788ff3a to 9ccec94 Compare August 29, 2024 08:17
@ethanndickson
Copy link
Member Author

ethanndickson commented Aug 29, 2024

New output format:

[...]
✔ Wireguard handshake 12s ago

❗ You are connected via a DERP relay, not directly (p2p)
❗ Network interface eth0 has MTU 1280, (less than 1378), which may degrade the quality of direct connections
Possible client-side issues with direct connection:

 - Reason 1
 
 - Reason 2

Possible agent-side issues with direct connections:

  - Reason 1
  
  - Reason 2

Fixing the test I broke...

@ethanndickson ethanndickson force-pushed the 08-27-feat_cli_add_aws_check_to_ping_p2p_diagnostics branch from e162ec9 to 2e08d19 Compare August 29, 2024 11:19
@ethanndickson ethanndickson merged commit 4b5c45d into main Aug 29, 2024
28 checks passed
@ethanndickson ethanndickson deleted the 08-27-feat_cli_add_aws_check_to_ping_p2p_diagnostics branch August 29, 2024 11:41
@github-actions github-actions bot locked and limited conversation to collaborators Aug 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants