Ability to expose all ports on fly.io machine?

Is there a way to expose all the ports on a fly.io machine?
I am working with a service that exposes random ports & can’t figure out to do this.
(I need more than 10, and they need to be direct mappings from internal to external)

Hi,

It looks like they support port ranges and so you could set start_port as 1 and end_port as 65535? Total guess. That would cover them all:

However … I’m not sure if you can set a mapping between that port and the internal_port. At least I haven’t seen an example of that being done. In theory you could manually list them all 1->1, 2->2, 3>3 and so on. It would be a giant fly.toml:

Is it possible to set start_point and end_point?I’ve thought about this too when I saw this question in the forum.

Also would you need to assign a dedicated ip address in order to expose custom ports?

Yep. To expose custom ports you need to assign a dedicated ipv4 address (I have no clue about ipv6) addresses.

You can use this cli command in the same dir of your app or with the -a flag:

fly ips allocate-v4

And confirm that you want to allocate a dedicated ip.

I also have seen that if you have ssl certs attached to your app & you try to call the app via it’s internal flycast / .internal (wireguard vpn) then it will throw ssl cert errors a ton, I am experimenting with removing the cert, might be some propogation error.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.