Networking guide for the official router - SkycoinProject/skywire GitHub Wiki
This guide assumes that you have read and understood the readme.md, downloaded the official images and do every step exactly the way it is described. Misconduct will lead to the inability to connect and to potential reflashing. It is very important that there is no IP collision with your existing home router subnet. The default settings of the official Skybian images, as well as the router of the Skyminer, are using the 192.168.0.0/24 subnet. Skybian images with custom IP configuration can be built using Skyflash.
After finishing off all the steps in this guide you will be able to access the manager's web interface from within your home network, access the devices in the subnet of the Skyminer router via SSH and of course, capable of using the SOCKS5 Skywire proxy.
The Skyminer router has 8 LAN ports, so during this guide, you will need to unplug one from the router to gain access with your computer, later on, you will have to plug it back in. Before you're starting with this guide please turn off all pi's, none of them need to run until you are being told to turn them on.
- Official Skyminer router. You are advised to flash the sd cards of the orange pi prime's with the official images, refer to the Skywire Installation Guide for instructions. Installation from source is outlined in there as well and works just as fine.
- Computer/laptop with LAN port
- LAN cable
Before you do the following steps make sure that there is no cable attached to the WAN port of the Skyminer router. Restart both the Skyminer router and your computer.
Connect your computer to a LAN port of the Skyminer router, it doesn't matter which one. Then open a browser window and type:
192.168.0.1
The router interface should come up, looking like this:
If you are queried to type in a password it is 'admin'. As you can see the default language is in Chinese, to proceed we need to change it to English. To accomplish this go the rightmost tab:
Choose the 2nd option in the drop-down menu and click on the right button.
After that refresh the page, it should look like this:
Now that the language is changed we can proceed and set up the necessary port forwarding rules to access the Skywire manager from outside the subnet of the Skyminer router (i.e. when you're not connected to one of its LAN ports).
Change to the port forwarding menu:
Turn Port Forwarding on:
The screen you are now looking at looks like this:
Now you need to add three port forwarding rules. Rule 1 will allow you to access the manager pi via ssh connection:
IP Address: 192.168.0.2
Protocol: TCP+UDP
Internal Port: 22
External Port: 22
Description: SSH
Click on 'Add', then proceed with rule 2.
Rule 2 will allow you to access the manager's web interface:
IP Address: 192.168.0.2
Protocol: TCP+UDP
Internal Port: 8000
External Port: 8000
Description: Manager
Click on 'Add' and proceed with rule 3.
Rule 3 will allow you to use the SOCKS5 proxy after establishing a connection within the Skywire network:
IP Address: 192.168.0.2
Protocol: TCP+UDP
Internal Port: 9443
External Port: 9443
Description: SOCKS5
Once all rules are added it should look like this:
This part is finished, disconnect your computer from the LAN port and plug the remaining pi back in. Now please turn off the Skyminer router.
Now that the configuration of the Skyminer router is finished you can specify a static IP for it inside your home router. This will add convenience once you want to view the manager and access the nodes during the testnet. To do this, you need to log into your home router (if you're not sure how to do this read this https://www.lifewire.com/how-to-find-your-default-gateway-ip-address-2626072).
Once you're in you can go to static leases or a similar term (located somewhere in LAN settings; highly dependent on your router model, this is a very broad description. Please download the manual of your router to get a detailed guide how to accomplish this) and assign the static IP lease for the Skyminer router. You will need the MAC address of the Skyminer router for this, you can find it on the 'Home'-page of the router interface or in your home router's web interface:
Now you need to plug in a cable into the WAN port of the Skyminer router going into a LAN port of your home router and turn on your Skyminer router.
To access the manager or any device within the subnet of the Skyminer router you need the IP that it got assigned by your home router. To obtain it you have 3 options (they increase in difficulty from one to three):
- Visit the Skyminer router interface and obtain the IP address from the 'Home'page. The IP is displayed under 'Internet -> Status', if you connected a LAN cable to the WAN port of the Skyminer router it will be displayed inside the red rectangle:
To do the following two steps you need to disconnect your computer from the Skyminer router and connect it to your home router.
- Login to your home router and go to 'Connected Devices', you'll see a device called 'myap', this is the Skyminer router.
- Use network scan software like for example nmap to scan the subnet of your home router. The following is an example for the 192.168.1.1/24 subnet
nmap -sP 192.168.1.1/24
Will give you all active devices within the subnet. If you aren't familiar with using the command line you can use the multi-platform tool Zenmap, which provides a UI for nmap.
Please note down the IP address, we'll need it to access the manager's web interface.
Please start the orange pi prime now, give them some time to boot up and wait for 10s in between in each pi after proceeding to start the next one.
Open a new browser window and type in the IP of the Skyminer router (not the local IP, the one assigned by your home router) and specify port 8000. The following is the URL if your Skyminer would be at 192.168.220.146 (is most likely different from yours)
192.168.220.146:8000
Looks like this:
Now you have to login using the default password '1234', which you must change immediately afterwards. Once you're done you should be looking at the node list:
The label in the red rectangle gives you an indication if your nodes are online or not. Nonetheless, you are advised to perform the necessary steps in this guide to ensure you are online.
PLEASE CHANGE THE DEFAULT PASSWORD OF THE IMAGES! To do this, open a terminal (see troubleshooting how to do this) and use the command passwd
.
By clicking on one of the displayed nodes you'll see a page looking like this, displaying the public key and the app key of the node:
Click on 'Settings' in the node overview and verify the discovery address to which your node is connected to:
Important: Please double-check that your nodes are online by following the steps outlined in the Online Status Verification Guide
Note: Using the described setup in this guide forces you to establish a connection ('Connect to Node') on the manager node to be able to use the Skywire SOCKS5 proxy because the port forwarding rule is only active for 192.168.0.2, which is the IP of the manager.
If you happen to be unlucky and not all 8 nodes will appear on the manager you can find here a couple of steps to troubleshoot the issue and find the renegade node.
Click on 'Terminal':
Confirm with the warning with 'Yes':
Now you can view a terminal looking like this:
To obtain the IP address just type in hostname -I
This is a capital 'i' and not an 'l' as in language!
As you can see the result is the IP of the node within the subnet of your Skyminer router. Please add labels to the manager's node list to quickly identify what nodes are missing. Keep in mind that the labels are stored in the cache of your router.
Click on 'Terminal':
Now you are viewing at a terminal window looking like this:
*To obtain the IP address just type in hostname -I
This is a capital 'i' and not an 'l' as in language!
As you can see the result is the IP of the node within the subnet of your Skyminer router. Please add labels to the manager's node list to quickly identify what nodes are missing. Keep in mind that the labels are stored in the cache of your router and are removed if you clean your browser cache.
Several different issues may require you to reset the router.
An example would be if the language doesn't change immediately don't panic, numerous people experienced this.
Try the following steps:
- Refresh the page
- Switch the language back and forth multiple times
- Clean your browser cache
- Try a different browser
- Reset the router with the factory reset button
If you can visually confirm that the orange pi prime is running by checking for the green and red led on board but it doesn't appear in the manager, please restart it first and see if it fixes the issue.
If not proceed as follows: Login to your manager pi to gain ssh access to the renegade pi. To do this, use putty or any other SSH tool, mac and Linux users can just use a terminal. The following screenshots assume that your Skyminer router has the IP 192.168.220.146 inside your home network, just replace it in the commands with the IP you obtained during executing the steps in 'Setup'.
In Linux type in ssh [email protected]
Type 'yes' to continue, then enter your password.
You should be looking at the screen shown above.
Now you are logged into the manager pi. This is because of the port forwarding rules we established in 'Setup' for port 22 (default SSH port) of the IP address 192.168.0.2, which is the IP of the manager.
You obtained the IP address of the pi that is not working by performing the steps in 'Foundation'. In the example, the IP of the pi that isn't working can be accessed via ssh by typing: ssh [email protected]
Same steps as above, type yes and enter your password. You are now logged into the renegade pi via SSH session. Please execute ps aux | grep node
to check if the node process is running properly. If everything is working correctly then it should look like this:
The 'grep node' process is the result of you searching for the process id, apart from that it wouldn't be running.
If the ./node process is not running you have two options, one is to reboot the pi since the process should autostart, the other is to manually start the script that launches the node process.
Executing the script by typing:
/etc/rebuild.sh
Please confirm that the process is running by typing
ps aux | grep 'node' | awk '{print $2, $11}'
The output should look like this:
Most likely you have started a ./node process manually, to fix it you need to kill the duplicate process. To do this you need to obtain the PID (process id).
Please type ps aux | grep 'node' | awk '{print $2, $11}'
This will display the PID along with the name of the process. You can quickly tell if there are two instances of the node process running by viewing the list. If there are two instances of ./node you need to kill the latter.
Kill the duplicate ./node process by typing:
kill PID
Confirm that it worked by checking the output of ps aux | grep 'node' | awk '{print $2, $11}'
again for duplicates.
If there are no duplicates this should fix the resetting 'Started' time. If there are duplicates left reboot the pi since the process could be locked and you're unable to kill it.
If you are unable to change the subnet of your existing home network you need to change the network settings of the images. It is explained in this section of the install guide