I don't know too much about networking concepts, trying to get my public facing IP address programatically (powershell preferred)
Trying these different websites
- https://www.whatismyip.com/ # Only this one seems to work when I am trying to RDP into the machine (Azure NSG inbound rules)
- ipinfo.ipidea.io # this gives my modem/ISP address
- https://api.ipify.org/?format=json # this gives my modem/ISP address
- ifconfig.me/ip # this gives my modem/ISP address
Is there an alternative way to get the IP address shown by whatismyip.com website [for free]?
please don't go into "pay them you cheap pos"; It's a company project, and my boss man doesn't want to spend anything currently
I could use my local computer IP address, but we use a VPN (company wide), and hoping to get the address of this VPN provider
Edit: adding more clarity
I think I need the IP address of the VPN provider I am connected to. The browser/whatismyip is somehow able to get it. I need this address programmatically. Are there any free other APIs that provide this info?
Given you want to use Powershell,
you can try to invoke a Web request to the api.ipify.org
Or
The response will be your IP address.
If you want the VPN IP address, you can use the code below
To find the VPN connection name, assuming you are using Windows, you can check the VPN connections on the Network & internet settings.
More info here - https://support.microsoft.com/en-us/windows/connect-to-a-vpn-in-windows-3d29aeb1-f497-f6b7-7633-115722c1009c
Edited to include the option shared by @mklement0