Skip to content

Instantly share code, notes, and snippets.

@narfel
Created February 13, 2020 20:38
Show Gist options
  • Save narfel/9c84ffc15f84ebbbbf4370a61cf383e7 to your computer and use it in GitHub Desktop.
Save narfel/9c84ffc15f84ebbbbf4370a61cf383e7 to your computer and use it in GitHub Desktop.
get ipv4 address cli ubuntu server
local:
hostname -I optional with | awk '{print $1}'
ip addr show (ip a)
ifconfig -a
ip route get 1.2.3.4 | awk '{print $7}'
nmcli -p device show
remote:
curl or wget -qO- <host>
hosts:
ifconfig.me
https://diagnostic.opendns.com/myip
http://checkip.amazonaws.com
ipinfo.io/ip
ident.me
icanhazip.com
ipecho.net/plain
bot.whatismyipaddress.com
api.ipify.org
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment