… would it be possible to make it so that I get my noip registered domain to point various instances on my server and I would not need to specify ?
Absolutely. This can be achieved by setting up a reverse proxy server. You can try to do the followings:
- Install and configure a reverse proxy server like Nginx or Apache to listen on port 80 and 443. You can either have it directly on the host or in a LXD instance. It’s up to you.
- Configure your noip registered domain to point to your reverse proxy server’s IP address.
- Set up virtual hosts in your reverse proxy server configuration file for each of your LXD instances, using subdomains like csgo.domain.com, rust.domain.com, ark.domain.com, etc.
- Configure each virtual host to proxy requests to the appropriate LXD instance based on the subdomain.
- Set up firewall rules using ufw on each LXD instance to restrict incoming traffic only to the necessary ports.
For the reverse proxy, here is a nice guide to set ip up: https://www.digitalocean.com/community/tutorials/how-to-use-apache-as-a-reverse-proxy-with-mod_proxy-on-ubuntu-16-04
Note: I don’t know your level of understanding of LXD but if you want a quick setup (not optimized for storage speed though), you can use lxd init --minimal
to bootstrap a parametrized LXD server. Once it’s done, you can just use lxc launch <image_name> <container_name>
to startup instances. These will automatically have an IP address and will be able able to communicate through the default network bridge lxdbr0
.
Note: Regarding the firewall with LXD, here is what you can do:
- Make sure that
ufw
is installed on the LXD instance (sudo apt install ufw
)
- By default,
ufw
is set to deny all incoming traffic and allow all outgoing traffic. We can change this behavior using the following commands:
sudo ufw default deny incoming
sudo ufw default allow outgoing
- Next, allow incoming traffic for the necessary ports depending on your application/server configuration. For example, if you are running an HTTP server on port 80, you can allow incoming traffic for that port using the following command:
sudo ufw allow 80/tcp
You can also specify the protocol (tcp
or udp
) depending on your application/server requirements.
- If you want to restrict incoming traffic to a specific IP address, you can specify the source IP address in the rule. For example, to allow incoming traffic only from the IP address of the reverse proxy server (if you type on your host
lxc list
, you should be able to see the IP address of your instance running the reverse proxy server), you can use the following command:
sudo ufw allow from <IP_ADDR_OF_REV_PROXY_INSTANCE> to any port 80/tcp
This will allow incoming traffic from IP_ADDR_OF_REV_PROXY_INSTANCE
to port 80, but block all other incoming traffic to that port.
- Once you have created the necessary rules, you can enable
ufw
using the following command:
sudo ufw enable
This will activate the firewall and apply the rules you have set up.
Hope it helped. Tell us a bit more about the settings you want to have if you have other questions 