Skip to content

Instantly share code, notes, and snippets.

@kkroesch
Created July 13, 2016 12:45
Show Gist options
  • Save kkroesch/1ed7cd5956dd5ec020751ca59725be50 to your computer and use it in GitHub Desktop.
Save kkroesch/1ed7cd5956dd5ec020751ca59725be50 to your computer and use it in GitHub Desktop.
Figure out if your computer is behind NATing firewall.
INTERFACE=$(ifconfig en0 | grep 'inet ' | cut -f2 | awk '{ print $2}')
PUBLIC=$(curl -s http://ifconfig.co)
[ $INTERFACE = $PUBLIC ] || echo NAT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment