Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
193 views
in Technique[技术] by (71.8m points)

windows - Why did my IP randomly start defaulting to IPv6 (and my private IP change)?

I am working on fixing a Javascript WebRTC script that gets my IP address (private, not public). It was working yesterday, then it didn't do anything at night and wasn't working this morning, and now all of a sudden it's working again. However, my private IP address seems to have changed. I do a lot of work with Javascript and Node.js, and one of the things I do with Node.js is host servers. Now, to have others be able to see that server, I need to give them my private IP. So, I have it memorized. (I'll write the first couple of digits: 10.0....). Now, when I went to run $ ipconfig in terminal (I'm on a windows), I'm getting another IP address. I checked my server, and sure enough, it's now on a new private IP, 192.16.... and it seems like my IPv6 is now my default IP. Is there a reason for this new switch? I didn't update my computer or anything like that, the switch happened as I was testing the IP tool.

Any explanation for this would be amazing. Thanks!

Edit:

Also, when I go to the IP2Location demo, it uses my IPv6, and it says I am in Washington, Seattle, when I actually am in Wyoming. What is going on here?

question from:https://stackoverflow.com/questions/65906390/why-did-my-ip-randomly-start-defaulting-to-ipv6-and-my-private-ip-change

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This happened to me a month ago. It was in the morning, my WiFi was having trouble, and so I switched my WiFi to a little AT&T WiFi box, and didn't think anything of it. However, I was testing my PHP server, and, although the server wasn't throwing any errors, my IPv4 private IP wasn't showing my server. I scratched my head for a couple of minutes, and then ran ipconfig. Sure enough, my IP had changed.

An IP address changing could be:

  • You moved locations
  • You changed your WiFi

and much more.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...