https://github.com/cycoresystems/netdiscover
Network discovery tool for cloud environments
https://github.com/cycoresystems/netdiscover
asterisk cloud cloud-providers go golang kubernetes networking voip
Last synced: 3 days ago
JSON representation
Network discovery tool for cloud environments
- Host: GitHub
- URL: https://github.com/cycoresystems/netdiscover
- Owner: CyCoreSystems
- License: apache-2.0
- Created: 2018-04-20T17:16:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-05-23T12:23:51.000Z (over 3 years ago)
- Last Synced: 2025-04-05T17:12:50.266Z (6 months ago)
- Topics: asterisk, cloud, cloud-providers, go, golang, kubernetes, networking, voip
- Language: Go
- Size: 19.5 KB
- Stars: 24
- Watchers: 7
- Forks: 19
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Netdiscover
[](https://travis-ci.org/CyCoreSystems/netdiscover) [](http://godoc.org/github.com/CyCoreSystems/netdiscover/discover)Netdiscover is a CLI tool and Golang library by which network information may
be discovered on various cloud platforms and bare metal installations. The
typical use case is, when running inside Kubernetes or a container, to discover
the public IP and/or hostname of the node on which the container is running.
This is commonly necessary to configure VoIP applications.## CLI tool
In the root directory can be found a CLI tool which can be used to query network
information. There are two options:* `-provider `: if a cloud provider is specified, that provider's
metadata services will be used to determine the network information.
Otherwise, a best-effort approach will be used.
* `-field `: if a field is specified, only that particular network
detail will be returned. Otherwise, a JSON object will be returned
containing all network information which was discovered.## Supported providers
Currently, this tool supports four cloud providers:
* `aws`: Amazon Web Services
* `azure`: Microsoft Azure Cloud
* `do`: Digital Ocean
* `gcp`: Google Cloud Platform
* ``: general discovery (baremetal)Not all providers support all network details. General discovery should be used
for baremetal or other unsupported environments. It will use the public service
(jsonip.io) to determine the necessary network data.I am happy to accept pull requests to implement more providers.
## Supported Fields
Currently, this tool supports four network data fields:
* `hostname`: the public hostname of the node
* `privatev4`: the private (internal) IPv4 address of the node
* `publicv4`: the public (external) IPv4 address of the node
* `publicv6`: the public (external) IPv6 address of the nodeNote that for DigitalOcean\'s hostname feature to work as expected, you need to
change the Droplet name to the fully-qualified domain name of the host. Doing
so will also cause DigitalOcean to register the reverse DNS lookup for the
Droplet\'s IP address, so this should generally be done, anyway.## Examples
Retrieve the public version 4 IP address of the node instance on GCP:
```
netdiscover -provider gcp -field publicv4
```Retrieve all network information on Amazon Web Services platform:
```
netdiscover -provider aws
```Retrieve the version 6 IP address of a baremetal machine:
```
netdiscover -field publicv6
```