Be Your Own Cloud code · PART 1 — RECON

Chapter 3 Networking Prerequisites: Static IPs, DDNS, and the CGNAT Problem

2 blocks · pp. 17–18 in the paperback

Checking Whether This Is Your Problem

# p. 17

Run Terminal, on the server or any machine at home
curl -4 ifconfig.me
# Compare this to the WAN IP shown on your router's status page.

Your Three Ways Around It

# p. 18

File ~/duckdns/duckdns-update.sh

Then chmod +x it.

#!/bin/bash
# duckdns-update.sh
echo url="https://www.duckdns.org/update?domains=yourdomain&token=YOUR_TOKEN&ip=" \
  | curl -k -o ~/duckdns/duck.log -K -
Crontab crontab -e (your user)
# Crontab, checking every 5 minutes:
*/5 * * * * ~/duckdns/duckdns-update.sh >/dev/null 2>&1

Reproduced exactly from Be Your Own Cloud, Chapter 3. The book explains what each line does and what to do when it doesn't work. About the book

Something here not working as the book describes? Tell the author.