Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Offical apps | Community apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Support
  3. Can't make app VPN protection work

Can't make app VPN protection work

Scheduled Pinned Locked Moved Solved Support
vpnnetwork
31 Posts 8 Posters 1.2k Views 7 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B
    B
    bazinga
    wrote last edited by
    #22

    Extension: Supporting Inbound Proxies (Xray / 3X-UI) to access VPN protected apps

    If you are running an inbound proxy server (like Xray via a 3X-UI panel) that connects to your OpenWrt router (e.g., as a client on an inbound wgserver tunnel like 10.4.0.3), Xray will naturally try to use its own application-layer routing and public DNS. This bypasses the router's PBR engine and triggers the "VPN connection required" block. To fix this, you must instruct Xray to natively map your Cloudron domains directly to the internal CGNAT/Docker IP address that your router's PBR engine is already intercepting.

    Step 1: Update the Xray DNS Config Template (3X-UI)

    1. Log into your 3X-UI panel and confirm DNS is enabled (Xray Configs -> DNS tab)
    2. Navigate to Xray Configs -> Advanced tab (or your core JSON configuration template).
    3. Locate the "dns" configuration block.
    4. Manually add a "hosts" mapping block right above your "servers" array, explicitly binding your app domains to the routed internal Cloudron IP (100.64.0.1):
    "dns": {
        "hosts": {
          "my-app.domain.net": "100.64.0.1",
          "my-other-app.domain.net": "100.64.0.1"
        },
        "servers": [
          {
            "address": "localhost",
            "port": 53,
            "skipFallback": true
          },
          {
            "address": "1.1.1.1",
            "port": 53,
            "skipFallback": false
          }
        ],
        "queryStrategy": "UseIPv4",
        "tag": "dns_inbound"
      }
    
    1. Click Save/Update Config and Restart Xray Service.

    Step 2: Ensure Router PBR Policy is Set to Catch-All

    On your OpenWrt router, make sure your policy rule seamlessly captures this traffic, regardless of whether it originates from a local LAN machine or your proxy's inbound tunnel interface IP (10.4.0.3).

    1. Open VPN Policy Routing screen.
    2. Verify or create a rule matching this exact profile:
      • Local Addresses / Devices: Leave completely blank (This creates a global catch-all rule for all local and tunnel interfaces).
      • Remote addresses / domains: 100.64.0.1
      • Interface: Select your outbound Cloudron WireGuard interface (wg_cloudron).
    3. Click Save & Apply.
    1 Reply Last reply
    0
    • B bazinga

      @nebulon Thanks for getting back to me yet again. Nothing custom, I do use DoT on my OpenWRT router, but that's all.

      With that said, after many hours of debugging and trying many different configurations, I seem to finally be able to access VPN protected apps without any hacks. Took me a while to discover 100.64.* subnet along with other things.

      The issue occurs because Cloudron’s per-app VPN protection verifies access by evaluating the client's source IP at the Nginx reverse-proxy level, which breaks when a central network router acts as a gateway and enforces NAT masquerading (Double-NAT).

      The solution that worked for me is to implement Split-Horizon DNS at the router level, forwarding the app's domain queries directly to Cloudron’s internal VPN DNS relay (seems to be 10.9.0.1 in my case), which allows traffic to ingress securely via the native WireGuard network interface layer without tampering with the original client packet structure. To make this work seamlessly, users must also ensure individual client devices do not bypass the router's DNS via encrypted Secure DNS features (DNS-over-HTTPS).

      Below I'll share the steps required to setup a router so that multiple devices are able to access these protected apps without needing to have VPN connection on each.

      One question: why did you guys opt for this VPN protection vs simply allowing users to define a white list of source IPs or domains from where the access would be allowed? Would be much simpler and not require the VPN hassle (no matter on an endpoint or a router).

      T
      T
      timka
      wrote last edited by
      #23

      @bazinga

      @bazinga said:

      One question: why did you guys opt for this VPN protection vs simply allowing users to define a white list of source IPs or domains from where the access would be allowed? Would be much simpler and not require the VPN hassle (no matter on an endpoint or a router).

      Well, someone requested it ^^. If I remember correctly ++

      1 Reply Last reply
      1
      • B bazinga has marked this topic as solved
      • necrevistonnezrN
        necrevistonnezrN
        necrevistonnezr
        Super Fan
        wrote last edited by necrevistonnezr
        #24

        Not everyone is on a fixed IP all the time (residential addresses, mobile networks, etc.)

        … but why not both? Open a request 🙂

        B 1 Reply Last reply
        0
        • necrevistonnezrN necrevistonnezr

          Not everyone is on a fixed IP all the time (residential addresses, mobile networks, etc.)

          … but why not both? Open a request 🙂

          B
          B
          bazinga
          wrote last edited by
          #25

          @necrevistonnezr "Not everyone is on a fixed IP" -> hence the "domain" part of my question. Dynamic dns does wonders. And if anyone wants to protect their traffic on open WiFi, then VPN'ing to your actual home/office/whatever, which in turn has its IP whitelisted, makes way more sense to me.

          1 Reply Last reply
          1
          • B bazinga

            @nebulon Thanks for getting back to me yet again. Nothing custom, I do use DoT on my OpenWRT router, but that's all.

            With that said, after many hours of debugging and trying many different configurations, I seem to finally be able to access VPN protected apps without any hacks. Took me a while to discover 100.64.* subnet along with other things.

            The issue occurs because Cloudron’s per-app VPN protection verifies access by evaluating the client's source IP at the Nginx reverse-proxy level, which breaks when a central network router acts as a gateway and enforces NAT masquerading (Double-NAT).

            The solution that worked for me is to implement Split-Horizon DNS at the router level, forwarding the app's domain queries directly to Cloudron’s internal VPN DNS relay (seems to be 10.9.0.1 in my case), which allows traffic to ingress securely via the native WireGuard network interface layer without tampering with the original client packet structure. To make this work seamlessly, users must also ensure individual client devices do not bypass the router's DNS via encrypted Secure DNS features (DNS-over-HTTPS).

            Below I'll share the steps required to setup a router so that multiple devices are able to access these protected apps without needing to have VPN connection on each.

            One question: why did you guys opt for this VPN protection vs simply allowing users to define a white list of source IPs or domains from where the access would be allowed? Would be much simpler and not require the VPN hassle (no matter on an endpoint or a router).

            P
            P
            p44
            translator
            wrote last edited by
            #26

            @bazinga said:

            One question: why did you guys opt for this VPN protection vs simply allowing users to define a white list of source IPs or domains from where the access would be allowed? Would be much simpler and not require the VPN hassle (no matter on an endpoint or a router).

            I tried to use Blocked IPs & ranges feature adding all IP’s list unless the specified IP but VPS became unresponsive.

            I agree to enable an allow list that, when enabled, blocks everything unless specific IP.

            1 Reply Last reply
            0
            • girishG
              girishG
              girish
              Staff
              wrote last edited by
              #27

              I think if we do a simple IP whitelist/blocklist, the onus is on the Cloudron admin to manage all this. Users come and go, move between places, have dynamic IPs etc. But sure, this can be added to, if it's seen as beneficial over VPN.

              P jdaviescoatesJ B 3 Replies Last reply
              3
              • girishG girish

                I think if we do a simple IP whitelist/blocklist, the onus is on the Cloudron admin to manage all this. Users come and go, move between places, have dynamic IPs etc. But sure, this can be added to, if it's seen as beneficial over VPN.

                P
                P
                p44
                translator
                wrote last edited by
                #28

                @girish said:

                I think if we do a simple IP whitelist/blocklist, the onus is on the Cloudron admin to manage all this. Users come and go, move between places, have dynamic IPs etc. But sure, this can be added to, if it's seen as beneficial over VPN.

                Vurrent VPN system is perfect and gives a certain level of granularity.

                1 Reply Last reply
                0
                • girishG girish

                  I think if we do a simple IP whitelist/blocklist, the onus is on the Cloudron admin to manage all this. Users come and go, move between places, have dynamic IPs etc. But sure, this can be added to, if it's seen as beneficial over VPN.

                  jdaviescoatesJ
                  jdaviescoatesJ
                  jdaviescoates
                  Super Fan
                  wrote last edited by
                  #29

                  @girish sounds like both options could be useful.

                  eg if there was a simple way to simply whitelist my own ip and block everything else, that probably would've been easier and quicker than setting up VPN access for dozens of apps (not that I did that, I just stopped all php apps).

                  Might've been useful when restarting the apps to update them too?

                  I use Cloudron with Gandi & Hetzner

                  1 Reply Last reply
                  1
                  • girishG girish

                    I think if we do a simple IP whitelist/blocklist, the onus is on the Cloudron admin to manage all this. Users come and go, move between places, have dynamic IPs etc. But sure, this can be added to, if it's seen as beneficial over VPN.

                    B
                    B
                    bazinga
                    wrote last edited by
                    #30

                    @girish If someone wants very complex setup - sure, they can opt for the VPN solution (even though I don't see that as a simple setup either). But whitelisting home / office IPs is very easy. Dynamic IPs are covered by dynamic dns.

                    VPN protection for bunch of users means every device needs a VPN (unless you go through the pain I've gone through), the server has to deal with many VPN tunnels, which isn't free either.

                    necrevistonnezrN 1 Reply Last reply
                    2
                    • B bazinga

                      @girish If someone wants very complex setup - sure, they can opt for the VPN solution (even though I don't see that as a simple setup either). But whitelisting home / office IPs is very easy. Dynamic IPs are covered by dynamic dns.

                      VPN protection for bunch of users means every device needs a VPN (unless you go through the pain I've gone through), the server has to deal with many VPN tunnels, which isn't free either.

                      necrevistonnezrN
                      necrevistonnezrN
                      necrevistonnezr
                      Super Fan
                      wrote last edited by
                      #31

                      @bazinga said:

                      @girish If someone wants very complex setup - sure, they can opt for the VPN solution (even though I don't see that as a simple setup either). But whitelisting home / office IPs is very easy. Dynamic IPs are covered by dynamic dns.

                      In particular, if we could update such whitelisted IP i.e. via cli (or have a default setting that the current IP of the main Cloudron domain is always whitelisted…)

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Bookmarks
                      • Search