I'm resuming the discussion "Check if remote host/port is open - Can't use GNU Netcat nor NMap - RHEL 7".
I can't obtain the correct result because on my rh versions (5.6 and 7.1) there isn't the path /dev/tcp nor /dev/udp.
Here https://access.redhat.com/solutions/1214763 is explained that it can be resolved using
echo | nc -w1 $host $port >/dev/null 2>&1 ;echo $?
and it runs with TCP protocol only but not with UDP:
echo | nc -w1 -u $host $port >/dev/null 2>&1 ;echo $?
Indeed checking an inexistent service it ends with 0. Using the same ip and port on the RH 5.6 with the old option -z
nc -zu $host $port and it ends with 1, correctly.
Do you have an idea to resolve it?
Thanks