# Why it is needed to open TCP, UDP ports, given in rtcMinPort, rtcMaxPort, to make call.

**URL:** <https://mediasoup.discourse.group/t/why-it-is-needed-to-open-tcp-udp-ports-given-in-rtcminport-rtcmaxport-to-make-call/4054>\
**Category:** mediasoup libraries\
**Created:** [March 29, 2022, 8:31am UTC](https://mediasoup.discourse.group/t/why-it-is-needed-to-open-tcp-udp-ports-given-in-rtcminport-rtcmaxport-to-make-call/4054 "2022-03-29T08:31:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zaidiqbal](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/zaidiqbal/32/1498_2.png) [@zaidiqbal](https://mediasoup.discourse.group/u/zaidiqbal)\
**Post date:** [March 29, 2022, 8:31am UTC](https://mediasoup.discourse.group/t/why-it-is-needed-to-open-tcp-udp-ports-given-in-rtcminport-rtcmaxport-to-make-call/4054/1 "2022-03-29T08:31:40Z")

</div>

I am using 49152 - 65535 ports in rtcMinPort, rtcMaxPort. I was talking to the server guy and he said **that this is not recommended to open so much ports to public, as it cause security issues**.

So I wanted to know why it is needed to open all these ports to make call work. Is it designed that way or I am missing something? Kindly guide.

Previously I was working on a headless-browser based MCU approach and we didn’t open any ports to make call work.

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [March 29, 2022, 9:01am UTC](https://mediasoup.discourse.group/t/why-it-is-needed-to-open-tcp-udp-ports-given-in-rtcminport-rtcmaxport-to-make-call/4054/2 "2022-03-29T09:01:02Z")

</div>

We’ll refactor mediasoup because that server guy said that opening many ports is a security risk.

Please read the docs.

---

<div class="post-metadata">

**Author:** ![zaidiqbal](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/zaidiqbal/32/1498_2.png) [@zaidiqbal](https://mediasoup.discourse.group/u/zaidiqbal)\
**Post date:** [March 29, 2022, 9:27am UTC](https://mediasoup.discourse.group/t/why-it-is-needed-to-open-tcp-udp-ports-given-in-rtcminport-rtcmaxport-to-make-call/4054/3 "2022-03-29T09:27:48Z")

</div>

hmmm. Can you please point me in the docs where this is mentioned? I couldn’t find it in docs.

---

<div class="post-metadata">

**Author:** ![aetheon](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/aetheon/32/39_2.png) [@aetheon](https://mediasoup.discourse.group/u/aetheon)\
**Post date:** [March 29, 2022, 12:33pm UTC](https://mediasoup.discourse.group/t/why-it-is-needed-to-open-tcp-udp-ports-given-in-rtcminport-rtcmaxport-to-make-call/4054/4 "2022-03-29T12:33:05Z")

</div>

For enterprise usage theres things like TURN relay to workaround firewalls. A quick search around the subject will show you how.

---

<div class="post-metadata">

**Author:** ![zaidiqbal](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/zaidiqbal/32/1498_2.png) [@zaidiqbal](https://mediasoup.discourse.group/u/zaidiqbal)\
**Post date:** [March 29, 2022, 1:05pm UTC](https://mediasoup.discourse.group/t/why-it-is-needed-to-open-tcp-udp-ports-given-in-rtcminport-rtcmaxport-to-make-call/4054/5 "2022-03-29T13:05:51Z")

</div>

Yes that can be way to go but TURN will cause extra delays which might not be best way to go with for my use case. Was looking for something which is mentioned in this thread:

> [@Use only a single UDP port instead a big port range for media connection](https://mediasoup.discourse.group/t/use-only-a-single-udp-port-instead-a-big-port-range-for-media-connection/3328):
>
> Hello all, I’ve see how some media conferencing systems like Jitsi uses only a single UDP port for RTP traffic from browser to media server. In the [Jitsi deployment instructions](https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-quickstart#setup-and-configure-your-firewall) you can see as 10000 UDP port is enough for video/audio communications. Using only one port for UDP can be very useful when deploying a media server in Kubernetes (where exposing a big range of ports [is not practical](https://github.com/kubernetes/enhancements/blob/9ac8e907d884a0565a36ffc1f8331d85698bf7c7/keps/sig-network/2610-allports-services/README.md#summary)) or when using [AWS Global Accelerator](https://aws.amazon.com/global-accelerator/) service with several media servers deployed in an Autoscaling Gro…

---

<div class="post-metadata">

**Author:** ![jbaudanza](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/jbaudanza/32/1996_2.png) [@jbaudanza](https://mediasoup.discourse.group/u/jbaudanza)\
**Post date:** [March 29, 2022, 8:53pm UTC](https://mediasoup.discourse.group/t/why-it-is-needed-to-open-tcp-udp-ports-given-in-rtcminport-rtcmaxport-to-make-call/4054/6 "2022-03-29T20:53:09Z")

</div>

> [@zaidiqbal](#):
>
> I am using 49152 - 65535 ports in rtcMinPort, rtcMaxPort. I was talking to the server guy and he said **that this is not recommended to open so much ports to public, as it cause security issues**.

He’s right in the sense that if you’re exposing many ports that probably means you’re exposing many different services, each with their own risk of a vulnerability.

Mediasoup is just one service, however, that happens to use many ports. There’s no more or less risk than if it was binding to one port.
