networking:ziggo:changed-ip
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| networking:ziggo:changed-ip [2025/09/04 16:03] – [IPv6 change] oscar | networking:ziggo:changed-ip [2026/08/30 06:48] (current) – oscar | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Changed Ziggo IP ====== | ====== Changed Ziggo IP ====== | ||
| - | ===== IPv6 change ===== | + | |
| + | ---- | ||
| + | ===== Introduction ===== | ||
| + | |||
| + | On the main OpenWrt router a sccript is running every 2 hours to detect a change in assigned IPv4 and IPv6 addresses. It compares the current system IP addresses with what is recorded in the DNS. Information about the installation, | ||
| + | |||
| + | ===== IPv4 Change - Actions ===== | ||
| + | When Ziggo change our IPv4 address. The following steps are required: | ||
| + | - Check via external website what our used IPv4 is | ||
| + | - Check if our router has this already new IP address: Network/ | ||
| + | - Update the TransIP A record with the new IP of the webserver | ||
| + | |||
| + | ===== IPv6 Change - Actions | ||
| When Ziggo change our IPv6 range/ | When Ziggo change our IPv6 range/ | ||
| The following steps are required: | The following steps are required: | ||
| Line 9: | Line 21: | ||
| Note that the routers IPv6 WAN address is different / outside of the Prefix Delegation (PD) range! | Note that the routers IPv6 WAN address is different / outside of the Prefix Delegation (PD) range! | ||
| - | ===== IPv4 change ===== | ||
| - | When Ziggo change our IPv4 address. The following steps are required: | ||
| - | - Check via external website what our used IPv4 is | ||
| - | - Check if our router has this already new IP address: Network/ | ||
| - | - Update the TransIP A record with the new IP of the webserver | ||
| - | |||
| - | ====== Monitor ====== | ||
| - | On the main OpenWRT router a script is running to monitor changed IP addresses. It compares the IPV4 and IPv6 address between: | ||
| - | * DNS as registered at TransIP with: nslookup -type=a | ||
| - | * IP address as observed by external websites, with: wget -4 --quiet -O - https:// | ||
| - | ===== OpenWRT prerequisites ===== | ||
| - | For sending notification email install the following package on the router: | ||
| - | mailsend | ||
| - | |||
| - | ===== ip-change-detect.sh ===== | ||
| - | The following script is created on main OpenWRT router: | ||
| - | < | ||
| - | # nano / | ||
| - | ------------------------------------ | ||
| - | # | ||
| - | # | ||
| - | # OdG 13/ | ||
| - | # | ||
| - | DNS_1=" | ||
| - | DNS_2=" | ||
| - | DNS_3=" | ||
| - | STATUS_V4=" | ||
| - | STATUS_V6=" | ||
| - | MAIL_FILE="/ | ||
| - | MAIL_HEADER=">> | ||
| - | | ||
| - | # Get the IPv4 DNS registrations & currenty used IP | ||
| - | IP4_DNS=$(nslookup -type=a | ||
| - | RESPONSE=$(wget -4 --quiet -O - https:// | ||
| - | RESPONSE=${RESPONSE: | ||
| - | IP4_1=$(echo $RESPONSE | cut -d . -f 1 ) | ||
| - | IP4_2=$(echo $RESPONSE | cut -d . -f 2 ) | ||
| - | IP4_3=$(echo $RESPONSE | cut -d . -f 3 ) | ||
| - | IP4_4=$(echo $RESPONSE | cut -d . -f 4 ) | ||
| - | IP4_CURRENT=$IP4_1" | ||
| - | | ||
| - | # Get the IPv6 DNS registrations & currenty used IP | ||
| - | RESPONSE=$(nslookup -type=aaaa | ||
| - | IP6_DNS=${RESPONSE: | ||
| - | RESPONSE==$(wget -6 --quiet -O - https:// | ||
| - | IP6_CURRENT=${RESPONSE: | ||
| - | | ||
| - | if [[ $IP4_DNS != $IP4_CURRENT ]] ; then | ||
| - | | ||
| - | fi | ||
| - | if [[ $IP6_DNS != $IP6_CURRENT ]] ; then | ||
| - | STATUS_V6=" | ||
| - | fi | ||
| - | #if [[ $STATUS_V4 == " | ||
| - | if [[ 1 ]] ; then | ||
| - | | ||
| - | echo " | ||
| - | echo " | ||
| - | echo " | ||
| - | echo " | ||
| - | echo "" | ||
| - | echo " | ||
| - | echo " | ||
| - | echo " | ||
| - | echo " | ||
| - | | ||
| - | mailsend -f root@openwrt -t oscar@oscardegroot.nl -smtp 192.168.178.83 -sub " | ||
| - | rm $MAIL_FILE | ||
| - | fi | ||
| - | | ||
| - | exit 0 | ||
| - | </ | ||
| - | ===== Crontab Scheduling ===== | ||
| - | Add the following line via the OpenWRT GUI (System/ | ||
| - | 0 0-23/3 * * * / | ||
| - | This runs the check every 3 hours between 0-23 hours every day | ||
networking/ziggo/changed-ip.1757001825.txt.gz · Last modified: by oscar
