Last active
September 22, 2018 06:43
-
-
Save dcode/8cd4cb572af1bbd4295d6abb66152c98 to your computer and use it in GitHub Desktop.
Snippet to get local default interface IP using iproute
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
ip route get $(ip route get 1.1.1.1 | awk '{ print $3 }') | awk 'NR == 1 {print $5}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment