# MASQ CLI - Linux

## Getting started on Ubuntu

Command Line Interface testing is where we test the basic functionality and changes made by the developers. It can be a tricky and fiddly thing to master, it takes no prisoners for errors or mistyping and can be frustrating. Like anything, it takes patience and practice. Do not be put off by it, just keep at it and reach out to testers in Discord if you have issues.\
\
I have laid this document out as I do things. You may decide I do things in a stupid way or maybe I missed something. I’ve been doing this a while but I will endeavour to start it from the beginning to get you to a point where you can at least start the node (not fully functional) for testing purposes.

{% hint style="info" %}
If you have previously tested MASQ Node you need to DELETE ALL OLD NODE DATABASE FILES BEFORE you start again (node-data.db)
{% endhint %}

## Steps Outlined in this Guide

* [ ] Downloading latest stable Binaries from GitHub Actions
* [ ] Extracting them to your local disk
* [ ] Start the Command Line Interface (CLI)
* [ ] Initialize the MASQDaemon
* [ ] Setting Configuration for MASQ Node
* [ ] Starting `masq` Node Process

## Setting Up MASQ Binaries

Open the file manager and create a new folder named Masq in your home directory

![](https://lh3.googleusercontent.com/grpWmEz0x_mvfni_2GhR6jM5Gy6L3vjsiwBexc9NB7ePjZGM6D4M5mbbj4vxepytpP538Dyb2997Qsl0VO-sgZy0nge9Cn6uKW9kHgIXj3ASrBXGJNeO_Lsob7BS3ScFmcWY95VA=s0)

Download the Binaries for the Masq software:

{% embed url="<https://github.com/MASQ-Project/Node/actions>" %}

Binaries are different versions of the software that change each time a new feature or fix is added. The simplest way to get started it to pick a set of Binaries which show a green tick like this

![](https://lh5.googleusercontent.com/afvH3dN3SSlQBmRMpmCl6UiRYMMrkINtahb0pWOhiaimpEi3Era-ALPA0-x4QautZHcH6Gl8bAsHNXFYpk2hATzo_8qV4Bc5jD--7utkNzdeNC-7qZ48YFvvsnENpzX4fZ7PEuJO=s0)

{% hint style="success" %}
As of 15 Feb 2022, that last stable build in Actions can be found here:

<https://github.com/MASQ-Project/Node/actions/runs/1843245732>
{% endhint %}

Once you have clicked on a Binary you will see the Binaries for the 3 operating systems

We are using Ubuntu in this guide.

<img src="/files/0S5wDseHBeBaIws81m8r" alt="" data-size="original">

Click on the Ubuntu version and the download will begin.

Go to downloads and copy and paste the downloaded zip file into your previously created Masq folder. You should now have this<br>

![](https://lh5.googleusercontent.com/EGlau51aM-bBx-qXRr6wkHy_XBfvF7xJMdzio3cQCCLhUrp_l99XyRSS4ZihR6BSyVm0rVmmZTBtRtYRxmsJFXtnPswcbrIip4XiSQ1AC-5VNajJAHC7uLL8_FnmNLJZoHz6f4Wn=s0)

1. Right click the file and select extract here and you will get a folder named Build results ubuntu-latest go in the folder then generated and then bin and you will see this

![](https://lh4.googleusercontent.com/30a9HnUG9SVpvGBH0hdmdu_PlPMNfeRJrxuzyuhqA_P8bVUQfT61BocYVaaanZF87SXeBsmec3hYhL5asqsOyzodd_Vo6BaScV4YS3LBskzqVHoyshqp7-SWutjElwd9s5t8F1zU=s0)

These are the files you want for testing. Copy them and paste into your Masq folder.

You should see something like this

![](https://lh5.googleusercontent.com/1yC-dnYfrnn_EdL0PSbA3qRrul_YPZGuJVqRN2Jaen8vKnW9BIYcJKwSQPoUg3LWXJ5hDwczPD-ih0N9QzdA9hQyr73eLDwaR2znhVtLsGJxAj1L95BaOdy3sdDn7giVuxfxVOI7=s0)

Now we have the Binaries and we are ready to start using terminal

## Start the Commandline Interface (CLI)

Now right click anywhere in the folder to open the drop down box in there choose Open in terminal or alternatively you can press Ctrl + Alt + T to open the terminal.

![](https://lh5.googleusercontent.com/iy70JU6R3jL0RjQXdjTmuDPuhhbrkmEnLfZ8hFKiI1iObm2bCZzToZy_10pD49fI7nN9P38lXUwofWPVv1i9zD2rfcAUK-hARh9aKVDgiJOuxhE36qAjT9T3vmYFQibUG3rNJC6X=s0)

We are now in the terminal, it should show that we are in the masq folder, if you are not in the masq folder type cd Masq and it should bring you right into the Masq folder

![](https://lh3.googleusercontent.com/RQ8M7-saOzV9Wa9pyLYJMhEbGrmGt00rGXnOAaKHraFPUliZsM3V303oA51C_mZc1jIDg2ehyVyPebAn0jsGQa5AUjwaPKf7RPcxUzrc2e40t7jWbQbCEGgY6GV-yk-ZMkhfxFh6=s0)

### Give Execute Permissions to MASQ Binaries

{% code overflow="wrap" %}

```sh
chmod +x * # Give execute permissions to all masq files in the folder
```

{% endcode %}

Now it's time to start the MASQ Daemon (`MASQNode`):

* [ ] Execute `masqnode` by typing `sudo ./MASQNode --initialization` to start the daemon
* [ ] It may ask for your password, enter it to confirm

You should see this:

![](https://lh5.googleusercontent.com/5m0V6UWKS0jtReBqgm2dzybcQqbAdHXwdLgDTT4qAEeWxWv4mQMEvZ8Sy_o27sPVq7b9hcWo_l8GbOskEjscODqcL4pfCWUD2EewcXvy67PKgRhOOkk0lnlOLAi3ASXyA5Ft1Woe=s0)

Now open another terminal window **(do not close the daemon window)** in the same manner as before - here we will now start the `masq` interactive tool

* [ ] Execute the file by typing `sudo ./masq`
* [ ] It may ask for your password, enter it to confirm

We are now in **interactive mode** which shows a blinking curser after `masq>` and this makes your life easier (you can stay in standard mode but that requires a few more commands and you will get to know this as you test)

![](https://lh4.googleusercontent.com/H5USMq1s7R_5kcY3Ht-ryjeHV7RWyjgbIw7CF3eSeDTnwQBHQeWgDq3E8hpSmx2off3ZW3Ot6n6LspxzOsni_AMcHBvmEJX9wNkiyffimR5ef-M4Ob1mBM4OS8p_ROJw8z-qvWh2=s0)

Now type: `setup` and press enter

You are now in the setup mode where you can configure the nodes many settings

![](https://lh3.googleusercontent.com/BJF6NyhDKujXtMlCAzwebyHoX5zwwQqYadmg_9QUixmiQkBr78Qmwjo-64EalivfRxPONUPe3J7zwsi2CRNmrHmExKW2uUhitXvtFrykLBQN_grwWnM1EihxPh1rqS2N5EqtFxDJ=s0)

A breakdown of what these are and how you configure them can be found [here](https://github.com/MASQ-Project/Node/blob/master/README.md#run-masq-node-locally)

{% content-ref url="/pages/HitBoJ03LpBJOqMQB930" %}
[Configuring MASQ Node](/masq/advanced-use/masq-node-from-cli/configuring-masq-node.md)
{% endcontent-ref %}

{% hint style="info" %}
The above link shows there are several things you can configure. This guide will not be going through each one but will give you the easiest way to get CLI up and running and start a Node for testing with the minimum information required.
{% endhint %}

The above screenshot shows the following message:

```
ERRORS:
neighborhood-mode      Node cannot run as --neighborhood-mode standard without --ip specified
```

This is telling us to set a value for `ip` which in the most basic way can be supplied a value that satisfies the requirements, but does have to be your actual ip address for testing. Remember we are not setting up a fully functional Node, we are simply doing the basics to allow testing.

In order to specify a ip type `setup --ip 1.2.3.4`and press enter

You should see this:

![](https://lh3.googleusercontent.com/t65eTw3C3SkI5JiiIUhS_5rC5tXrdcbQrA3pBHNkmOlN6bbWBVruSLl9XNVBdwk1e350uR_TMMsAO42nR2chAsK_NaIfPmOBkz556gOT4wne--XzDWCfPGn4WRnvD0wF2HyKNxCm=s0)

\
This shows us the setup list again but now the **STATUS** alongside ip is `Set` to 1.2.3.4 and the `ERRORS` message has disappeared.‌

## Starting `masq` Node Process <a href="#starting-masq-node-process" id="starting-masq-node-process"></a>

We can now start the Node by typing… Wait for it. `start`

{% hint style="info" %}
`1.2.3.4` is not your real IP - you can find your real IP with the help of websites like <https://whatismyipaddress.com/>
{% endhint %}

If you have followed the guide correctly you should see something like this in the terminal window

![](https://lh6.googleusercontent.com/xeWbs2PoztzZyas8H-VLboSh-xjaherHkiFIPCRrOp_HJziGOm51kT8B1AV2w-ZxZSlbapT1qIovhUtiwJ8rbhZ7YtFQTVk9ldEEptEUApGby16ENMgVHb9Hk-Ac6TfmU8ImIh4T=s0)

You should also see some action on the Daemon CLI screen which we opened, started and then left alone.

**Congratulations you have taken the first step to testing on CLI!**\
\
There is much more to learn about parameters which can be found on the link provided earlier. If you would like to look around and make yourself familiar with things you can use the help commands which are available on 2 places as some things can only be done at certain stages:\
\
If you have not yet started the Node using `start`, you can use: `setup --help`

If you have started your Node successfully you can use : `help`

## Subverting DNS

To consume over MASQ Network you need to:

* **Proxy your browser** to 127.0.0.1:80 and 127.0.0.1:443 (this is for HTTP and HTTPS traffic) - preferred option
* Subvert your DNS to 127.0.0.1

To subvert your DNS, find your network adaptor settings (usually its in the system settings of your machine) and change your DNS from 'Automatic' to manually use 127.0.0.1

If you can disable IPv6 as an option is recommended to do this as well.

## Shutting down Node and Reverting DNS

The cleanly shutdown node, in your Node terminal (not the Daemon terminal), type `shutdown` in interactive mode, or `masq shutdown` from a terminal if you aren't in interactive mode.

Ensure that you revert your environment DNS back to Automatic or your default settings before you subverted them, or you will not regain connection to the internet.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.masqbrowser.com/masq/advanced-use/cli-startup-guides/masq-cli-linux.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
