I faced with some strange nc behavior. It works well with TCP when on one host I do:
nc -tlp 31337and on the other one:
nc 14.0.0.1 31337 So there can be some data exchange.
But when I do:
nc -ulp 31337then
nc 14.0.0.1 31337fails with:
(UNKNOWN) [14.0.0.1] 31337 (?) : Connection refused
But there are no iptables rules on both listening and connecting sides.
P.S. nc version is v1.10-41
1 Answer
The connecting nc needs -u as well. Otherwise it tries TCP and finds no listening process for this TCP port. The last command should be:
nc -u 14.0.0.1 31337 0