In Python, using the IPy module you can do the following:
>>> ip.iptype()
'PRIVATE'
Is there a library or easy way to do the equivalent in Java?
To check if your IP address is public, you can use myip.com (or any similar service). You will be shown the IP address that was used for accessing the site; and if it matches the IP address that your Internet service provider assigned you, then you have a public IP address.
Windows. Search for cmd in the Windows search bar, then in the command line prompt, type ipconfig to view the private IP address. Mac. Select system preferences, then click on network to view the private IP address.
Conclusion. 192.168. 1.0 is a private IP address used by many broadband routers to identify themselves to other devices on the same network. This IP address is not unique, any multiple routers can share it without any issues.
It seems that not exactly but InetAddress
has some isXX() methods like: isAnyLocalAddress()
and isSiteLocalAddress()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With