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)
No edit summary
EA3CV (talk | contribs)
mNo edit summary
 
(6 intermediate revisions by one other user not shown)
Line 1: Line 1:


= Updating Public IP and/or Local IPs (set/update_ip) =
== Purpose ==


== 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.
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.


Line 11: Line 10:


== Command ==
== Command ==
<code>set/update_ip <ip1> <ip2> ... <ipN></code>
<code>set/update_ip <ip1> <ip2> ... <ipN></code>


Line 16: Line 16:


=== Basic ===
=== Basic ===
Run the command without arguments to update the public IPs (IPv4 and IPv6) and detect local IPs automatically:<pre>
 
Run the command without arguments to update the public IPs (IPv4 and IPv6) and detect local IPs automatically:
 
<pre>
set/update_ip
set/update_ip
</pre>
</pre>


=== With local IPs ===
=== 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>
 
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
set/update_ip 192.168.1.100
</pre>If you have more hosts (e.g., Docker containers, proxies, firewalls), list them all:<pre>
</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
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.
</pre>
 
This updates the <code>@main::localhost_names</code> variable to include those local IPs.


== Sample Output ==
== Sample Output ==
If there are no changes:<pre>
 
If there are no changes:
 
<pre>
No public IPv4 change: 2.2.2.2
No public IPv4 change: 2.2.2.2
No public IPv6 change:  
No public IPv6 change:  
No local IPs change: 127.0.0.1 ::1 172.18.0.3 192.168.1.10
No local IPs change: 127.0.0.1 ::1 172.18.0.3 192.168.1.10
</pre>If there is a change:<pre>
</pre>
 
If there is a change:
 
<pre>
Public IPv4 change: 2.2.2.2 → 1.1.1.1
Public IPv4 change: 2.2.2.2 → 1.1.1.1
Public IPv6 change:  
Public IPv6 change:  
Line 39: Line 58:


== Crontab Integration ==
== 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>
 
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")
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.
</pre>
 
This checks for changes every 10 minutes. You may prefer a 5-minute interval depending on your setup.


== Installation ==
== Installation ==
Save the script to the correct location:<pre>
 
Save the script to the correct location:
 
<pre>
cd /spider/local_cmd
cd /spider/local_cmd
mkdir -p set
mkdir -p set
cd set
cd set
wget -c [https://github.com/EA3CV/dxspider_info/blob/main/set/update_ip.pl update_ip.pl on GitHub]
wget -c https://github.com/EA3CV/dxspider_info/blob/main/set/update_ip.pl
 
</pre>
 
Then, you can run it from DXSpider shell:


</pre>Then, you can run it from DXSpider shell:<pre>
<pre>
set/update_ip 192.168.1.100 10.1.0.25
set/update_ip 192.168.1.100 10.1.0.25
</pre>
</pre>

Latest revision as of 17:37, 7 April 2025

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