Skip to content

Instantly share code, notes, and snippets.

@dlasher
Created April 22, 2025 22:31
Show Gist options
  • Save dlasher/04e48b7397f79327030b2e35191b7a92 to your computer and use it in GitHub Desktop.
Save dlasher/04e48b7397f79327030b2e35191b7a92 to your computer and use it in GitHub Desktop.
Juniper SRX DynDNS event config that works with any HTTP/HTTPS based updater service
set event-options policy dyn-dns-updater-1 events [ snmp_trap_link_up every-month ]
set event-options policy dyn-dns-updater-1 attributes-match snmp_trap_link_up.interface-name matches pp0.0
set event-options policy dyn-dns-updater-1 then execute-commands commands "file delete /var/tmp/dyndnsupdate.log"
set event-options policy dyn-dns-updater-1 then execute-commands commands "ping 1 count 20 interval 1 wait 1"
set event-options policy dyn-dns-updater-1 then execute-commands commands "file copy http://<USERNAME>:<PASSWORD>@dynupdate.no-ip.com/nic/update?hostname=<DNS-NAME> /var/tmp/dyndnsupdate.log"
set event-options policy dyn-dns-updater-1 then execute-commands output-format text
set event-options traceoptions file eventd size 1m world-readable
set event-options traceoptions flag all
##
## Tested with duckdns, tunnelbroker, and many others.
##
## Credit to : https://community.juniper.net/discussion/is-it-possible-to-use-no-ip-for-dynamic-dns
##
## to "fake" a test:
## admin@MySRX01> start shell
## %logger -e SNMP_TRAP_LINK_UP -a interface-name=pp0.0
##
## give it 60 seconds then:
## %cat /var/tmp/dyndnsupdate.log
## good 111.209.63.208%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment