Updating Public IP and/or Local IPs (set/update ip)

From DXSpider Documentation Wiki
Revision as of 17:37, 7 April 2025 by EA3CV (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Purpose

Keeping your DXSpider node's IP addresses updated is not optional—it is essential to ensure correct behaviour of announcements, spots, and cluster communications. Without this, there is a risk that outbound spots or announcements may be discarded by other nodes.

This internal command allows your DXSpider node to:

  • Automatically update its public IP address (IPv4 and IPv6) if it has changed (useful for dynamic IP setups).
  • Add custom local IPs (LAN, Docker, VM, etc.) to @main::localhost_names, ensuring proper recognition of internal connections.

Command

set/update_ip <ip1> <ip2> ... <ipN>

Usage

Basic

Run the command without arguments to update the public IPs (IPv4 and IPv6) and detect local IPs automatically:

set/update_ip

With local IPs

If your system uses a static local IP such as 192.168.1.100, you should explicitly declare it:

set/update_ip 192.168.1.100

If you have more hosts (e.g., Docker containers, proxies, firewalls), list them all:

set/update_ip 192.168.1.100 10.1.0.25

This updates the @main::localhost_names variable to include those local IPs.

Sample Output

If there are no changes:

No public IPv4 change: 2.2.2.2
No public IPv6 change: 
No local IPs change: 127.0.0.1 ::1 172.18.0.3 192.168.1.10

If there is a change:

Public IPv4 change: 2.2.2.2 → 1.1.1.1
Public IPv6 change: 
Local IPs changes: 127.0.0.1 ::1 172.18.0.3 192.168.1.22

Crontab Integration

If your node uses a dynamic IP, it is recommended to run this regularly via cron. Add the following to your crontab:

00,10,20,30,40,50 * * * * run_cmd("set/update_ip 172.18.0.3 172.18.0.4 192.168.1.10")

This checks for changes every 10 minutes. You may prefer a 5-minute interval depending on your setup.

Installation

Save the script to the correct location:

cd /spider/local_cmd
mkdir -p set
cd set
wget -c https://github.com/EA3CV/dxspider_info/blob/main/set/update_ip.pl

Then, you can run it from DXSpider shell:

set/update_ip 192.168.1.100 10.1.0.25