Ok, besides these general considerations, maybe I should be a bit more specific, in case someone can help on my specific use case…
I have a container hosting a WebRTC server (galene).
It uses the incusbr0 bridge network.
It embeds a TURN server listening on ports tcp 1194 and udp 1194 (so inside the container).
I also need to have the internet clients create WebRTC “tunnels” with Galène on the container (on a udp port range from 18100 to 19100).
What would be the way to achieve this ?
Proxy devices ? With nat=true or not ?
Network forward ?
Up to now on my server, I have mainly set up a proxy device on ports 80 and 443 to a container with Nginx acting as a reverse proxy to web sites. That was easy. WebRTC and TURN are more sensitive beasts for me
Sorry, there’s a typo at the earlier reply that I plus’ed. Here’s a full example.
We want to create an Incus container and redirect 100 ports from the host to 100 consecutive ports in the container. It is redundant to specify the range IN THE CONTAINER, therefore the syntax is to just specify the starting port in the container and Incus will fill up the rest of the ports.
We launch a container named myproxy, then add a proxy device called myrange to forward a range of ports. Then, we install a Web server in the container, and set it up so that it has several virtual hosts/server blocks on ports 80-85 (the myrange enables forwarding for the range of 80-180, 100 ports).
It does, indeed in the documentation this line is missing that possibility but in Device options it explicitly said for listen AND connect that you can write it that way :
The address and port to bind and listen (<type>:<addr>:<port>[-<port>][,<port>])
When you perform port forwarding, you can choose the direction of the forwarding using the bind option. Therefore, when you forward from the container to the host, you specify the range in the container and the starting port on the host.
In other words, you can specify a range and a destination starting port, but not a range to a range. I admit there should be some clarification. The docs use brackets when specifying the ranges which means they are technically correct.