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

IP Address is Wrong #8

Open
ghost opened this issue Jun 1, 2015 · 4 comments
Open

IP Address is Wrong #8

ghost opened this issue Jun 1, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented Jun 1, 2015

I only have IPv4 and not IPv6 so I'm not sure about IPv6, but the IPv4 is showing my internal IP given by my router and not the external IPv4 seen by everyone else. Maybe you could show the internal and external IPs or just fix the problem? I don't know, but it is kinda annoying since I also have a dynamic IP to actually see the new IP when it does change. Thanks!

@mdeboer
Copy link

mdeboer commented Jul 4, 2015

Normally NodeQuery is used on internet servers that are not behind a router thus showing the external IP already, same for ipv6.

It's simply reporting the ipv4 and ipv6 address of the NIC that's used to connect to the internet and no external request is used to determine the real external IP as that's the same with internet servers.

The reason why it won't make sense to do such a request to the internet to get your external IP behind a NAT is because if you have 10 servers, they'll all report the same IP. That's what NAT does, sharing one IP with multiple computers.

@Nedlinin
Copy link

Nedlinin commented Nov 7, 2015

👍 I think it's valuable enough information to have for those people not using NAT.

wget http://ipinfo.io/ip -qO -

http://askubuntu.com/questions/95910/command-for-determining-my-public-ip

Seems like a simple enough thing to implement into the agent collecting the data and would allow users to see their internal IP as well as their publicly facing IP.

@ghost
Copy link
Author

ghost commented Oct 16, 2016

@nodequery Could this be implemented to report all four addresses (Internal IPv4, External IPv4, Internal IPv6, and External IPv6)?

@phlinhng
Copy link

phlinhng commented May 17, 2020

Changing the 170th line of nq-agent.sh as the following works for me

ipv4=$(prep "$(curl -s https://api.ipify.org)")

This file can be found at /etc/nodequery/nq-agent.sh

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

3 participants