Last Updated on July 28, 2022 by Thiago Crepaldi
In this short post I will describe how to force your DDNS service to periodically refresh your IP on your pfSense. In theory, that should never be needed because when your WAN IP changes, DDNS service should notice it and update your IP on demand. However, I have notice my IPSEC tunnel never reconnected after a connection drop because of WAN IP changes that the DDNS service failed to detect and update. This seems to be recurrent with ISP that still uses PPPoE protocol, but really rare for anything else.
Make sure cron is installed on your pfSense. Go to System >> Package Manager and if cron is not listed on the Installed Packages tab, click on Available Packages tab, search for cron and hit Install. As always, wait for the installation to finish before leaving this page.
Creating a cron task
Visit Services >> cron and click on Add, fill in the time/frequency as needed and use the command shown below:
- Add a cron Schedule
- Minute: */15
- Hour: *
- Day of the Month: *
- Month of the Year: *
- Day of the Week: *
- User: root
- Command: /etc/rc.dyndns.update
Make sure you set the same User and Command above, but feel free to customize the other frequency settings for your own needs. On the example above, the DDNS service will be refreshed every 15 minutes. Click on Save and you are done.