Iptables Accept All From Specific Ip And Port
0
votes
1
answer
855
views
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:
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?
Asked by sahin
(1 rep)
Jun 30, 2021, 09:32 AM
Last activity: Jun 30, 2021, 12:25 PM
Last activity: Jun 30, 2021, 12:25 PM