I created a script to change my A record at Cloudflare when my external IP is changing.
Lately though - the way I retrieve my external IP is not working... I am using this:
$curl -fs4 https://api.seeip.org/?
When I run that from a bash script or in terminal I am not getting the correct IP -
But if I run it from a web browser it returns the correct IP.
Use case:
- check external IP in web site: (directly on https://www.ipify.org - returns: "136.XX.XXX.XXX"
- From Terminal: $curl 'https://api.ipify.org?format=json' - returns "136.XX.XXX.XXX"
- Connect to VPN
- check external IP in web site: (directly on https://www.ipify.org - returns: "146.YY.YYY.YYYY"
- From Terminal: $curl 'https://api.ipify.org?format=json' - returns "136.XX.XXX.XXX" (same as original check before connecting to VPN)
Any ideas/how to fix - so that I'm retrieving the correct external IP???
Note: the 'service' doesn't change anything - have tried several...
Lately though - the way I retrieve my external IP is not working... I am using this:
$curl -fs4 https://api.seeip.org/?
When I run that from a bash script or in terminal I am not getting the correct IP -
But if I run it from a web browser it returns the correct IP.
Use case:
- check external IP in web site: (directly on https://www.ipify.org - returns: "136.XX.XXX.XXX"
- From Terminal: $curl 'https://api.ipify.org?format=json' - returns "136.XX.XXX.XXX"
- Connect to VPN
- check external IP in web site: (directly on https://www.ipify.org - returns: "146.YY.YYY.YYYY"
- From Terminal: $curl 'https://api.ipify.org?format=json' - returns "136.XX.XXX.XXX" (same as original check before connecting to VPN)
Any ideas/how to fix - so that I'm retrieving the correct external IP???
Note: the 'service' doesn't change anything - have tried several...
