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

Create a function to collect public interfaces from nodes that aren't aware of it #35

Open
angrycub opened this issue Mar 6, 2020 · 0 comments

Comments

@angrycub
Copy link
Contributor

angrycub commented Mar 6, 2020

There are a few techniques that could be used:

3rd party DNS

dig +short myip.opendns.com @resolver1.opendns.com
## or ##
dig TXT +short o-o.myaddr.l.google.com @ns1.google.com

Instance Metadata

AWS

curl http://checkip.amazonaws.com

Digital Ocean

curl http://169.254.169.254/metadata/v1/interfaces/public/0/ipv4/address

Azure

curl -H Metadata:true "http://169.254.169.254/metadata/instance/network/interface/0/ipv4/ipAddress/0/publicIpAddress?api-version=2017-08-01&format=text"

The DNS based scheme has the most general utility and could solve for all cases, but does require a third party (so it could vanish or change). The provider metadata route is the most encapsulated, but requires an implementation per provider (assuming that they provide instance metadata... a fairly safe assumption, but an assumption nonetheless)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant