quick-start.rst 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. ===========
  2. Quick Start
  3. ===========
  4. Introduction
  5. ==============
  6. This is a guide to getting up and running with Netmaker as quickly as possible.
  7. By default, Netmaker ships with DNS Mode, Client Mode, and Secure GRPC enabled. However, these features require special permissions and are not necessary for a simple setup, so we are going to deploy without them. To learn more about enabling these features, check out the :doc:`installation docs <./server-installation>`.
  8. Prerequisites
  9. ==================
  10. #. A Linux server to host Netmaker, with an external IP reachable by your nodes (will be referred to as **your-host** in document).
  11. #. Docker and Docker Compose installed on the above server. Follow the official `Docker instructions <https://docs.docker.com/engine/install/>`_ for installing Docker and Docker Compose on your system.
  12. #. All network nodes should be systemd-based (see Compatibility under :doc:`Architecture <./architecture>` docs)
  13. Install
  14. ==============
  15. #. ``ssh root@your-host``
  16. #. ``wget -O docker-compose.yml https://raw.githubusercontent.com/gravitl/netmaker/master/compose/docker-compose.slim.yml``
  17. #. ``sed -i ‘s/HOST_IP/< Insert your-host IP Address Here >/g’ docker-compose.yml``
  18. #. ``docker-compose up -d``
  19. Navigate to the IP address of your host in the browser. You should see the below screen. If not, please see the Quick Start section of the :doc:`troubleshooting <./support>` docs.
  20. .. image:: images/create-user.png
  21. :width: 80%
  22. :alt: Create User Screen
  23. :align: center
  24. Setup
  25. =================
  26. #. Create your admin user, with a username and password.
  27. #. Login with your new user
  28. #. Examine the **default** network. Click on DEFAULT under NETWORK DETAILS
  29. .. image:: images/default-net.png
  30. :width: 80%
  31. :alt: Create User Screen
  32. :align: center
  33. This displays information about the **default** network, which is created on server startup. You can delete this network if you do not need it, but for standard use cases this network should be enough to get started. Nodes will get an address from the network address range (ADDRESSRANGE). If the range conflicts with a pre-existing private network on your devices, you may want to change this, or make a new network instead. Nodes will also get default settings from here for unset configurations. For instance, the DEFAULTKEEPALIVE field will set the PersistenKeepAlive for nodes.
  34. To get started quickly, we can just use the existing default network.
  35. Create Key
  36. ------------
  37. #. Click on the ACCESS KEYS tab and select the DEFAULT network.
  38. #. Click ADD NEW ACCESS KEY
  39. #. Give it a name (ex: "mykey") and a number of uses (ex: 25)
  40. #. Click CREATE KEY (**Important:** Do not click out of the following screen until you have saved your key details. It will appear only once.)
  41. #. Copy the bottom command under "Your agent install command with access token" and save it somewhere locally. E.x: ``curl -sfL https://raw.githubusercontent.com/gravitl/netmaker/v0.3/scripts/netclient-install.sh | KEY=vm3ow4thatogiwnsla3thsl3894ths sh -``
  42. .. image:: images/access-key.png
  43. :width: 80%
  44. :alt: Access Key Screen
  45. :align: center
  46. You will use this command to install the netclient on your nodes. There are three different values for three different scenarios:
  47. * The **Access Key** value is the secret string that will allow your node to authenticate with the Netmaker network. This can be used with existing netclient installations where additional configurations (such as setting the server IP manually) may be required. This is not typical. E.g. ``netclient -c install -k <access key> -s 1.2.3.4 -p 50052``
  48. * The **Access Token** value is a base64 encoded string that contains the server IP and grpc port, as well as the access key. This is decoded by the netclient and can be used with existing netclient installations like this: ``netclient -c install -t <access token>``. You should use this method for adding a network to a node that is already on a network. For instance, Node A is in the **mynet** network and now you are adding it to **default**.
  49. * The **install command** value is a curl command that can be run on Linux systems. It is a simple script that downloads the netclient binary and runs the install command all in one.
  50. Networks can also be enabled to allow nodes to sign up without keys at all. In this scenario, nodes enter a "pending state" and are not permitted to join the network until an admin approves them.
  51. Deploy Nodes
  52. =================
  53. 1. SSH to each machine
  54. 2. ``sudo su -``
  55. 3. **Prerequisite Check:** Every Linux machine on which you run the netclient must have WireGuard and systemd installed
  56. * ``which wg`` (should show wg binary present)
  57. * ``pidof systemd && echo "systemd found" || echo "systemd not found"``
  58. 4. Run the install command, Ex: ``curl -sfL https://raw.githubusercontent.com/gravitl/netmaker/v0.5/scripts/netclient-install.sh | KEY=vm3ow4thatogiwnsla3thsl3894ths sh -``
  59. You should get output similar to the below. The netclient retrieves local settings, submits them to the server for processing, and retrieves updated settings. Then it sets the local network configuration. For more information about this process, see the :doc:`client installation <./client-installation>` documentation. If this process failed and you do not see your node in the console (see below), then reference the :doc:`troubleshooting <./troubleshoot>` documentation.
  60. .. image:: images/nc-install-output.png
  61. :width: 80%
  62. :alt: Output from Netclient Install
  63. :align: center
  64. .. image:: images/nm-node-success.png
  65. :width: 80%
  66. :alt: Node Success
  67. :align: center
  68. Repeat the above steps for every machine you would like to add to your network. You can re-use the same install command so long as you do not run out of uses on your access key (after which it will be invalidated and deleted).
  69. Once installed on all nodes, you can test the connection by pinging the private address of any node from any other node.
  70. .. image:: images/ping-node.png
  71. :width: 80%
  72. :alt: Node Success
  73. :align: center
  74. Manage Nodes
  75. ===============
  76. Your machines should now be visible in the control pane.
  77. .. image:: images/nodes.png
  78. :width: 80%
  79. :alt: Node Success
  80. :align: center
  81. You can view/modify/delete any node by selecting it in the NODES tab. For instance, you can change the name to something more sensible like "workstation" or "api server". You can also modify network settings here, such as keys or the WireGuard port. These settings will be picked up by the node on its next check in. For more information, see Advanced Configuration in the :doc:`Using Netmaker <./usage>` docs.
  82. .. image:: images/node-details.png
  83. :width: 80%
  84. :alt: Node Success
  85. :align: center
  86. Nodes can be added/removed/modified on the network at any time. Nodes can also be added to multiple Netmaker networks. Any changes will get picked up by any nodes on a given network, and will take aboue ~30 seconds to take effect.
  87. Uninstalling the netclient
  88. =============================
  89. 1. To remove your nodes from the default network, run the following on each node: ``sudo netclient leave -n default``
  90. 2. To remove the netclient entirely from each node, run ``sudo rm -rf /etc/netclient`` (after running the first step)
  91. Uninstralling Netmaker
  92. ===========================
  93. To uninstall Netmaker from the server, simply run ``docker-compose down`` or ``docker-compose down --volumes`` to remove the docker volumes for a future installation.