I am running the following command on Ubuntu:
nc -l -p 5004 -v >> /home/anders/Dropbox/netcatFiles/test
which includes a command to make it listen at 5004.
I am sending a RTP-stream to port 5004 using VLC. When I am observing the loopback-interface in Wireshark I notice ICMP-packets with the message 'Destination unreachable'.
Opening another VLC and telling it to play the incoming data at port 5004, it all works, and the stream is played.
What should I do in order to get Netcat to listen at port 5004?
On one machine, you can tell netcat to listen to a specific port for connections. We can do this by providing the -l parameter and choosing a port: netcat -l 4444.
Install Netcat/NcatLinux and macOS users can quickly check if a port is open in the terminal with pre-installed Nc (and Netcat on Linux). Windows users will need to install Netcat's successor, Ncat, made by the Nmap project. Both are good for seeing if a specific port is open on a local network, VPN, or server.
The command nc –l will put Netcat into server or listening mode, and nc by itself will run Netcat in client mode.
Listen for UDP on specific host and port using netcat nc is the command alias for netcat. u Use UDP. That is, listen for UDP on give port, by default it listens for TCP unless we give this option. Port You must specify the port on which nc should listen on.
I think you need to add the " -u " parameter to make it listen on UDP.
By default, netcat works in TCP mode, but RTP protocol is UDP based.
"The Transmission Control Protocol (TCP), although standardized for RTP use,[5] is not normally used in RTP application because TCP favors reliability over timeliness. Instead the majority of the RTP implementations are built on the User Datagram Protocol (UDP)"
http://en.wikipedia.org/wiki/Real-time_Transport_Protocol
don't use -p (man nc (1))
-p source_port Specifies the source port nc should use, subject to privilege restrictions and availability. It is an error to use this option in con‐ junction with the -l option.
so just specify
nc -l 5004 -v >> /home/anders/Dropbox/netcatFiles/test
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With