Skip to content

Networking guide for the official router

Asgaror edited this page Oct 18, 2019 · 20 revisions

skywire logo

Official Networking Guide for the official Skyminer

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.

Table of Contents

Introduction

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.

Requirements in Hardware & Software

  • 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

Setup

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.

network_topology

Accessing the interface of the router

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: welcome_page

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: default_login_language

Choose the 2nd option in the drop-down menu and click on the right button.

change_language_dropdown

After that refresh the page, it should look like this:

changed_language

Port Forwarding rules

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:

choose_port_forwarding

Turn Port Forwarding on:

port_forwarding_offon

The screen you are now looking at looks like this:

port_forwarding_empty

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:

port_forwarding_rules

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.

Optional: assign static IP address for 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:

mac_address


Usage

Obtain IP Address within your home network

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.

network_topology

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):

  1. 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:

ip_address_skyminer

To do the following two steps you need to disconnect your computer from the Skyminer router and connect it to your home router.

  1. Login to your home router and go to 'Connected Devices', you'll see a device called 'myap', this is the Skyminer router.
  2. 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.

Viewing the Manager 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: manager_login_new_ui

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:

node_list_new_ui

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:

pubkey_appkey_new_ui

Click on 'Settings' in the node overview and verify the discovery address to which your node is connected to:

discovery_green_hook_new_ui

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.


Troubleshooting

Foundation: Method of Elimination

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.

Obtain the IP address through the web interface by opening a terminal (old UI)

Click on 'Terminal':

select_terminal

Confirm with the warning with 'Yes':

yes_terminal

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!

hostname

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.


Obtain the IP address through the web interface by opening a terminal (new UI)

Click on 'Terminal':

select_terminal_new_ui

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!

hostname_new_ui

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.


Resetting the router

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
Keep in mind that resetting the router removes any port forwarding rules you put in place.

reset_button


Node is running but not connected to the manager

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 root@192.168.220.146

ssh_connect

Type 'yes' to continue, then enter your password.

logged_in

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 root@192.168.0.3

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:

psaux_correct

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:

psaux_pid


Node is connected to the manager but the time under 'Started' keeps resetting after ~10 seconds.

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.


I can't change the subnet of my existing home network

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

Clone this wiki locally