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

Apps - Status | Demo | Docs | Install
  1. Cloudron Forum
  2. VPN
  3. Wireguard: "Patching" AllowedIps and interface PostUp

Wireguard: "Patching" AllowedIps and interface PostUp

Scheduled Pinned Locked Moved VPN
3 Posts 2 Posters 19 Views 2 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.
  • S Offline
    S Offline
    sirthias
    wrote last edited by sirthias
    #1

    Dear all,

    I've just set up a wireguard VPN server on my Cloudron instance and love the simplicity and instant success! Great stuff!

    However, I have one little question:

    One of my VPN peers is a MikroTik LTE router with a private subnet 192.168.99.0/24 behind it.
    After the VPN app is started I currently run the following two commands in the app's web terminal to make the nodes in the subnet behind the router reachable to all VPN peers:

    wg set wg0 peer <key> allowed-ips 172.26.99.3/32,192.168.99.0/24
    ip route add 192.168.99.0/24 via 172.26.99.3
    

    These two commands add the subnet 192.168.99.0/24 to the AllowedIps of the routers wireguard peer entry and add a respective route.
    This works great and everything functions exactly as it should.

    However, these changes get lost when the VPN app is restarted.
    In order to make them persist across app restarted I tried patching the /app/data/wg/wg0.conf file, but apparently this file gets regenerated on every app restart.

    Does anyone have an idea of how to best make these two tweaks permanent?

    Cheers
    Mathias

    1 Reply Last reply
    0
    • robiR Offline
      robiR Offline
      robi
      wrote last edited by
      #2

      Look for a start.sh or run.sh file which gets called on start.

      Conscious tech

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sirthias
        wrote last edited by sirthias
        #3

        Thank you, robi, I've seen /app/code/start.sh and it'd be a great place to put the needed changes, but this file is not in the /app/data/ folder and -- as such -- isn't writeable.
        It seems to me I have to somehow sneak something into /app/data/ as that's the only place I have influence over.

        One thought: Could I simply patch /app/data/wg/wg0.conf and chmod -r it to prevent it being rewritten on app restart?

        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