You are currently viewing Ngrok – Port Forwarding Without Router
<span class="bsf-rt-reading-time"><span class="bsf-rt-display-label" prefix=""></span> <span class="bsf-rt-display-time" reading_time="3"></span> <span class="bsf-rt-display-postfix" postfix="min read"></span></span><!-- .bsf-rt-reading-time -->

Ngrok – Port Forwarding Without Router

Welcome to an all-inclusive tutorial covering the seamless integration and configuration of the ngrok tool within your system. Within these pages, you’ll discover a straightforward technique to activate port forwarding sans a router, all thanks to the ingenious ngrok tool. Let’s dive right in!

Introduction

Discover ngrok, the open-source tool designed to effortlessly unveil localhost ports to the expansive realm of the Internet. By ingeniously channeling TCP/IP traffic through a secure HTTPS connection via its encrypted proxy server, ngrok enables the exposure of any designated port on your computer sans the necessity of root privileges. Seamlessly unveil your local web server to the online domain by informing ngrok of the port your server is tuned to.

Easy to Install and Use

To get started, ensure you grab the newest ngrok edition from their official site. After downloading, use your preferred unarchive (I suggest 7zip) to extract the files. Open the folder where you unpacked the files, and launch the program. Just track the on-screen instructions, and you’ll have it installed hassle-free!

To run ngrok, run the following command:
$ ngrok HTTP 80

When you start ngrok, it will display a UI in your terminal with the public URL of your tunnel and other status and metrics information about connections made over your tunnel.

Configure ngrok 

After installing ngrok, navigate to the directory containing the ngrok binary. Open the configuration file at config.json in your preferred text editor. Edit the following settings:

  • `http_port` – The port number you want to expose.
  • `https_port` – The secure port number you want to use.
  • `external_interface` – The IP address you want to bind to.
  • `internal_ipv4` – The IPv4 address you want to bind ngrok to.
  • `external` – Whether you want to allow external connections. If set to true, ngrok listens on all interfaces. If false, only listen on the specified interface.
  • `auth_token` – An optional authentication token. If not provided, ngrok uses the default auth token.

Installing your Authtoken

Many advanced features of the ngrok.com service described in further sections require that you sign up for an account. Once you’ve signed up, you need to configure ngrok with the auth token that appears on your dashboard. This will grant you access to account-only features. ngrok has a simple ‘authtoken’ command to make this easy. Under the hood, all the auth token command does is to add (or modify) the auth token property in your ngrok configuration file.
$ ngrok authtoken <YOUR AUTHTOKEN>

Password protecting your tunnel

Anyone who can guess your tunnel URL can access your local webserver unless you protect it with a password. You can make your tunnels secure with the -auth switch. This enforces HTTP Basic Auth on all requests with the username and password you specify as an argument.
$ ngrok http -auth="username:password" 80
Your tunnel is now protected using HTTP auth. Noone’s spying on your business!

It has a dashboard

When you start up ngrok it shows you the URL you are tunneling through and another local URL, http://127.0.0.1:4040.The dashboard allows you to see the status of your tunnel, and the requests you have made through it, and the responses that came back from your application.

You can replay requests

Take a look again at that dashboard. Not only can you inspect requests that came through the ngrok tunnel, but you can also replay them. Now when you’re API endpoint is misbehaving, rather than sending another message and then another message until you get it right, you can just replay the incoming request from the dashboard.

Conclusion

So, this guide is about installing and configuring the ngrok tool. Now using the above steps you can enable the port forwarding on your local system without a router. Hope you like this cool trick, do share this trick with others too. Leave a comment below if you have any related queries about this.

Piyush Kumawat

Ethical Hacker || Penetration Tester || Gamer || Blogger || Application Security Engineer

Leave a Reply