Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reresolve DNS Periodically #130

Open
dshanske opened this issue Sep 20, 2022 · 1 comment
Open

Reresolve DNS Periodically #130

dshanske opened this issue Sep 20, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@dshanske
Copy link

I have a dynamic IP address on one side of a site-to-site connection between two edgeos devices. Every so often, I get a new address...usually during an outage, and I have to manually cycle things. The endpoints are configured with a hostname that is updated via dyndns. I'd like a way for it to reresolve on some sort of schedule as an option.

@dshanske dshanske added the enhancement New feature or request label Sep 20, 2022
@dc361
Copy link

dc361 commented Sep 20, 2022

How about using the Edgerouter task scheduler? You could set it up something like this: (note .. I saw this method on the net the other day to do another task so I tweaked it for this issue...)

cat > /config/scripts/peer-update.sh <<'EOF'
#!/bin/bash
echo "sudo wg set wg0 peer z-whatever-peer-public-key= endpoint a-host.on-the.net:56789" > /tmp/peer-update-result.txt
EOF

chmod +x /config/scripts/peer-update.sh

configure
set system task-scheduler task peer-update executable path /config/scripts/peer-update.sh
set system task-scheduler task peer-update interval 20m
commit ; save ; exit

The first part of the script sets up the script file (only needs to be done once initially and every time you update EdgeOS).
The "configure" section creates a task to run the script which gets called every 20 minutes in this example. The task also creates an output file (/tmp/peer-update-result.txt) that you can check periodically to make sure the script is working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants