netdiscover

command module
v1.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

README

Netdiscover

Build Status

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 <name>: 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 <name>: 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 node

Note 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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL