0

I want to accept all traffic that is coming from an IP address and its specific port to any of my ports.
Here is the configuration:
configuration

Details:
I am using Jitsi in a server, and I want to reach Jitsi from another server2 (client). Client has firewall on it, which blocks everything except https and ssh, by default.
Jitsi meet conference process (Without STUN, which allows peer to peer connection) goes like that:

  • Client sends a connection request from any of its port to the 10000th port of Jitsi.
  • Jitsi accepts the request to its 10000, and sends the answer to the port that the request comes from.
  • Client can't see the answer, since firewall has blocked it, because the answer came to a random port.

So I need to accept all traffic that comes from the IP of Jitsi server and its specifically port 10000 to any of my ports.

I tried to add these to rules.chains:

-A PREROUTING -s 10.0.0.1 --sport 10000 -j POLACCEPT

But it didn't work. It gave me error on systemctl restart netfilter-persistent.
By the way, I can see the incoming packets in tcpdump results, I guess this is because udp packets are coming and then iptables blocks them, but tcpdump may still be able to see them.

Is there a solution for this and what is it?

2
  • I edited @AdminBee But I solved at last, I will share in the answer Commented Jun 30, 2021 at 11:28
  • Thank you, and congratulations on finding the solution yourself. Commented Jun 30, 2021 at 12:45

1 Answer 1

0

The problem is, the protocol has the be specified.
-A PREROUTING -p udp -s 10.0.0.1 --sport 10000 -j POLACCEPT
line should work for this. The -p means protocol, it is now specified as udp.

According to the answer here: https://serverfault.com/questions/415717/setting-iptables-rule-for-all-protocols-for-specific-source-and-destination-port This is not permitted because, IP transport layer can have protocols that aren't tied to ports.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.