Updating Public IP and/or Local IPs (set/update ip): Difference between revisions

From DXSpider Documentation Wiki
Jump to navigation Jump to search
EA3CV (talk | contribs)
Created page with "= Updating Public IP and/or Local IPs (set/update_ip) = == 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..."
 
EA3CV (talk | contribs)
Blanked the page
Line 1: Line 1:
= Updating Public IP and/or Local IPs (set/update_ip) =


== 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 <code>@main::localhost_names</code>, ensuring proper recognition of internal connections.
== Command ==
<code>set/update_ip <ip1> <ip2> ... <ipN></code>
== Usage ==
=== Basic ===
Run the command without arguments to update the public IPs (IPv4 and IPv6) and detect local IPs automatically:
<pre>
set/update_ip
</pre>
=== With local IPs ===
If your system uses a static local IP such as <code>192.168.1.100</code>, you should explicitly declare it:
<pre>
set/update_ip 192.168.1.100
</pre>
If you have more hosts (e.g., Docker containers, proxies, firewalls), list them all:
<pre>
set/update_ip 192.168.1.100 10.1.0.25
</pre>
This updates the <code>@main::localhost_names</code> variable to include those local IPs.
== Sample Output ==
If there are no changes:
<pre>
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
</pre>
If there is a change:
<pre>
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
</pre>
== Crontab Integration ==
If your node uses a '''dynamic IP''', it is recommended to run this regularly via cron. Add the following to your crontab:
<pre>
00,10,20,30,40,50 * * * * run_cmd("set/update_ip 172.18.0.3 172.18.0.4 192.168.1.10")
</pre>
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:
<pre>
cd /spider/local_cmd
mkdir -p set
cd set
wget -c [https://github.com/EA3CV/dxspider_info/blob/main/set/update_ip.pl update_ip.pl on GitHub]
</pre>
Then, you can run it from DXSpider shell:
<pre>
set/update_ip 192.168.1.100 10.1.0.25
</pre>

Revision as of 16:33, 7 April 2025