networking:ziggo:changed-ip
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| networking:ziggo:changed-ip [2024/09/13 06:35] – created oscar | networking:ziggo:changed-ip [2025/09/04 16:03] (current) – [IPv6 change] oscar | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Changed Ziggo IP ====== | ====== Changed Ziggo IP ====== | ||
| - | ===== IP V6 change ===== | + | ===== IPv6 change ===== |
| - | When Ziggo change our IP range/ | + | When Ziggo change our IPv6 range/ |
| The following steps are required: | The following steps are required: | ||
| - Get the new IP address that our webserver assigned himself via SLAAC. | - Get the new IP address that our webserver assigned himself via SLAAC. | ||
| Line 8: | Line 8: | ||
| - On the router update: network/ | - On the router update: network/ | ||
| - | ===== IP V4 change ===== | + | 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.1726209303.txt.gz · Last modified: by oscar
