1

Both client and server are Debian 11

On Server as root: nc -ulp 1194

On Client as root: nc -u serverip 1194

When I type something on client, in theory it should appear on the server right if no firewall is blocking the port 1194? Whatever I type on client, doesn't show up on the server. When I do nc -vzu serverip 1194 from the client, it says that the port is open. Why isn't the message is showing on the server side?

4
  • Is anything else already listening on UDP/1194? Can you use tshark to watch for relevant packets - on server and client? Have you checked for firewall rules, or a firewall between the two systems? Commented Oct 18, 2023 at 21:40
  • 1
    nc -uz sends a single byte as UDP and checks if it receives an ICMP error as reply: if it receives it will tell closed, if not open. But open just means "no ICMP error". There can be an UDP application listening, or packets dropped due to firewall or routing blackhole.
    – A.B
    Commented Oct 18, 2023 at 21:48
  • nc -uz is kinda useless if firewall is dropping packets. I tried with OpenVPN listening on server and without. In both cases nc shows 1194 open. I don’t have access to the firewall between client and server. I was told by network team that the ports are open bidirectionally. I am just looking from an OS point of view to see if they are open. Haven’t tried tshark. Nothing blocking in iptables. Commented Oct 18, 2023 at 22:36
  • I would strongly recommend you use tshark/tcpdump (or wireshark if you prefer the graphical interface) to check (a) that packets are being generated on the client, and (b) that said packets are arriving on the server. For example, tshark -i {interface} -f 'proto UDP and port 1194' as root Commented Oct 19, 2023 at 11:34

1 Answer 1

1

I was able to reproduce your issue with Ubuntu's netcat-openbsd v. 1.218 (a fork of the original netcat, with added IPv6 support).

The problem (on my machine) is that nc -ulp 1194 listens on all IPv4 addresses while nc -u serverip 1194 sends its datagram to the IPv6 address.

Solution: nc -4 -u serverip 1194 (the -4 option forces the use of IPv4)

3
  • The nc commands for Debian are correct. It was a network firewall issue. I can see nc messages from client to server now. Commented Oct 19, 2023 at 0:15
  • Additionally, on my Debian 11 machine, nc -4 -u serverip 1194 gives an error nc: invalid option -- '4' nc -h for help Commented Oct 19, 2023 at 0:40
  • @rocky_alpine You probably don't use netcat-openbsd but netcat-traditional. apt install the former.
    – xhienne
    Commented Oct 19, 2023 at 10:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .