How to check your public IP with curl
Use an HTTPS endpoint to discover the address a public server sees.
Use an HTTPS endpoint to discover the address a public server sees.
A router, VPN, or proxy may translate your address before traffic reaches the internet. A public endpoint reports the source address visible at the destination.
curl https://tools.vishow.info/ip
public_ip="$(curl --fail --silent --show-error https://tools.vishow.info/ip)"
printf '%s\n' "$public_ip"
Residential providers may assign dynamic addresses. Mobile networks can share addresses, and a VPN normally exposes its exit address.