Узнать свой внешний ipv4 из консоли Linux:
# curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
5.79.70.42
# curl -s checkip.dyndns.org | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}'
5.79.70.42
# curl ipinfo.io/ip
5.79.70.42
# curl v4.ident.me
5.79.70.42 |
# curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
5.79.70.42
# curl -s checkip.dyndns.org | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}'
5.79.70.42
# curl ipinfo.io/ip
5.79.70.42
# curl v4.ident.me
5.79.70.42
В том числе ipv6:
# curl icanhazip.com
2001:470:1f14:1327::2
# curl v6.ident.me
2001:470:1f14:1327::2 |
# curl icanhazip.com
2001:470:1f14:1327::2
# curl v6.ident.me
2001:470:1f14:1327::2
Или чтобы проще запомнить:
# curl v4.ifconfig.co
5.79.70.42
# curl v6.ifconfig.co
2001:470:1f14:1327::2 |
# curl v4.ifconfig.co
5.79.70.42
# curl v6.ifconfig.co
2001:470:1f14:1327::2