Install Cjdns Mesh Networking: Linux and Windows

A Short Intro to Cjdns

Internet connectivity has greatly magnified the power of individual self expression. It also has greatly magnified the ability of individuals to share, compare, combine, and debate information on countless subjects. It empowers people through virtual assembly on a massive scale. It connects people to traditional and non-traditional forms of media. Internet connectivity, however, is limited and imperfect in specific ways that limit its wider accessibility among large sections of the global population. Cjdns is a networking protocol which replaces the standard TCP/IP, was created by Caleb James DeLisle, which handily overcomes the most important flaws existing in how the internet functions. Cjdns decentralizes the infrastructure and improves security, scalability, and performace of networks.

Softrock SDR Radio
Cjdns running in Mint 17.3.

Much of the internet is currently very centralized: a few companies own infrastructure used by many, many people, who are subject to control, security, pricing, censorship, and management of the few companies. Legal battles over domain seizure, censorship, wiretapping, and net neutrality are all related to centralized control of the infrastructure. Cjdns puts ownership of infrastructure into the hands of network users - people with modest hardware who connect to others directly and through the internet. Nodes can be as simple as an inexpensive microcomputer with a wireless adapter (or a wireless router with cjdns software installed). Cjdns traffic is not throttled according to content, user identity, or pricing tiers.

Cjdns improves security by implementing both point to point and end to end encryption for traffic on the network. Network traffic is extremely resistant to surveillance, alteration, and censorship. Specifically, public key cryptography is used in multiple layers, ensuring authentic data and also making it quite impractical to accomplish man in the middle attacks.

As to scalability, cjdns assumes that non-hierarchical networks can grow to immense size and operate efficiently. Instead of requiring every node know the exact address of every other node, cjdns uses a distributed hash table to distribute the routing load among a number of nodes. Network nodes are specifically aware of other nearby nodes and generally aware of distant nodes. Packets are sent initially in the general direction of their destination; nodes nearer the destination direct data with more precision until the exact destination is reached.

Cjdns keeps things simple. When nodes are created, their addresses and cryptographic keys are created together. When two nodes find each other, they automatically connect. Multiple nodes automatically form a mesh network, and once a new node connects to any node on the network, it may access the whole network.

Cjdns can be characterized as the "deep internet" or a "darknet" since its content is not scanned and indexed by Google or other search engines. There are forums, web sites, email services, and such services not accessible exept through peer connections on cjdns based networks. Many are actually not so dark and mysterious - simply providing access using mesh networking. In fact, there are many different mesh networks using cjdns with users numbering in the thousands. Hyperboria is the largest mesh network, comprised of numerous smaller networks around the world. There are numerous urban and regional mesh networks such as the Santa Cruz Meshnet, Seattle Meshnet, Norfolk Meshnet, and NYC Mesh. These are just a few examples; there are meshnets around the world. Be aware that cjdns mesh networks do not offer inherent anonymity as provided by Tor, I2P, or other such networks. Data is encrypted and authenticated, but not anonymized.

CJDNS Mesh Network Equipment Considerations

Connecting to cjdns mesh networking nodes accessible via the internet requires no special equipment. Just install and configure the cjdns software and connect to the network via a public or private peers.

Setting up wireless mesh networking nodes requires modest hardware. Certain widely available wireless routers and bridges can be programmed to function as mesh nodes. Laptops with wireless adapters, microcomputers, and other similar devices can function as mesh nodes with proper wireless driver firmware. Here is a short list of examples:

Remember that the key to effective mesh networking is connecting to other mesh nodes, so make an effort to place the wireless nodes high and in the clear to achieve the longest range. The best wireless coverage is achieved with omni directional antennas in the areas to be served and separate nearby nodes with high gain antennas focused on other distant nodes. Conventional internet is a good backbone for connections to geographically distant nodes.

Installing Cjdns in Linux

Is only takes about ten minutes to install cjdns to a Linux system. It works nicely in systems with or without systemd. It works on stripped down, lightweight systems as well as heavy systems with plenty of magic and eye candy. Use "sudo" because of the work being done outside of the home folder, in "root" territory.

Note: Nodejs is a required dependency of cjdns. Some distributions include it, but some do not. It is suggested to install it from the normal repositories. If necessary, properly link it with this code, as cjdns looks for a binary called "node":

sudo ln -s /usr/bin/nodejs /usr/bin/node

Download the cjdns installation script from Github:

sudo wget -c https://gist.github.com/brightflash64/8abdbfb20bb0faa123f901e5438689bd/raw/cf426e0a21acb3d8180a69128ad529518c08995f/cjdns.sh -O /etc/init.d/cjdns

Make the script executable and install cjdns:

sudo chmod +x /etc/init.d/cjdns
sudo /etc/init.d/cjdns install

What happens next is that the script downloads the source code, compiles, and installs cjdns on the system. It will take a few minutes depending on the internet bandwidth and speed of the computer. It will ask you about entering peer information into the config file. If you have it, go ahead and enter it. To enter peers at a later time, stop the editor with [CTRL] + [X] and let the script finish running.

Note: If you have systemd in your Linux system, create a link for running it within that framework:

sudo ln -s /opt/cjdns/contrib/systemd/cjdns.service /etc/systemd/system/

Before starting cjdns, it is necessary to add peers to the config file. It is not mandatory that they be Hyperboria peers as used in this tutorial, but they should be cjdns peers properly formatted in json code. Copy peer information from Github - Hyperboria Peers, Meshwith.me - Hyperboria Peers, or Cjdns.me - Various Peers. Here is the format:

"ipv4 address:port": {
	//(optional) human-readable comments
	"password": "password to connect with",
	"publicKey": "remote node key.k",
	"peerName": "(optional) human-readable name for peer"
},

Paste the peer credentials into /etc/cjdroute.conf after the text "//Ask somebody who is already connected" and be sure to not inadvertently erase the "}" on the next line, following the peer credentials, which should end with "}," in json syntax.

Then, for a systemd machine, start cjdns with this command:

sudo systemctl start cjdns

Check the status of cjdns:

sudo systemctl status cjdns

Without systemd, start the newly installed cjdns software then check its status with these commands:

sudo /etc/init.d/cjdns start
sudo /etc/init.d/cjdns status

To see peer statistics, enter the peerstats command:

sudo /opt/cjdns/tools/peerStats

Some machines will not allow cjdns traffic through the firewall. For a system using Ulitimate Firewall (ufw),the fix is simple. Look in /etc/cjdroute.conf around line 76 for the udp port being used. It should resemble "bind":"0.0.0.0:". Note the port number and send a command to ufw to open it:

ufw allow /udp

Visit some sites not available on the clearnet: Social Node and Meshbits Forum.

If there is a problem on either kind of Linux system - systemd or no systemd - cjdns can be stopped with this code:

sudo killall cjdroute

There are multiple options for configuring a Raspberry Pi as a wireless mesh node. One method is to use a regular Raspbian image and manually install cjdns. Another is to install a pre-configured system, such as this one used by NYC and NFK Meshnets. Be sure to do a sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade when using old system images. Operating commands are similar to the ones above for Linux on other computers.

Installing Cjdns in Windows

Follow these steps to install cjdns on a windows system:

  1. Download the installer from its Github repository.
  2. Run the installer, clicking "Next" for each phase of installation.
  3. Copy peer information (json formatted credentials,separaded by commas) from Github - Hyperboria Peers, Meshwith.me - Hyperboria Peers, or Cjdns.me - Various Peers.
  4. Start "Cjdns for Windows".
  5. Select "Configure Cjdns".
  6. Paste peer credentials into the configuration after the text "//Ask somebody who is already connected".
  7. Save the configuration data.
  8. Visit some sites not available on the clearnet: Social Node and Meshbits Forum.

Cjdns is gaining quite a lot of traction as a method of mesh networking and better networking overall. There are many, many small networks operating around the world and Hyperboria is the largest mashup of nodes. The steps given above enable anyone with moderate skill to get aboard the next wave of internet expansion and help spread connectivity with security, scalability, and freedom offered by cjdns.



Tags: Cjdns, Mesh Networking, Hyperboria, Deep Internet, Darknet

©2005 - 2017 AB9IL, All Rights Reserved.
About, Contact Us, Links, Privacy, XML Sitemap, and HTML Sitemap.