Watching in real-time IPv4 network interface changes

Note: I ignore local loopback and virtual networks.  Your setup may be different.

watch -n 1 'ip addr | grep inet | grep -v inet6 | grep -v "127.0.0.1" | grep -v  192\.168\.76 | grep -v 172\.16\.  | awk '\''{print $2}'\'''

To include in your bash shell start up:

alias watchip='watch -n 1 '"'"'ip addr | grep inet | grep -v inet6 | grep -v 127.0.0.1 | grep -v 192\\.168\\.76 | grep -v 172\\.16\\.  | awk '"'"'\'"'"''"'"'{print $2}'"'"'\'"'"''"'"'  '"'"' '

Gotta love all those escaping quotes?!?!

This entry was posted in Linux, Networking. Bookmark the permalink.