How to forward traffic with ngrok?

ngrok is a special software that allows forwarding traffic through a public URL. It is really convenient for creating a public endpoint for any kinds of development as it is modern alternative to VPN. Our customers use ngrok when they want to help us with implementation of their ASIC machine. With ngrok you can open access to one machine for our tech team and close it when development is finished.

In this tutorial we will show you how to create access to one of your ASIC machines with ngrok.

Registration

First, you will need an account at ngrok, which you can get by registering.

minerstat - ngrok registration

You will receive confirmation e-mail to your e-mail address. Once you confirm your e-mail, you will need to find your access token. Navigate to Getting start > Your Authtoken and a website with your token will open up.

minerstat - ngrok Authtoken

Let's say that your authtoken TOKEN is

Ouwxsx4cAQVt0IIHDMU3TqRLHE7Jxdhz5id9srnjrqp27qQ8D

and your ASIC's local IP is

192.0.0.100

We will be connecting to:

192.0.0.100:80

Opening connection

Next step is to open connection through any device that you are more comfortable with and is in the same local network as your ASIC machine.

Windows

  1. Download ngrok for Windows from here.
  2. Unzip ngrok-stable-windows-amd64.zip
  3. Copy ngrok.exe to C:\Users\your_computer_username
  4. Press Windows key or navigate to search field and search for cmd.exe
  5. Press [Enter] to open CMD

To run ngrok enter the following two commands to your CMD windows.

ngrok.exe authtoken TOKEN
ngrok.exe http ASICLOCALIP:80

Real life example:

ngrok.exe authtoken Ouwxsx4cAQVt0IIHDMU3TqRLHE7Jxdhz5id9srnjrqp27qQ8D
ngrok.exe http 192.0.0.100:80

Raspberry Pi

Enter the following commands on your Raspberry Pi terminal:

sudo wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.zip
sudo unzip ngrok-stable-linux-arm.zip
sudo chmod 777 ngrok
sudo ./ngrok authtoken TOKEN
sudo ./ngrok http ASICLOCALIP:80

Real life example of last two lines:

sudo ./ngrok authtoken Ouwxsx4cAQVt0IIHDMU3TqRLHE7Jxdhz5id9srnjrqp27qQ8D
sudo ./ngrok http 192.0.0.100:80

If system asks you for password, you need to enter your computer's login password as device doesn't have sudo/admin rights.

Linux

Enter the following commands on your Linux terminal:

sudo wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
sudo unzip ngrok-stable-linux-amd64.zip
sudo chmod 777 ngrok
sudo ./ngrok authtoken TOKEN
sudo ./ngrok http ASICLOCALIP:80

Real life example of last two lines:

sudo ./ngrok authtoken Ouwxsx4cAQVt0IIHDMU3TqRLHE7Jxdhz5id9srnjrqp27qQ8D
sudo ./ngrok http 192.0.0.100:80

If system asks you for password, you need to enter your computer's login password as device doesn't have sudo/admin rights.

macOS

Enter the following commands on your macOS terminal:

sudo wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-darwin-amd64.zip
sudo unzip ngrok-stable-darwin-amd64.zip
sudo chmod 777 ngrok
sudo ./ngrok authtoken TOKEN
sudo ./ngrok http ASICLOCALIP:80

Real life example of last two lines:

sudo ./ngrok authtoken Ouwxsx4cAQVt0IIHDMU3TqRLHE7Jxdhz5id9srnjrqp27qQ8D
sudo ./ngrok http 192.0.0.100:80

If system asks you for password, you need to enter your computer's login password as device doesn't have sudo/admin rights.

Connection established

Once you establish the connection with last command, you should see similar response to:

ngrok by @inconshreveable (Ctrl+C to quit)
                                                                                                                                                                                                                                    
Session Status    online
Account           YourAccountName (Plan: Free)
Version           2.3.40
Region            United States (us)
Web Interface     http://127.0.0.1:4040
Forwarding        http://t569cymab2tb.ngrok.io -> http://127.0.0.1:80
Forwarding        https://t569cymab2tb.ngrok.io -> http://127.0.0.1:80
                                                                                                                                                                                                                                    
Connections       ttl  opn  rt1   rt5   p50   p90
                  0    0    0.00  0.00  0.00  0.00

The one under line "Forwarding" is the one you share with our team.

Forwarding        http://t569cymab2tb.ngrok.io -> http://127.0.0.1:80

The screen needs to be running while we are adding implementation.

Closing connection

Once we are done with the implementation, you can close the screen down with Ctrl+C and connection to your machine will be terminated.

Revolutionize your mining operation with minerstat

It's easy and free to get started. Monitor, manage, and optimize your mining rigs with our powerful platform.

Sign up for free now

ASIC