Difference between revisions of "Node Setup"

Jump to navigation Jump to search
(→‎Flashing the Firmware: Transclude instructions for flashing the radio)
 
(62 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Familiar with a terminal? This page will help you get your mesh node set up. You will first need to select a device and flash a firmware onto it - those instructions can be found on the device-specific page. Then, head back here to complete the rest of the set-up.
+
[[File:Full_Node_Diagram_(With_Labels).jpeg|thumb|A wireless mesh node consists of a "mesh node," "antenna," and an Internet connection. (Unless you're joining an existing neighborhood network, in which case you will connect to the Internet that way.)]]
 +
[[File:Full_Node_Setup_(realism).jpeg|thumb|An example wireless mesh node with tags to match up to the diagram. See [[#Assembly]] for more details.]]
  
== Communication Channels ==
+
In these instructions, we will cover how to deploy a mesh node that is privacy-enabled by default, and allows you to share an Internet connection with your neighbors. The whole setup process takes about 2 hours from start to finish. The necessary hardware is listed below, and instructions for everything from flashing the firmware to placing the antenna are covered.
Need help? Here's how to get in touch:
 
* [https://riot.im/app/#/group/+massmesh:matrix.org Matrix Chat]
 
* [https://lists.riseup.net/www/info/massmeshnet Mailing List]
 
* [https://www.meetup.com/SomervillePirates/ Weekly Meetups]
 
  
== Choosing a Node ==
+
= Preparation =
Take a look at our [[Devices|devices]] page. Because we are using Yggdrasil for encrypted routing, you will want to choose a device with an Yggdrasil speed that meets your needs.
+
 
 +
{{Note|Set yourself up for success, and '''[https://riot.im/app/#/group/+massmesh:matrix.org introduce yourself in one of our chat rooms] before you begin.''' Something will go wrong during the setup process, and it's best to have experienced friends ready to help when it does.}}
 +
 
 +
= Definitions =
 +
* '''Mesh Node:''' A ''mesh node'' is the smallest unit on a mesh network. Every ''mesh node'' is a ''router'', and is critical for delivering the online traffic of its neighbors. For more details about how mesh networks and neighborhood networks work internally, please see the [[Network Architecture]] page.
 +
* '''Firmware:''' Firmware is the first thing that you will install on your mesh node. ''Firmware'' is just like the operating system on your computer (Linux, Windows, Mac, etc.) ''Firmware'' is what allows us to install applications, manage users, and all the other things you can do on a functioning computer. The firmware that we use on our network is a customized version of [https://openwrt.org OpenWrt].
 +
* '''Antenna/Radio:''' The ''antenna'' (or ''radio'') is what allows your mesh node to communicate with other mesh nodes. Our ''antennas'' communicate in [https://en.wikipedia.org/wiki/Open_spectrum free spectrum] at 2.4Ghz and 5Ghz -- just like the wi-fi in your home or workplace.
 +
* '''Router:''' A ''router'' is any computer that is responsible for "routing" information on a network. All the ''mesh nodes'' on our network can also be called ''routers.''
 +
* '''Gateway:''' A ''gateway'' or ''gateway server'' is a computer (usually a big one) that acts as a bridge between two networks. In order to provide a high level of security on our network, all of our ''mesh nodes'' reach the Internet through a ''gateway server.'' For more details about how mesh networks and neighborhood networks work internally, please see the [[Network Architecture]] page.
 +
 
 +
== Considerations ==
 +
 
 +
* '''Time:''' about 2 hours
 +
* '''Cost:''' about $150
 +
* '''Internet Access:''' If you do not already have Internet access, you will need to find a neighbor (on your same street) who is willing to set up a mesh node at their home too, and work out a deal to share their Internet connection fairly.
 +
* '''Difficulty:''' The instructions contained on this website are quite technical, and may be incomplete in some places. Most of these instructions were written with Linux users in mind. If you are using another operating system (like Windows or Mac,) some "[https://ddg.gg googling]" may be necessary to get through them. As stated above, it's good to have friends. [https://riot.im/app/#/group/+massmesh:matrix.org Introduce yourself in any of our chat channels] if you want some help getting started!
 +
 
 +
== Materials ==
 +
 
 +
=== Standard Mesh Node ===
 +
To set up a standard mesh node that broadcasts a secure Internet connection in all directions, you will need to obtain the following equipment:
 +
<gallery>
 +
File:Rpf-raspberry-pi-4-model-b.png | '''[[RPF Raspberry Pi 4 Model B]]'''
 +
File:Pi_power_supply.jpg | '''Official Raspberry Pi 4 Power Supply'''
 +
File:MicroSD_card.jpg  | '''microSD Card''' (4GB+)
 +
File:Ethernet.jpg | '''Ethernet Cable (3x)''' (Three sections, cut to length)
 +
File:usb_to_eth.png | '''USB to Ethernet Adapter''' (See [[USB Ethernet Adapters]] for buying options.)
 +
File:Usb-reader-writer.png | '''SD Card reader/writer.''' (Some computers come with this built in.)
 +
</gallery>
 +
<gallery>
 +
File:Ubnt-uap-ac-m.png | '''[[Ubiquiti UAP AC Mesh]]'''
 +
File:Poe.jpg | '''PoE Injector''' (One should come with the UAP AC Mesh if you buy it new)
 +
File:Paperclip.jpg | '''One Paperclip''' (Seriously, these come in handy)
 +
</gallery>
 +
 
 +
=== Custom Mesh Nodes ===
 +
If you know what kind of hardware you want, and this 'aint it, please see the recommended [[Hardware Bundles]], or browse the full list of [[:Category:Devices|Devices]].
 +
 
 +
The steps to get a mesh node up and running are as follows:
 +
# Flash the firmware on your mesh node (Raspberry Pi 4 is recommended)
 +
# Flash the firmware on your mesh radio (UAP AC Mesh is recommended in most cases)
 +
# Assemble the wireless mesh node
 +
# Configure a secure Internet gateway connection
 +
 
 +
= Install the Mesh Node Firmware=
 +
 
 +
=== Materials & Software ===
 +
{{Tip|Download and install the appropriate version of the [https://www.raspberrypi.org/downloads/ Raspberry Pi Imager] for your computer before continuing.}}
 +
<gallery>
 +
File:Rpf-raspberry-pi-4-model-b.png | '''[[RPF Raspberry Pi 4 Model B]]'''
 +
File:MicroSD_card.jpg  | '''microSD Card''' (4GB+)
 +
File:Ethernet.jpg | '''Ethernet Cable (1x)'''
 +
File:Usb-reader-writer.png | '''SD Card reader/writer.''' (Some computers come with this built in.)
 +
</gallery>
 +
 
 +
{{#lst:RPF Raspberry Pi 4 Model B|flashpi4}}
 +
 
 +
'''Congratulations!!!''' You have successfully prepared your Raspberry Pi 4b to act as a secure mesh node. Set it aside for now while we prepare the other hardware. We will assemble it at the end in [[#Assembly]].
 +
 
 +
=== Troubleshooting/Progress Check ===
 +
 
 +
To troubleshoot the install so far, please follow the [[Mesh Node Troubleshooting]] guide. That guide will cover how to connect your laptop directly to the mesh node and make sure everything is set up as it should be. This can be helpful on your first install, or when you suspect the antenna (not set up yet) to be causing issues.
 +
 
 +
= Install the Mesh Radio Firmware =
 +
 
 +
The steps to install firmware on the antenna are a bit different than they were for the Raspberry Pi. For one thing, the antenna does not have an SD card. So, we will have to install the firmware by connecting to the antenna with our laptop. Please see page 6 of the "Node Installation Guide" for instructions on plugging in the antenna. After you have followed the instructions there, connect your computer to the port marked "LAN" on your PoE injector. We are now ready to begin installing the firmware.
 +
 
 +
== Materials ==
 +
 
 +
<gallery>
 +
File:Ubnt-uap-ac-m.png | '''[[Ubiquiti UAP AC Mesh]]'''
 +
File:Ethernet.jpg | '''Ethernet Cable (2x)'''
 +
File:Poe.jpg | '''PoE Injector''' (One should come with the UAP AC Mesh if you buy it new)
 +
File:Paperclip.jpg | '''One Paperclip''' (Seriously, these come in handy)
 +
</gallery>
  
 
== Flashing the Firmware ==
 
== Flashing the Firmware ==
Refer to the wiki page for your device, or bring your node to one of our meetings and have it flashed for you!
 
  
Return to this page after flashing your device to finish the set-up.
+
{{#lst:Ubiquiti UAP AC Mesh|flash-uap-ac-mesh}}
 +
 
 +
'''Congratulations!''' You have now installed all the firmware you need. Set the radio aside, and pick up in [[#Assembly]]
  
== Configuring your Node ==
+
= Assembly =
Once your device has been flashed, the meshing software needs to be set up. Follow these steps to complete the set-up:
 
<ol>
 
<li>Plug your node's WAN port into a network that provides internet access. If your device has multiple ports, check the device page for which one to use.</li>
 
<li>Navigate to the openwrt configuration page at <code>http://192.168.1.1/</code></li>
 
<li>Log in with an empty password and follow the prompt to set a secure password</li>
 
<li>Navigate to Network > DHCP and DNS and set DNS Forwardings to <code>1.1.1.1</code>, click "Save & Apply" at the bottom</li>
 
<li>Use scp to send the Yggdrasil package to the node, eg. <code>scp -o StrictHostKeyChecking=no ~/Downloads/yggdrasil_0.3.5-4_aarch64_cortex-a53.ipk root@192.168.1.1:/tmp</code></li>
 
<li>Use ssh and your node's password to access the node's command line, eg. <code>ssh root@192.168.1.1</code></li>
 
<li>Run <code>opkg update && opkg install kmod-tun nano</code> to prepare the node for Yggdrasil</li>
 
<li>Run <code>opkg install /tmp/yggdrasil_0.3.5-4_aarch64_cortex-a53.ipk</code> to install Yggdrasil</li>
 
<li>Run <code>reboot</code> to fully initialize Yggdrasil</li>
 
<li>Run ssh again to get access to the node's command line: <code>ssh root@192.168.1.1</code></li>
 
<li>Use the command <code>nano /etc/yggdrasil.conf</code> to edit the Yggdrasil configuration. Change peers section to include a public node:</li>
 
<pre>{ "Peers": [ "tcp://ygg.stephen304.com:56088" ],...</pre>
 
<li>Press <code>Ctrl + O, Enter, Ctrl + X</code> to edit the text editor</li>
 
<li>Run <code>yggdrasilctl getSelf</code> and take note of the "IPv6 subnet", for example <code>IPv6 subnet: 300:f86f:fcf9:8479::/64</code></li>
 
<li>Navigate to Network > Interfaces in the Openwrt web configuration and find "ULA Prefix" near the bottom. Replace the value with the IPv6 subnet value from the last step (starting from 3xx and ending with /64) and click "Save & Apply"</li>
 
<li>On the same page, click "Edit" next to "LAN" and set "IPv6 assignment length" to 64. Under the DHCP Server section in the "IPv6 Settings" tab, check "Always announce default router". Click Save & Apply</li>
 
<li>Navigate to Network > Firewall, and find "LAN" in the "Zones" section. Press the Edit button for this zone.</li>
 
<li>Under the "Inter-Zone Forwarding" section, add "yggdrasil" to both "Allow forward to destination zones:" and "Allow forward from source zones:". Press "Save & Apply".</li>
 
<li>Optional: To disallow unencrypted usage of the shared internet connection, remove "WAN" from "Allow forward to destination zones:"</li>
 
<li>Navigate to System > Administration and uncheck "Password authentication" and "Allow root logins with password". Press "Save & Apply".</li>
 
<li>Optional: Add an ssh key to the SSH-Keys section to allow secure access to the node via ssh.</li>
 
<li>Optional: Under Network > Firewall > Traffic Rules, check enable on "Allow-SSH-yggdrasil" to allow ssh access using the node's mesh IP</li>
 
</ol>
 
  
Once these steps are completed, your node will be capable of meshing with any other similarly configured node, as well as relaying encrypted mesh traffic to nodes over the internet if an internet connection is supplied to the node. Clients of the node will also be able to access in-mesh services using mesh IPs that the node assigns to connected devices. You can test this out by visiting the [http://[203:e0b0:ec08:4e1f:f004:19a9:577a:90ba]/wiki/index.php?title=Main_Page in-mesh wiki] while connected to a LAN port of the node.
+
To assemble your mesh node, please follow this PDF guide. It can be downloaded for your convenience.
  
== Node Placement ==
+
[[File:New_Node_Install_Guide.pdf]]
In order to communicate on the mesh, your node must be able to talk to other nodes in your area. Here are some suggestions to help maximize your signal:
 
  
* If the node is weather resistant, mount it on the outside of the house or to a column facing the street
+
= Next Steps =
* Indoor nodes should be placed on or near windows facing the street and other buildings
 
  
== Wiring Up the Node ==
+
{{Note|You still have to do [[First Time Setup]] in order to access the Internet.}}
  
In addition to providing power to the node, you may also want to use the following ports on the device:
+
Once you have followed the [[First Time Setup]] guide, you can continue to the steps below. This is necessary to securely connect your mesh node to the Internet. For more information about how the mesh network(s) work, see [[Network Architecture]].
  
* The WAN port (on multi-port devices) may be connected to a spare LAN port on your regular router (or directly to your modem) to share your internet connection with the mesh
+
== Connecting to an Internet Gateway ==
* The LAN port may be connected to a switch or any device to provide internet to that device through the mesh
+
{{#lst:First Time Setup|autoygg_firstsetup}}

Latest revision as of 09:42, 13 September 2020

A wireless mesh node consists of a "mesh node," "antenna," and an Internet connection. (Unless you're joining an existing neighborhood network, in which case you will connect to the Internet that way.)
An example wireless mesh node with tags to match up to the diagram. See #Assembly for more details.

In these instructions, we will cover how to deploy a mesh node that is privacy-enabled by default, and allows you to share an Internet connection with your neighbors. The whole setup process takes about 2 hours from start to finish. The necessary hardware is listed below, and instructions for everything from flashing the firmware to placing the antenna are covered.

Preparation

Note: Set yourself up for success, and introduce yourself in one of our chat rooms before you begin. Something will go wrong during the setup process, and it's best to have experienced friends ready to help when it does.

Definitions

  • Mesh Node: A mesh node is the smallest unit on a mesh network. Every mesh node is a router, and is critical for delivering the online traffic of its neighbors. For more details about how mesh networks and neighborhood networks work internally, please see the Network Architecture page.
  • Firmware: Firmware is the first thing that you will install on your mesh node. Firmware is just like the operating system on your computer (Linux, Windows, Mac, etc.) Firmware is what allows us to install applications, manage users, and all the other things you can do on a functioning computer. The firmware that we use on our network is a customized version of OpenWrt.
  • Antenna/Radio: The antenna (or radio) is what allows your mesh node to communicate with other mesh nodes. Our antennas communicate in free spectrum at 2.4Ghz and 5Ghz -- just like the wi-fi in your home or workplace.
  • Router: A router is any computer that is responsible for "routing" information on a network. All the mesh nodes on our network can also be called routers.
  • Gateway: A gateway or gateway server is a computer (usually a big one) that acts as a bridge between two networks. In order to provide a high level of security on our network, all of our mesh nodes reach the Internet through a gateway server. For more details about how mesh networks and neighborhood networks work internally, please see the Network Architecture page.

Considerations

  • Time: about 2 hours
  • Cost: about $150
  • Internet Access: If you do not already have Internet access, you will need to find a neighbor (on your same street) who is willing to set up a mesh node at their home too, and work out a deal to share their Internet connection fairly.
  • Difficulty: The instructions contained on this website are quite technical, and may be incomplete in some places. Most of these instructions were written with Linux users in mind. If you are using another operating system (like Windows or Mac,) some "googling" may be necessary to get through them. As stated above, it's good to have friends. Introduce yourself in any of our chat channels if you want some help getting started!

Materials

Standard Mesh Node

To set up a standard mesh node that broadcasts a secure Internet connection in all directions, you will need to obtain the following equipment:

Custom Mesh Nodes

If you know what kind of hardware you want, and this 'aint it, please see the recommended Hardware Bundles, or browse the full list of Devices.

The steps to get a mesh node up and running are as follows:

  1. Flash the firmware on your mesh node (Raspberry Pi 4 is recommended)
  2. Flash the firmware on your mesh radio (UAP AC Mesh is recommended in most cases)
  3. Assemble the wireless mesh node
  4. Configure a secure Internet gateway connection

Install the Mesh Node Firmware

Materials & Software

Tip: Download and install the appropriate version of the Raspberry Pi Imager for your computer before continuing.


Flashing the Firmware

  1. Download the latest stable version of Mass Mesh's free firmware here
    1. Following along with an Espresso Bin v5? Download your firmware from here instead!
  2. Open the Raspberry Pi Imager (Download and install it from here if you haven't yet.)
  3. Select "Choose OS"
    1. Select "Choose OS"
  4. Scroll to the bottom of the list, and select "Use Custom"
    1. Scroll to the bottom of the list, and select "Use Custom"
  5. Find the Mass Mesh firmware you just downloaded, and select it from the filesystem.
  6. Once you have selected the appropriate firmware, select "Choose SD Card"
    1. Once you have selected the appropriate firmware, select "Choose SD Card"
  7. You should see something like the following. Go ahead and select that card. (You probably only see one, but use the size of the card as a hint if you see several.)
    1. Go ahead and select that card. (You probably only see one, but use the size of the card as a hint if you see several.)
  8. Once you have selected the OS and the SD Card, select "Write." You will see a warning like the one shown below... Go ahead and select "Yes."
    1. Once you have selected the OS and the SD Card, select "Write."
    2. You will see a warning like this... Go ahead and select "Yes."
  9. You should see a screen like the following. Click "Continue," and remove the SD card from your computer.
    1. Click "Continue," and remove the SD card from your computer.
  10. Plug the micro SD card into your Raspberry Pi 4.
    1. Plug in the SD card with the gold side up, like shown here:
    2. Plug in the SD card with the gold side up


Congratulations!!! You have successfully prepared your Raspberry Pi 4b to act as a secure mesh node. Set it aside for now while we prepare the other hardware. We will assemble it at the end in #Assembly.

Troubleshooting/Progress Check

To troubleshoot the install so far, please follow the Mesh Node Troubleshooting guide. That guide will cover how to connect your laptop directly to the mesh node and make sure everything is set up as it should be. This can be helpful on your first install, or when you suspect the antenna (not set up yet) to be causing issues.

Install the Mesh Radio Firmware

The steps to install firmware on the antenna are a bit different than they were for the Raspberry Pi. For one thing, the antenna does not have an SD card. So, we will have to install the firmware by connecting to the antenna with our laptop. Please see page 6 of the "Node Installation Guide" for instructions on plugging in the antenna. After you have followed the instructions there, connect your computer to the port marked "LAN" on your PoE injector. We are now ready to begin installing the firmware.

Materials

Flashing the Firmware

Enter TFTP Mode
  1. Unplug the ethernet from the antenna (This turns it off.)
  2. Use a paper clip to hold in the reset button
  3. Plug the ethernet back in to the antenna, holding the paperclip steady as you do
  4. Continue holding the paper clip until the light on the side of your UAP AC Mesh starts blinking OFF/WHITE/BLUE (should take about 30 seconds)
Set Up a Static IP Address

The next step is to assign your computer a static IP address of 192.168.1.25/24.

  1. Windows: Setting a static IP address in Windows 10
  2. Mac: Setting a static IP address in OSX
  3. Linux: Setting a static IP address in Ubuntu 18.04 desktop
Sending Firmware via TFTP
  1. Download version 3.7 of Ubiquiti's AirOS
  2. Rename the firmware file to firmware.bin, as the device will look for this file name
  3. Launch a command prompt/terminal, and enter the following, one line at a time:
tftp
tftp> connect 192.168.1.20
tftp> binary
tftp> rexmt 1
tftp> timeout 60
tftp> put firmware.bin
Sent x bytes in x seconds


The LED will flash at varying speeds, then it will turn solid when complete. After writing the firmware, the device automatically reboots. This will take a few minutes to complete, and when done the device will be pingeable at 192.168.1.20.

  • The radio will timeout if left in tftp mode for too long. If the transfer is unsuccessful, try power cycling the radio and entering tftp mode again.
  • If you don't see something like what's shown above (maybe your "Transfer timed out.), go back and make sure that the light on the side of your UAP AC Mesh is blinking in the pattern indicated above. If not, start again from #Enter Factory Reset Mode
  • If the light is blinking properly, make sure that your static IP address was assigned properly. If not, start again from #Set Up a Static IP Address
  • If you are still having trouble transferring firmware to the device, reach out for help in the chatroom. Someone will help you get unstuck.

Install the Mass Mesh Firmware

  1. Download the latest Mass Mesh radio firmware here.
  2. Statically assign your computer the IP address 192.168.1.25 (See #Set Up a Static IP Address if needed.)
  3. Open a terminal/command prompt. You will need it in order to copy/paste the commands shown below.
  4. Copy the Mass Mesh firmware onto the device (default password is ubnt):
    • scp openwrt-massmesh-meshradio-ath79-generic-ubnt_unifiac-mesh-squashfs-sysupgrade.bin ubnt@192.168.1.20:/tmp/
  5. SSH into the device and log in with the default username and password ubnt / ubnt
    • ssh ubnt@192.168.1.20
  6. Then write the firmware to kernel0 and kernel1 by entering the following into the terminal, line by line:
    • BZ.v3.7.40# mtd write /tmp/openwrt-massmesh-meshradio-ath79-generic-ubnt_unifiac-mesh-squashfs-sysupgrade.bin kernel0
      BZ.v3.7.40# mtd -r write /tmp/openwrt-massmesh-meshradio-ath79-generic-ubnt_unifiac-mesh-squashfs-sysupgrade.bin kernel1
    • You should see something like the following:
    • BZ.v3.7.40# mtd write /tmp/openwrt-massmesh-meshradio-ath79-generic-ubnt_unifiac-mesh-squashfs-sysupgrade.bin kernel0
      Unlocking kernel0 ...
      Erasing kernel0 ...
      Writing from /tmp/openwrt-massmesh-meshradio-ath79-generic-ubnt_unifiac-mesh-squashfs-sysupgrade.bin to kernel0 ...  [e/w]
      
      BZ.v3.7.40# mtd -r write /tmp/openwrt-massmesh-meshradio-ath79-generic-ubnt_unifiac-mesh-squashfs-sysupgrade.bin kernel1
      Unlocking kernel1 ...
      Erasing kernel1 ...
      Writing from /tmp/openwrt-massmesh-meshradio-ath79-generic-ubnt_unifiac-mesh-squashfs-sysupgrade.bin to kernel1 ...  [e/w]
  7. If the device does not reboot by itself, type reboot into the terminal, and hit enter. The radio will now restart. Please wait upwards of 5+ minutes during this "first boot" process. When the device is working properly, you should see a wifi network named "MassMesh.org"


Congratulations! You have now installed all the firmware you need. Set the radio aside, and pick up in #Assembly

Assembly

To assemble your mesh node, please follow this PDF guide. It can be downloaded for your convenience.

File:New Node Install Guide.pdf

Next Steps

Note: You still have to do First Time Setup in order to access the Internet.

Once you have followed the First Time Setup guide, you can continue to the steps below. This is necessary to securely connect your mesh node to the Internet. For more information about how the mesh network(s) work, see Network Architecture.

Connecting to an Internet Gateway

Mass Mesh runs a public Internet Gateway at the address 200:83a1:3b1a:e7af:4b46:6169:8435:9280. If you would like to use it to connect to the internet, put that address in the autoygg gateway field and click SAVE & APPLY:

The Autoygg settings screen with the Mass Mesh gateway configured.

At this point, the Status page will show you are not connected:

The Autoygg status screen with the Mass Mesh gateway configured, but not connected.

Before you can connect to the internet via the Mass Mesh gateway, one of our volunteers will need to add your node to the accesslist on the gateway server. You can request this in the Mass Mesh AP Hosts chat room. Please provide your Yggdrasil IPv6 address when you do so, which is available on the Yggdrasil node status page:

Your static IPv6 address is unique to your Yggdrasil node, and never changes.

Once your node is added to our accesslist, you can hit the Connect button and if that goes well, the status page will look similar to this:

The Autoygg status screen with the Mass Mesh gateway configured and connected.