ddclient (dynamic DNS) install & run script for Firewalla Purple

Comments

26 comments

  • Avatar
    Lynk

    Awesome job on this. Is this strictly for purple or editable for gold as well?

    0
    Comment actions Permalink
  • Avatar
    David Koppenhofer

    I imagine it would work on Gold, Gold+, Purple SE, and maybe even Blue & Blue+ since it's not docker. (Though I'm not sure if the Blues have the necessary scripting support.)

    0
    Comment actions Permalink
  • Avatar
    Tom Schmidt

    I can verify that this works fine with the Gold+. 

    I use it with Zoneedit, and the only change I had to make was to add a server attribute setting so that gets passed into the config file. 

     

    0
    Comment actions Permalink
  • Avatar
    Lynk

    Been using Shane's method for DDNS w/Cloudflare here:

    https://help.firewalla.com/hc/en-us/community/posts/1500001199002-Cloudflare-DDNS-Docker-Setup-on-FWG

    Since this method with ddclient is not docker, any benefits noticed running this on FWG?

    0
    Comment actions Permalink
  • Avatar
    David Koppenhofer

    @lynk

    I figure that spinning up a whole docker container just to send ddns info is overkill. If it works for you, then I see no problem though.
    Since Ubuntu has the ddclient package, I just used that. I already played with docker for home automation, so wanted to try a different method.

    0
    Comment actions Permalink
  • Avatar
    Skylar Ragan

    I noticed my DDNS wasn't getting updated this morning and when I SSH'd into my firewalla I manually ran this script and got the following output:

    ----- ddclient is already installed -----
    ----- configuring /etc/ddclient.conf -----
    ----- configuring /etc/default/ddclient -----
    sed: can't read /etc/default/ddclient: No such file or directory
    ----- enabling and starting ddclient service -----
    ddclient.service is not a native service, redirecting to systemd-sysv-install.
    Executing: /lib/systemd/systemd-sysv-install enable ddclient
    0
    Comment actions Permalink
  • Avatar
    David Koppenhofer

    @skylar

    Do you have a /etc/default/ddclient file? Maybe ddclient isn't installed fully for some reason. Or maybe you're on a different version of Ubuntu which doesn't behave like the version I developed this on.  Though it sounds like this was working for you at one point?

    0
    Comment actions Permalink
  • Avatar
    Skylar Ragan

    @david

    Nope, it doesn't appear that I do have /etc/default/ddclient. Looks like I'm on Ubuntu 18.04.3 LTS. I actually just recently got my Firewalla a few weeks ago and when I added this script initially, my ddns was already pointing at my home IP, so I didn't notice any issues until that IP changed. My previous firewall had DDNS support for Google OOTB, so I don't really have much experience with ddclient and wasn't sure if I was just missing a step or something.

    0
    Comment actions Permalink
  • Avatar
    Skylar Ragan

    I think I figured it out. I tried installing ddclient myself using the apt-get.sh script that firewalla provides instead of installing it with the script in the first place. After removing it and rerunning, everything seems to work properly now.

    0
    Comment actions Permalink
  • Avatar
    David Koppenhofer

    Maybe the difference is that I'm on Ubuntu 20.04.3 LTS, and apt-get works differently?

    At any rate, glad you got it working!

    Best,

    David

    0
    Comment actions Permalink
  • Avatar
    Skylar Ragan

    Well, the past 9 months everything's been running pretty smoothly, but yesterday I had a power outage and when everything came back on, I had a new external IP. That on it's own wouldn't normally be a big deal, but today I realized my DNS entries didn't update. I SSHd into my Firewalla, and it looks like the script is still working right, but when I ran:

    sudo ddclient -query

    I get the following error:

    FATAL:    Error loading the Perl module JSON::Any needed for cloudflare update.

    I realize this likely isn't an issue with the script so much as with either DDClient or maybe the Firewalla OS, but I was curious if anyone else using DDClient on their Firewalla has experienced this recently.

    0
    Comment actions Permalink
  • Avatar
    David Koppenhofer

    Hi @Skyler,

    I haven't had a problem, and have had power outages.

    I'm guessing that my OS has that PERL module installed, or possibly the ddclient code for my DDNS provider doesn't need it.

    0
    Comment actions Permalink
  • Avatar
    Shaun Sommer

    Hate to resurrect this, but I was trying to get DDClient working on my Gold+ with NOIP, but it could never get an IP. I tried editing the config file,  but it would never work. It is my first time trying ddclient, so maybe I am missing something?:

     

    0
    Comment actions Permalink
  • Avatar
    Skylar Ragan

    Oh, I should have updated this thread a couple weeks ago, but I ended up flashing a newer image on my Firewalla and after that, the script started working again. So it looks like it may have been an issue with Ubuntu 18.04.3 LTS

    0
    Comment actions Permalink
  • Avatar
    Skylar Ragan

    @Shaun,

    If you run the script manually, does it return an error? Or when you try to run ddclient on its own, like with the following command?

    sudo ddclient -query
    0
    Comment actions Permalink
  • Avatar
    Shaun Sommer

    I manually install with sudo apt install ddclient, go through the wizard. Once done I type ddclient, and it just says it doesn't find an ip. Let me retry the install to get more info

     

    0
    Comment actions Permalink
  • Avatar
    Skylar Ragan

    I ran into issues when I tried manually installing ddclient myself and found that it actually worked better after uninstalling and then letting the script install it on its own, but that was just my experience.

    0
    Comment actions Permalink
  • Avatar
    Shaun Sommer

    tried uninstalling ddclient and am attempting to use the script, but I am having issues getting it into the directory mentioned in the OP

    0
    Comment actions Permalink
  • Avatar
    Shaun Sommer

    Ok, finally got it working, will this auto run periodically?

    0
    Comment actions Permalink
  • Avatar
    Skylar Ragan

    The script itself will run at boot, ddclient should run every 30 minutes, unless you adjust the 'DD_INTERVAL' value near the top of the script

    0
    Comment actions Permalink
  • Avatar
    Shaun Sommer

    Ok cool, I did not alter anything except the stuff for my specific needs. So ddclient will run every 30 minutes, awesome, thanks!

    0
    Comment actions Permalink
  • Avatar
    Robert Cis

    Hi David Koppenhofer
    Thanks for you script, I've been using it since setting up my Firewalla Purple in Sept 2024.
    I don't often have any power outages or downtime due the UPS keeping the Firewalla running. However whenever there is a planned outage, I find that once Firewalla is back online ddclient is no longer installed (tested with sudo ddclient -query) and so my DDNS stays offline until I run the command via SSH to reinstall it.

    sudo ./ddns_script_firewalla.sh

    How can I ensure ddclient stays installed when Firewalla has a power outage?
    Some people have mentioned installing ddclient prior to running your script, is this the method or is there a setting I am missing to ensure ddclient continues to work after power outage/power cycling?


    My Firewalla purple is running 0.092209 build (Ubuntu 20.04.3 LTS kernel:4.9.241-firewalla)

    0
    Comment actions Permalink
  • Avatar
    David Koppenhofer

    Hi Robert,

    I'm running the same version, have had power outages, yet my ddclient works. 🤷‍♂️

    Did you put the script into the /home/pi/.firewalla/config/post_main.d/ directory so it runs on boot?

    0
    Comment actions Permalink
  • Avatar
    Robert Cis

    Hi David, 

    Yes, I have the script in the post_main.d directory see screenshot below.
    Are my permissions set correctly?

    One thing that is different is you have dot '.' in front of your firewalla folder name.
    Does this have any bearing on the result?
    Does the script name matter?

    Thanks in advance

    0
    Comment actions Permalink
  • Avatar
    Robert Cis

    After some sleuthing I've read that the dot in front of the user profile is important as its used for startup scripts amongst other things.
    I will let you know if this works.

    Update
    Moved the script to the /home/pi/.firewalla/config/post_main.d/
    with the dot in front firewalla path and the script now loads automatically on startup.

    Thanks David Koppenhofer

    1
    Comment actions Permalink
  • Avatar
    David Koppenhofer

    Fantastic, glad it's working for you now!

    0
    Comment actions Permalink

Please sign in to leave a comment.