Столкнулся с тем, что под Solaris awk не понимает нормально regular expressions. К примеру, квантор повторения {1,3} не работает. После гугления нашёл заметку:
The default awk on Solaris is old, broken awk which should never be used by anyone for any reason. nawk is much better than /usr/bin/awk but is still a very old, non-POSIX awk, and so does not support RE intervals. Almost any other awk will work. On Solaris if you don’t have and can’t install GNU awk then use /usr/xpg4/bin/awk as it’s very close to POSIX compliant and does support RE intervals.
В итоге, заработало в такой конструкции (gawk (gnu awk) + опция posix):
echo "test 1.1.1.1" | gawk --posix '{if ($2 !~ /^127.0.0.1/ && $2 ~ /^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]/) print $2 }'