You need to provide range of ports on which mediasoup will work while creating mediasoup worker, and you must open these tcp/udp ports for public on server so that traffic can move through them, otherwise it will not work. In the new versions of mediasoup you can provide single port instead of port range and in that case you will still have to open that single port for public to make it work.