I've successfully tried all these methods (got from other posts/questions) to get internet IP in Ubuntu but...
curl ipecho.net
curl ifconfig.me
curl ipecho.net/plain
curl ipinfo.io/ip
Output:
pi@raspberrypi:~ $ -Command here (any of 4 before curls)-
< html>< /html> pi@raspberrypi:~ $ (in the same line)
curl -s checkip.dyndns.org|sed -e 's/.Current IP Address: //' -e 's/<.$//'
Output (html code):
var hardwarePlatform = navigator.platform.toLowerCase();
var agent = navigator.userAgent.toLowerCase();
Etcetera
wget -q -O - checkip.dyndns.org|sed -e 's/.Current IP Address: //' -e 's/<.$//'
Output: nothing
wget -qO- http://ipecho.net/plain ; echo
Ootput (html code):
< ! DOCTYPE html>
< html xmlns="http://www.w3.org/1999/xhtml">
< head>
< meta name="csrf_token" content="/gRClgpBjNDPhyORm0miqmAlQJfxVmiQ"/>
Etcetera
EDIT: First thing I think is if those outputs are not IP numbers there would be a problem with internet connection (not related with RPi - off topic as stated by some users). Sorry.