/sbin/ifconfig | awk '/inet addr/ {print $2}' | awk -F: '{print $2}' | grep -v "^127.0." | grep -v "^192.168." | grep -v "^172.16." | grep -v "^10."
To consider all possible reserved IPv4 subnets you may refer to the following reference: Reserved IPv4 addresses.
UPD: Just found much easier and faster way
hostname --all-ip-addresses | grep -v "^192.168." | grep -v "^172.16." | grep -v "^10.
Немає коментарів:
Дописати коментар