0

I'm trying to port forward a connection to a rtsp live video feed within my local network. The connection starts over tcp but then (viewing with wireshark) a random udp port is attempted to be established by the video server but they never get to the computer trying to connect. I can view the stream on the host computer running iptables but port forwarding isn't working

For the image reference wireshark screenshot the client trying to connect is part of network 10.100.0.0, the host computer that is running iptables is 192.168.4.222 and the video server is 192.168.4.98 --- you can see at the bottom of the picture that video is starting to be sent to the host at port 55072 but it's not getting forwarded to the client

What am I missing in my iptables to get this connection going? here is relevant info from my iptables. eth2 is the network that connects to my computer.

*nat
-A PREROUTING -i eth2 -p tcp -m tcp --dport 12098 -j DNAT --to-destination 192.168.4.98:5554
COMMIT
*filter
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -s 192.168.4.98/32 -j ACCEPT
-A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
-A FORWARD -s 192.168.4.98/32 -j ACCEPT
COMMIT
Nisse Engström
  • 208
  • 2
  • 5
  • I'm not into RTSP - but following the [wikipedia](https://en.wikipedia.org/wiki/Real_Time_Streaming_Protocol) page, the client offers ports available to the server for the real time stream. So obviously, you should be able to configure your client to offer only ports which you have forwarded via iptables... – Martin Aug 13 '21 at 11:34

1 Answers1

0

Try adding a forwarding rule for udp as well

-A PREROUTING -i eth2 -p udp -m udp --dport 12098 -j DNAT --to-destination 192.168.4.98:5554

Val
  • 7
  • 1