You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

185 lines
6.3 KiB
Markdown

## How To Setup A Lokinet Exit Node for "Normies" aka newbies aka non-developers.
_by: yidakee (aka @`super_duderino`)_
if you appreciate this tutorial and would like to buy me a beer, feel free to send some loki love
over to `L58ck1CcByFHaQu18c4YQg6UkH1vTX1SBKYL6ecRxY87if4iNKcBAH55GS9ahVt6hS6oLP7LC5TA1Lmdb8B8o5MuSyohRJ4`
#A Lokinet Exit Node is a next-generation onion routing service that works like a VPN.
It is similar to TOR or I2P, though a heck of a lot better.
You will be able to surf Lokinet as well as regular 'ol clearnet (the "real" main internet everyone uses) with complete state-of-the-art privacy and anonymity.
For example, if you are a TOR regular, you likely use a VPN for that extra protection against ISP snooping.
Well, now you can just use a Lokinet Exit Node for a vastly superior protection in comparisson to regular VPNs
You can find free Lokinet Exit Nodes around, although performance mileage may vary.
Alternatively, some super high performance Exit Nodes exist, where for a very small
fee you will be able to surf the entire internet with great performance. You can find
offers over at http://cafe.loki
Alternatively, you can run your own Exit Node!
This guide is intended for everyone out there who struggles with classic build instructions given by developlers.
What is terribly logical to them is often weird and alien to the rest of us.
The purpose of this tutorial is to give you an idiot-proof copy/paste procedure
that should work with virtually any VPS (virtual private server) running Ubuntu 18.04
or Ubuntu 20.04. Other flavours are likely to work, however not tested.
A Lokinet Exit is very CPU dependent. Be sure to buy a quality dedicated server, or a very high
quality VPS. Recommended is 2 or more cores, and 4GB RAM. RAM is not so important, but the
more cores with higher frequencies, the better.
Be sure to check their bandwidth limitations and your personal usage to avoid nasty surprises
come billing.
Alright, enough talk, let's get our hands dirty.
## Brief list of VPS poviders -
| URL | Specs | Bandwidth | Storage| Price/month |
| ------------- |:---------:| :--------:| :-----:| :--------------:|
| https://vultr.com | 2vCPU 4GB | 3 TB | 60GB | $20 |
| https://digitalocean.com | 2vCPU 4GB | 4 TB | 80GB | $100 Free Trial |
| https://www.hetzner.com/ | 2vCPU 4GB | 20TB | 40TB | 4,90€ |
| https://contabo.com/ | 4 CPU 8GB | Unlimited | 200 GB | 4,99€ |
| https://www.linode.com/ | 2vCPU 4GB | 4TB | 80GB | $20 |
| https://www.ovh.com/ | 2vCPU 7GB | ? | 50GB | $26.40 |
* Link to Digital Ocean free $100 Trial (must provide Credit Card) - https://try.digitalocean.com/performance/
* There are thousands of VPS providers out there, these are just "usual suspects" to help get you started.
* There are way better deals out there. duckduckgo is your friend.
* These are not suggestions for high preformance Exit Node VPS!
* Start by selecting a VPS provider, spin up a node selecting Ubuntu 18.04 or Ubuntu 20.04
## Initial server Setup
First off, the usual system update and upgrade. SSH into your server as root
````bash
apt update && apt upgrade -y
````
Next, we need to add some goodies.
We will likely add some redundant packages. However, given the evolution of Lokinet they may all not be required. Nevertheless, we'll add them just in case.
````bash
apt-get install -y gnupg gnupg2 policykit-1 htop build-essential cmake git libcap-dev curl libuv1-dev libsodium-dev libcurl4-openssl-dev pkg-config pkg-config gunicorn curl
````
Now we'll create a system user. Right now you are logged in as `root`, but typical linux good practice is to set up stuff as a user. You can use whatever name you want, but for this tutorial we will use a user called `user123`
````bash
adduser user123
````
You will be prompted for a password and some extra info. Select your pssword, but you can simply skip the extra info by pressing `Enter`all the way to the end.
Next, add user to sudoers list, and change from `root` over to `user123`
````bash
usermod -aG sudo user123
su - user123
````
Next, we'll install jagerman42's (aka Professor Podnocker, aka Jason) public keys that is used to sign binaries.
````bash
curl -s https://deb.imaginary.stream/public.gpg | sudo apt-key add -
````
Next, we'll find the packages
````bash
echo "deb https://deb.imaginary.stream $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/imaginary.stream.list
````
Now to resync package repositories...
````bash
sudo apt update
````
... and install Lokinet
````bash
sudo apt install lokinet
````
#Congrats!
Lokinet is now running in the background, but we're not done just yet. Lokinet is running
and you can already find your Lokinet address, but it will not be persistant in case of a service restart or server reboot. So let's go ahead and create a persistant Lokinet address.
Let's edit the file `lokinet.ini` and add an entry.
````bash
sudo nano /etc/loki/lokinet.ini
````
Copy the following and add to the `[network] section
````bash
keyfile=/var/lib/lokinet/exit.private
````
To save, press `CTRL+x`and confirm with `Y` and press `Enter`
Now, we can restart Lokinet, and it will create a persitant Lokinet address
````bash
sudo systemctl restart lokinet
````
You can check your Lokinet address by issuing this commands
````bash
dig @127.3.2.1 -t cname +short localhost.loki
````
# Final steps - Enable Exit Node functionality
We're almost there!
To enable Exit Node functionality, we need to go back and edit a few entries in `lokinet.ini` again.
````bash
sudo nano /etc/loki/lokinet.ini
````
If some settings are commented out, enable them by removing the `#`symbol at the beggining of the line`.
Carefully check and modify to these settings
````bash
[router]
min-connections=8
max-connections=16
[network]
exit=true
keyfile=/var/lib/lokinet/exit.private
reachable=1
ifaddr=172.16.0.1/16
hops=1
paths=8
````
To save, press `CTRL+x`and confirm with `Y` and press `Enter`
Finally, we need to create some `iptable` rules
Let's edit the file `/etc/rc.local` and add some stuff
````bash
sudo nano /etc/rc.local
````
Add This
````bash
#!/bin/sh
iptables -t nat -A POSTROUTING -s 172.16.0.1/16 -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
````