Setup:

alias extip="dig +short myip.opendns.com @resolver1.opendns.com"
alias intip="ifconfig | grep 'inet ' | grep -v 127.0.0.1 | cut -d ' ' -f 2"

Usage:

$ extip
87.184.251.94

$ intip
192.168.2.101