curl "http://fritz.box:49000/igdupnp/control/WANIPConn1" -H "Content-Type: text/xml; charset="utf-8"" -H "SoapAction:urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress" -d " " -s | grep -Eo '\<[[:digit:]]{1,3}(\.[[:digit:]]{1,3}){3}\>' Bei mir hat dieser Einzeiler funktioniert. mehr Info und ander Bashzeilen gibts hier: https://wiki.ubuntuusers.de/FritzBox/Skripte/