Contents
What Is
A Public IP address is an IP address that is universally unique. (In IPv4 lingo, a class A, B, or C address in the PUBLIC ranges of addresses, versus PRIVATE ranges.)
Find Yours
To find out what is the public IP address of a network, the uplink / northbound interface of the router connecting to the Internet, there are many resources on the Internet that can help:
GUI, Web-based (Find One, For Default Gateway)
This method is great when someone asks for which you have, when someone is adding you to some site that uses public IP address as part of authentication and information security solutions.
- whatismyipaddress.com – nice,
- geolocation information INCLUDE MAP
- ISP, City, Region, Country
- support IP in path (most do, and all should do…)
- syntax (e.g.) https://whatismyipaddress.com/ip/136.50.144.204
- geolocation information INCLUDE MAP
- whatismyip.com/
- City, State, Country, Postal Code (not very good/precise), Time Zone (not very good/precise – wrong,…)
- iplocation.net/find-ip-address
- google.com/search?q=find+my+ip+address
- …
- keywords: findmyip findmyipaddress whatsmyip whatismyip, whatismyipaddress publicip publicipaddresss
CLI, Command Line (Scripts, For Many Interfaces)
- google.com/search?q=how+to+find+out+public+ip+address+from+command+line
- askubuntu.com/questions/95910/command-for-determining-my-public-ip
- curl https://ipecho.net/plain
- curl https://ipecho.net/plain ; echo
- curl https://checkip.amazonaws.com
- Yeah, there are of course many sites that can provide service to get public IP…
- List all available interfaces:
- ifconfig
- List which interfaces that are active:
- for i in $(ifconfig -lu); do if ifconfig $i | grep -q “status: active” ; then echo $i; fi; done
From one location (SATX), have multiple (2) public interfaces, one local and one via VPN:
mbp17:~ $ curl --interface en0 http://checkip.amazonaws.com/
136.50.145.111
mbp17:~ $ curl --interface en11 http://checkip.amazonaws.com/
185.236.41.131
From another location (ATX), with one public interface at this time, but doing some time comparisons:
mbp17:~ $ time curl --interface en0 http://checkip.amazonaws.com/ 183.174.114.213 real 0m0.119s user 0m0.005s sys 0m0.006s mbp17:~ $ time curl --interface en0 ifconfig.me 183.174.114.213 real 0m0.098s user 0m0.006s sys 0m0.006s
Another location
mbp17:~ $ time curl --interface en0 http://checkip.amazonaws.com/ 183.174.114.213 real 0m0.547s user 0m0.007s sys 0m0.008s mbp17:~ $ time curl --interface en8 http://checkip.amazonaws.com/ 183.174.114.213 real 0m0.320s user 0m0.006s sys 0m0.006s mbp17:~ $ time curl --interface utun8 http://checkip.amazonaws.com/ 193.32.210.122 real 0m0.538s user 0m0.005s sys 0m0.006s mbp17:~ $
##
mbp17:~ johan$ speedtest speedtest: Found 5 active interface(s) to work with ( en0 en7 en8 en15 utun8 ) Retrieving speedtest.net configuration... Testing from Spectrum (173.174.114.227)... Retrieving speedtest.net server list... Selecting best server based on ping... Hosted by Windstream (Dallas, TX) [280.46 km]: 21.379 ms Testing download speed................................................................................ Download: 114.53 Mbit/s Testing upload speed................................................................................................ Upload: 11.58 Mbit/s real 0m23.961s user 0m3.203s sys 0m2.640s 2021-10-28 08:44:13 CDT MBP17 en0 WiFi:jphm2_5GHz 192.168.0.167 Download: 114.53 Mbit/s Upload: 11.58 Mbit/s public_ip: 173.174.114.227 speedtest: interface en7 is LINK-LOCAL (169.254.100.108) - NOT handling for speedtesting Retrieving speedtest.net configuration... Testing from Spectrum (173.174.114.227)... Retrieving speedtest.net server list... Selecting best server based on ping... Hosted by Windstream (Dallas, TX) [280.46 km]: 18.408 ms Testing download speed................................................................................ Download: 8.18 Mbit/s Testing upload speed................................................................................................ Upload: 6.32 Mbit/s real 0m24.374s user 0m2.461s sys 0m1.278s 2021-10-28 08:44:38 CDT MBP17 en8 Ethernet 192.168.0.14 Download: 8.18 Mbit/s Upload: 6.32 Mbit/s public_ip: 173.174.114.227 Retrieving speedtest.net configuration... Testing from Spectrum (173.174.114.227)... Retrieving speedtest.net server list... Selecting best server based on ping... Hosted by Windstream (Dallas, TX) [280.46 km]: 21.481 ms Testing download speed................................................................................ Download: 7.85 Mbit/s Testing upload speed................................................................................................ Upload: 6.49 Mbit/s real 0m24.116s user 0m2.344s sys 0m1.240s 2021-10-28 08:45:02 CDT MBP17 en15 Ethernet 10.32.128.102 Download: 7.85 Mbit/s Upload: 6.49 Mbit/s public_ip: 173.174.114.227 Retrieving speedtest.net configuration... Testing from Hydra Communications Ltd (193.32.210.122)... Retrieving speedtest.net server list... Selecting best server based on ping... Hosted by Lightning Fibre Ltd (London) [6.55 km]: 121.404 ms Testing download speed................................................................................ Download: 85.02 Mbit/s Testing upload speed................................................................................................ Upload: 7.87 Mbit/s real 0m28.223s user 0m2.671s sys 0m1.703s 2021-10-28 08:45:31 CDT MBP17 utun8 (TBD) 10.5.0.2 Download: 85.02 Mbit/s Upload: 7.87 Mbit/s public_ip: 193.32.210.122 (DEFAULT ROUTE) mbp17:~ johan$