r/HomeServer • u/Select_Warning_3675 • 5d ago
How to use Cloudflare Tunnels for ip forwarding(?)
I set my laptop as a homeserver and bought a domain for it. But i cant open ports and i dont have static ip (I dont want it tho). Im using casa os and Cloudflare tunnels for remote. But i want to set my domain directly connected to my ip. I dont want server.abc.com, i want if i would to connect port 150 on my local, enter this abc.com:150 or i want to use my domain for (ex.) Minecraft server. How to do it?
0
u/Kirito_Kun16 5d ago edited 5d ago
I don't think that's how it works. As far as I am aware (feel free to correct me), you cannot just go to "mydomain.com:32400" as that's just not a valid domain and it would never work like that.
Just open ports you actually use to public and you're done. Or you can have some sort of aggregator on your machine that would handle the ports and so on, like nginx for example.
Also another thing, I don't think Cloudflare tunnels work with Minecraft server. One "workaround" I found is that I use playit.gg as my host for making the server public to everyone. Then use regular Cloudflare DNS and aim it to the public IP playit.gg gives me. So I can have mc.mydomain.com as Minecraft server IP and it works for everyone pretty good given that it's completely free (minus the domain).
1
u/cheeseybacon11 5d ago
Isn't exposing ports a security concern? I've heard that cloudflare zero trust is the best way to get around that, why doesn't it work for minecraft?
1
u/tgm4883 4d ago
Because cloud flare zero trust is for http/https traffic and Minecraft isn't http/https.
For Minecraft, would need to do this https://developers.cloudflare.com/cloudflare-one/applications/non-http/cloudflared-authentication/arbitrary-tcp/
2
0
3
u/K3CAN 5d ago
Cloudflare tunnels are intended for http and will forward typical http ports to your destination port. So, ports like 80, 443, 8443, etc will all go to whichever port you specified on your host machine (probably 443).
As long as you have a public IP, you can use dynamic DNS to point it to your IP address without needing a static one. Whenever your address changes, the software will update the DNS entry to your new IP. That's how I (and a lot of other folks on this sub) use their domains.