ubbitz
ubbitz
CDCloudflare Developers
Created by ubbitz on 4/16/2024 in #general-help
Cloudflare Tunnel for multiple LXC containers in Proxmox
I'm running into a problem where I can't get more than one active tunnel working at a time. I have Proxmox with various LXC containers (Jellyseerr, qBittorrent, etc.) I've installed Cloudflared LXC via script from tteck using
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/cloudflared.sh)"
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/cloudflared.sh)"
Add cloudflare gpg key with
mkdir -p mode=0755 /usr/share/keyrings
mkdir -p mode=0755 /usr/share/keyrings
&
curl -fsSL https://pkg.cloudflare.com/cloudflare-main.gpg | sudo tee /usr/share/keyrings/cloudflare-main.gpg >/dev/null
curl -fsSL https://pkg.cloudflare.com/cloudflare-main.gpg | sudo tee /usr/share/keyrings/cloudflare-main.gpg >/dev/null
Added this repo to my apt repositories:
echo 'deb [signed-by=/usr/share/keyrings/cloudflare-main.gpg] https://pkg.cloudflare.com/cloudflared buster main' | sudo tee /etc/apt/sources.list.d/cloudflared.list
echo 'deb [signed-by=/usr/share/keyrings/cloudflare-main.gpg] https://pkg.cloudflare.com/cloudflared buster main' | sudo tee /etc/apt/sources.list.d/cloudflared.list
Did
apt-get update -y
apt-get update -y
&
apt-get install -y cloudflared
apt-get install -y cloudflared
Log in Cloudflare via CLI:
cloudflare tunnel login
cloudflare tunnel login
Copy and paste cloudflare auth link into browser to get linked with my domain on Cloudflare side. Created tunnel with:
cloudflared tunnel create <tunnel-name>
cloudflared tunnel create <tunnel-name>
Take note of new generated tunnel ID Then cd into the cloudflared directory:
cd ./.cloudflared/
cd ./.cloudflared/
Then:
nano config.yml
nano config.yml
I add the following entry to config.yml file:
url: <container-one-ip>
tunnel: <tunnel-one-id>
credentials-file: /root/.cloudflared/<tunnel-one-ip>.json

---

# This entry is for setting up a second tunnel to other LXC container (This is where I think I'm going wrong, with the entries being separated by --- )

url: <container-two-ip>
tunnel: <tunnel-two-id>
credentials-file: /root/.cloudflared/<tunnel-two-id>.json

---
url: <container-one-ip>
tunnel: <tunnel-one-id>
credentials-file: /root/.cloudflared/<tunnel-one-ip>.json

---

# This entry is for setting up a second tunnel to other LXC container (This is where I think I'm going wrong, with the entries being separated by --- )

url: <container-two-ip>
tunnel: <tunnel-two-id>
credentials-file: /root/.cloudflared/<tunnel-two-id>.json

---
CTRL+X, y, ENTER to save to get back. Then:
cloudflared tunnel route dns <tunnel-name> sub.domain
cloudflared tunnel route dns <tunnel-name> sub.domain
Last:
cloudflared tunnel run <tunnel-name>
cloudflared tunnel run <tunnel-name>
The first time I do this, (when only one entry in the config.yml) it works and tunnel is healthy and active on Cloudflare. When doing this a second time for the next tunnel (and adding the new entry to .yml) it does not work. Any ideas?
11 replies
CDCloudflare Developers
Created by ubbitz on 4/6/2024 in #general-help
Connecting to Docker container via Cloudflare Tunnel
I’m running Proxmox, with a Debian based instance of Portainer. In Portainer I have a virtual network that I’ve created that’s being used by several containers I’ve deployed - radarr, sonarr, jackett, overseerr etc. I am trying to use Cloudflare Tunnel to access the web gui of overseerr. I get as far as cloudflare telling me that the connection is healthy in the tunnel configuration, but when I attempt to connect with my sub.domain, it gives me a 502 error. In my cloudflared instance on portainer, the log keeps throwing me this error: error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: read tcp 172.17.0.3:39944->xx.x.x.xx:5055: read: connection reset by peer" connIndex=1 event=1 ingressRule=0 originService=https://xx.x.x.xx:5055 I’ve redacted the container IP address. How can I go about connecting to my container via Cloudflare tunnel?
8 replies