Skip to content
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

add ssh command to print device info #763

Merged
merged 7 commits into from
Apr 29, 2024
Merged

Conversation

kazzmir
Copy link
Contributor

@kazzmir kazzmir commented Oct 7, 2022

This PR adds a new ssh command device-info that responds with the name of the tun device, and the cidr of the tun. Example output:

name=tun0 cidr=192.168.200.13/24

I need the tun device name because I would like to monitor the network device using other programs, and since the tun device name is dynamic, querying nebula seems like the best way to get it. I actually don't need the cidr, but since its available on the Device interface it seems easy enough to print as well.

If this seems reasonable I can add a json flag like the other print-xxx commands. Also the name of the ssh command is negotiable.

@nbrownus
Copy link
Collaborator

Thanks for the PR! The name of the command seems fine and I believe the a json flag would be helpful if you don't mind adding it.

@kazzmir
Copy link
Contributor Author

kazzmir commented Feb 13, 2023

👍 ok will do soon

@kazzmir
Copy link
Contributor Author

kazzmir commented Feb 27, 2023

@nbrownus updated now.

$ ssh user@localhost -p 4000 device-info
name=tun0 cidr=10.0.100.8/24
$ ssh user@localhost -p 4000 device-info -json
{"name":"tun0","cidr":"10.0.100.8/24"}
$ ssh user@localhost -p 4000 device-info -json -pretty
{
    "name": "tun0",
    "cidr": "10.0.100.8/24"
}

@nbrownus
Copy link
Collaborator

@kazzmir looks good, mind signing the latest CLA?

@kazzmir
Copy link
Contributor Author

kazzmir commented Apr 29, 2024

Sure, where do I go to sign it? Its suprisingly hard to find. Maybe the main readme should have a link to the cla.

@nbrownus
Copy link
Collaborator

That is a wonderful question. A fresh commit might trigger the bot to prompt for it, I am searching for another solution in the mean time.

Copy link

Thanks for the contribution! Before we can merge this, we need @kazzmir to sign the Salesforce Inc. Contributor License Agreement.

@nbrownus nbrownus merged commit 7ed9f2a into slackhq:master Apr 29, 2024
7 checks passed
@kazzmir kazzmir deleted the device-info branch April 29, 2024 21:10
johnmaguire added a commit to DefinedNet/nebula-docs that referenced this pull request May 1, 2024
johnmaguire added a commit to DefinedNet/nebula-docs that referenced this pull request May 1, 2024
johnmaguire added a commit to DefinedNet/nebula-docs that referenced this pull request May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants