Quick start
In this setup you will know how to install an MCC node and a tunnel.
Prerequisites
A Debian/Ubuntu Linux based machine with Internet access. Other distributions are also possible however you may need to use another package manager. See here for more details.
Prepare a network certificate
Sign in to your Staex account or create a new one at https://cas.staex.io/. On the New network page of self-service portal create a new network certificate. You will get a private key of your network - save it for further steps. Also copy the network certificate.
Install the node
Install MCC client.
curl -o /tmp/staex-repo.noarch.deb \
https://packages.staex.io/linux/deb/staex-repo.noarch.deb
sudo apt-get install /tmp/staex-repo.noarch.deb
sudo apt-get update
sudo apt-get install mcc
Now you need to initialize the node with your network certificate. You will be asked for the network certificate and the private key of your network.
sudo mcc init --parents public.staex.io
sudo systemctl enable --now mcc
Check the logs to validate MCC is running:
sudo journalctl -u mcc
Example output would be:
Started mcc.service - Staex VPN daemon.
INFO [mcc::core::node] node id: gbkjnr7ydpj13bwjf8wcpwkemrnpfch0cfdtsvvgwpedjaa3we70
INFO [mcc::core::node] trying parent 88.99.68.57:9376
INFO [mcc::core::node] active parent is 88.99.68.57:9376
INFO [mcc::crypto::cas_client] network certificate `/etc/mcc/network-certificate.txt` has been updated
INFO [mcc::crypto::cas_client] network certificate `/etc/mcc/public-network-certificate.txt` has been updated
Setup a tunnel
The public node runs a simple HTTP service. Let's create a tunnel to it.
Here hello
is a name of the service, and s12d3qsn3qd0jaaj5rmrxv7rjfyshx9a87ede8455av7xrtmm5tg
is an ID of the public
node.
sudo mcc create-tunnel --role client --name hello --remote-node s12d3qsn3qd0jaaj5rmrxv7rjfyshx9a87ede8455av7xrtmm5tg
You will be asked for the private key of your network.
Example output would be:
server endpoint: f1t5y0mkhvw2s8nyrz7xbsa9jgmj0z38c6tr3drexs1wewjwdz0g
client endpoint: scmhygm53q3wkwpy82pnwn4915cth86dhrvy8mrrejtg905dpveg
Once the tunnel is created you need to wait 2-3 minutes until changes are propagated over the network.
Or you can run sudo systemctl restart mcc
to force it.
Use the tunnel
Let's try to resolve a tunnel address by its name:
mcc resolve hello
Example output would be:
10.83.0.2
Now you can use it to access the service:
curl http://hello.staex:8090