Created
October 11, 2016 02:00
-
-
Save vnavarro/f8b79257d2bff54508467ef6f65474b1 to your computer and use it in GitHub Desktop.
Get internal network ip on linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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