Zum ermitteln der eigenen externen IP-Adresse verwenden viele Benutzer den Browser mit der URL https://www.wieistmeineip.de/.
Es funktioniert aber auch auf der Kommandozeile mit
curl ifconfig.co
![](https://linux-bibel.at/wp-content/uploads/2023/12/Curl_ipconfig-1.jpg)
Mit den Optionen -4 oder -6 kann man die Ausgabe der IPv4- oder IPv6-Adresse anfordern. Das funktioniert auch unter Windows und McOS. Die Option -6 funktioniert nur, wenn der Anschluss auch IPv6 unterstützt.
ifconfig.io hat eine ganze Reihe von Optionen (siehe http://ifconfig.co/). Hier ein paar Beispiele:
Country Code
curl ifconfig.io/country_code
DE
City
curl ifconfig.co/city
Berlin
Json
curl ifconfig.co/json
{
"ip": "84.159.0.180",
"ip_decimal": 1419706548,
"country": "Germany",
"country_iso": "DE",
"country_eu": true,
"region_name": "Land Berlin",
"region_code": "BE",
"zip_code": "10969",
"city": "Berlin",
"latitude": 52.502,
"longitude": 13.4041,
"time_zone": "Europe/Berlin",
"asn": "AS3320",
"asn_org": "Deutsche Telekom AG",
"hostname": "p549f00b4.dip0.t-ipconnect.de",
"user_agent": {
"product": "curl",
"version": "8.5.0",
"raw_value": "curl/8.5.0"
}
4 Reaktionen
Danke. Ohne Option erscheint als Ergebnis bei mir die IPv6-Adresse.
Um die IPv4-Adresse zu erhalten, müsste ich also eingeben:
curl -4 ifconfig.co
Rocki
Zur Sicherheit habe ich meine IP-Adresse gelöscht.
Probiere mal ifconfig ohne *.co
___________________________________________________________________________________
root@administrator-MS-7D82:/home/administrator# ifconfig
enp1s0: flags=4099 mtu 1500
ether xx:xx:xx:xx:xx:xx txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73 mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Lokale Schleife)
RX packets 14038 bytes 1218806 (1.2 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 14038 bytes 1218806 (1.2 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
usb0: flags=4163 mtu 1500
inet xxx.xxx.xx.xx netmask 255.255.255.0 broadcast xxx.xxx.xx.255
inet6 2a02:3032:209:bfa9:a112:4f12:c88a:f1a9 prefixlen 64 scopeid 0x0
inet6 2a02:3032:209:bfa9:88fd:9639:b285:e7d2 prefixlen 64 scopeid 0x0
inet6 fe80::6c89:b51f:3660:f0d6 prefixlen 64 scopeid 0x20
ether 92:0f:58:08:b4:93 txqueuelen 1000 (Ethernet)
RX packets 5313 bytes 5312874 (5.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5159 bytes 882502 (882.5 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
root@administrator-MS-7D82:/home/administrator#
___________________________________________________________________________________
Ich benutze IPv4 über Handy W-LAN USB Thetering.
Mit iptraf-ng kannst Du alle Verbindungen zum Netzwerk ansehen und welche verfügbar sind.
administrator@administrator-MS-7D82:~$ sudo su
[sudo] Passwort für administrator:
root@administrator-MS-7D82:/home/administrator# iptraf-ng
root@administrator-MS-7D82:/home/administrator#