Please note that our official tutorials support Linux only!
Please make sure that you have completed the AnycastIP setup - anycast network configuration
In this tutorial, we will focus on stage two of the AnycastIP setup - the internal communication. This stage is crucial as it's responsible for sending data between our routers and your servers. AnycastIP requires a ZeroTier client to be installed. You can find the detailed instructions on ZeroTier official page.
Once the ZeroTier client is installed, you can verify its version and address by running.
zerotier-cli info
The expected output should look like the one below. Please note the ZeroTier address - a unique 10-character hex string, and the ZeroTier client version.
200 info 7876947140 1.16.2 ONLINE
Each of your servers is identified as a term node by our anycast platform.
Once the ZeroTier client is installed, download our setup script by running the following command:
wget -O connect2anycast.sh https://raw.githubusercontent.com/rage4/AnycastIP/main/scripts/connect2anycast.sh
Once the setup script is downloaded, you can register a new node. To do so, you will need network details from Step 1.
The setup script requires the following arguments:
bash ./connect2anycast.sh -u <Rage4 username> -p <Rage4 API key> -a <AnycastIP AS number> -r <AnycastIP location code>
The Rage4 username is the email address you use to log in to our control panel. The Rage4 API key can be found under API keys list. If you don't have one, please follow this tutorial on how to create one. The AnycastIP AS number can be found under network details. The AnycastIP location code can be found on our PoP list. For purposes of this tutorial, we will use London, UK, identified by the lon location code.
bash ./connect2anycast.sh -u office+tutorials@rage4networks.com -p bab...........8b2 -a 65018 -r lon
The script should respond with the following output:
OK: node has been added successfully.
Once the node is registered, it should be visible under the Network's node list.
The node's ZT address should be identical to the unique 10-character hex string returned by your server in one of the previous steps.
The total number of nodes you can connect to a single network is limited by the size of the private subnet assigned to it; currently, it is 255.
Since certain parts of the setup would require a user-friendly network interface name instead of the default one created by ZeroTier. Let's run the following command:
zerotier-cli listnetworks
The output shows that we are correctly connected to the anycast2_prod network, that the connection identifier is a80b1461811046f2, and that the connection is established using the ztzgfaij3t interface.
200 listnetworks <nwid> <name> <mac> <status> <type> <dev> <ZT assigned ips>
200 listnetworks a80b1461811046f2 anycast2_prod f2:3e:66:15:10:54 OK PRIVATE ztzgfaij3t 172.30.34.1/15,fd00:dead:c0de:cafe::2201/64
Now we need to copy the connection identifier, create the /var/lib/zerotier-one/devicemap file with the following content.
a80b1461811046f2=zt0
Once done, restart the zerotier-one service by running.g
systemctl restart zerotier-one
This will change the name of the network interface for this connection from ztzgfaij3t to zt0. We can validate the change by running the
zerotier-cli listnetworks
The output should show our new interface name.
200 listnetworks <nwid> <name> <mac> <status> <type> <dev> <ZT assigned ips>
200 listnetworks a80b1461811046f2 anycast2_prod f2:3e:66:15:10:54 OK PRIVATE zt0 172.30.34.1/15,fd00:dead:c0de:cafe::2201/64
If you need to verify the ZeroTier network access manually, run the following commands:
zerotier-cli listnetworks
The expected output should look similar to the one below. The OK PRIVATE part shows that the node is authorised and correctly connected.
200 listnetworks <nwid> <name> <mac> <status> <type> <dev> <ZT assigned ips>
200 listnetworks a80b1461811046f2 anycast2_prod f2:3e:66:15:10:54 OK PRIVATE ztzgfaij3t 172.30.34.1/15,fd00:dead:c0de:cafe::2201/64
The list of IP addresses should correspond to the one listed in our control panel.
Continue to the next step - AnycastIP setup - netplan and anycast IP addresses