Hello! So I self-host several things across many VMs and LXC containers. The self-hosted projects need to be accessible from the internet and so my way of doing that was to use iptables to say anything on port 3000 will get directed to the IP of the LXC container that had the project on port 3000 that needs to be accessible from the internet.
Sounds like a great idea. A Proxmox server directly on the internet, with a script that opens random ports for random self-hosted stuff in containers. I hope there’s no important data on this server and that it’s on a isolated network or in a DMZ, because sooner or later it’s going to get owned
Does anyone know of a better way to direct ports to go to certain IPs? Or maybe have a similar way to how in a docker container you can set the network mode to host? Thanks!
That's kind of the default, isnt it? I mean, by default, VMs and containers are connected to one or more Linux bridges, which in turn are accessible from the outside via the corresponding network interface. However, every container and VM needs its own IP address, and they cannot expose any services via the host’s IP like Docker containers can.
That said, you can configure NAT, routed networking, SDN overlays, VLANs, firewalling, etc., so not every VM/container necessarily needs to expose a directly reachable IP externally. However, in order for the experts here to help you with that, you’d probably need to provide more information about your network environment and the Proxmox network settings, firewall, SDN setup, etc.
My recommendation, though, would be to use a firewall in front of Proxmox, and, more importantly, to reverse proxy the requests to the appropriate ports rather than making them directly accessible from the internet. But maybe that’s just me.
