Skip to content

Instantly share code, notes, and snippets.

@vnavarro
Created October 11, 2016 02:00
Show Gist options
  • Save vnavarro/f8b79257d2bff54508467ef6f65474b1 to your computer and use it in GitHub Desktop.
Save vnavarro/f8b79257d2bff54508467ef6f65474b1 to your computer and use it in GitHub Desktop.
Get internal network ip on linux
#!/bin/sh
#From here http://askubuntu.com/questions/430853/how-do-i-find-my-internal-ip-address
#Also good reference http://askubuntu.com/questions/430853/how-do-i-find-my-internal-ip-address
#If using other mask than 8.8.8.8 change it here or pass it as param
ip route get 8.8.8.8 | awk '{print $NF; exit}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment