1 public IP with multiple containers and vm - Looking for outside access with domain names

kcdxb

New Member
Mar 23, 2020
3
0
1
39
Hello, I am completely lost to be able to achieve the following:

I currently have moved from a synology based system to a proxmox with the idea of having multiple containers and 1 vm running with various service (I believe that each container for a service would make more sense, less chances of breaking things).

- 1 vm outside work accessible
- 5 containers each with service, nextcloud, a website, a central mysql, onlyoffice etc...

I have 1 public static ip, with a usg (from unifi running all firewall and gateway)

I also have unifi running on a container, I have managed to get it to work via a reverse proxy from synology since its in the same network, however I am not sure I did it well,
And this is not the setup I wish to keep.

What I am looking to do is to have an ssh for files and terminal access for the host and each container,
Have each container and services accessible via its own domain without ports and also have letsencrypt renew certificates automatically. Which I cant do as it needs port 80 which is not accessible for each container (or so I think)

I also though of having 1 nginx container with reverse proxy running to do the job?

Additionally I am a complete newby on proxmox, with limited network knowledge.
 
  • Like
Reactions: Moayad
Thank you for your response oguz,
Will this work if I do this?
Also will I have to forward port 2222 manually to each host?

uto lo
iface lo inet loopback

iface enp0s31f6 inet manual

auto vmbr0
iface vmbr0 inet static
address 192.168.2.2
netmask 255.255.255.0
gateway 192.168.2.1
bridge_ports enp0s31f6
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o enp0s31f6 -j MASQUERADE
post-up iptables -t nat -A POSTROUTING -s '192.168.2.0/24' -o eno1 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.2.0/24' -o eno1 -j MASQUERADE
 
Also will I have to forward port 2222 manually to each host?
you will need to forward a different port for each port of container you want to access. you can do this with the pve-firewall on the GUI by adding a rule (or over the CLI with iptables)


try to do the /etc/network/interfaces config like it's on the wiki page i sent you.
 
Thank you, I am trying this,
Would you be able to give me a sample for the config of the firewall?
 
Would you be able to give me a sample for the config of the firewall?


something like this: iptables -t nat -A PREROUTING -i eth0 -p tcp --dport ${1} -j DNAT --to ${2}:${3}

where,

${1}: outside port
${2}: IP of CT
${3}: port of CT
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!