Smart way to get the public Internet IP address/geo loc

后端 未结 9 1975
野趣味
野趣味 2021-01-01 05:41

I have a computer on the local network, behind a NAT router. I have some 192.168.0.x addresses, but I really want to know my public IP address, not somethin

9条回答
  •  说谎
    说谎 (楼主)
    2021-01-01 06:27

    Depending on the router you use, chances are pretty good that you could get it directly from the router. Most of them have a web interface, so it would be a matter of navigating to the correct web page (e.g., "192.168.0.1/whatever") and "scraping" the external IP address from that page. The problem with this is, of course, that it's pretty fragile -- if you change (or even re-configure) your router, chances are pretty good that it'll break.

提交回复
热议问题