Skip to content

Instantly share code, notes, and snippets.

@lauer
Created May 25, 2020 07:28
Show Gist options
  • Save lauer/c1f0d7932ae7c23cfc5a113317707bc6 to your computer and use it in GitHub Desktop.
Save lauer/c1f0d7932ae7c23cfc5a113317707bc6 to your computer and use it in GitHub Desktop.
Fast way to get External and Internal ip addresses
#!/bin/sh
echo "External: "
dig +short myip.opendns.com @resolver1.opendns.com
echo "Internal: "
ifconfig |grep inet | awk '{print $2}' |grep -v '127.0.0.1\|::1\|fe80::'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment