getting-started.rst.txt 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. =================
  2. Getting Started
  3. =================
  4. Once you have Netmaker installed via the :doc:`Quick Install <./quick-start>` guide, you can use this Getting Started guide to help create and manage your first network.
  5. Setup
  6. =================
  7. #. Create your admin user, with a username and password.
  8. #. Login with your new user
  9. #. Create your first network by clicking on Create Network
  10. .. image:: images/create-net.png
  11. :width: 80%
  12. :alt: Create Network Screen
  13. :align: center
  14. This network should have a sensible name (nodes will use it to set their interfaces).
  15. More importantly, it should have a non-overlapping, private address range.
  16. If you are running a small (less than 254 machines) network, and are unsure of which CIDR's to use, you could consider:
  17. - 10.11.12.0/24
  18. - 10.20.30.0/24
  19. - 100.99.98.0/24
  20. Once your network is created, you should see that the netmaker server has added itself to the network. From here, you can move on to adding additional nodes to the network.
  21. .. image:: images/netmaker-node.png
  22. :width: 80%
  23. :alt: Node Screen
  24. :align: center
  25. Create Key
  26. ------------
  27. Adding nodes to the network typically requires a key.
  28. #. Click on the ACCESS KEYS tab and select the network you created.
  29. #. Click ADD NEW ACCESS KEY
  30. #. Give it a name (ex: "mykey") and a number of uses (ex: 25)
  31. #. Click CREATE KEY (**Important:** Do not click out of the following screen until you have saved your key details. It will appear only once.)
  32. #. 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/develop/scripts/netclient-install.sh | KEY=vm3ow4thatogiwnsla3thsl3894ths sh -``.
  33. .. image:: images/access-key.png
  34. :width: 80%
  35. :alt: Access Key Screen
  36. :align: center
  37. You will use this command to install the netclient on your nodes. There are three different values for three different scenarios:
  38. * 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 join -k <access key> -s grpc.myserver.com -p 50051``
  39. * 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 join -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**.
  40. * 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.
  41. 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.
  42. Deploy Nodes
  43. =================
  44. 0. Prereqisite: Every machine on which you install should have wireguard and systemd already installed.
  45. 1. SSH to each machine
  46. 2. ``sudo su -``
  47. 3. **Prerequisite Check:** Every Linux machine on which you run the netclient must have WireGuard and systemd installed
  48. 4. For linux machines with SystemD and WireGuard installed, Run the install command, Ex: ``curl -sfL https://raw.githubusercontent.com/gravitl/netmaker/develop/scripts/netclient-install.sh | KEY=vm3ow4thatogiwnsla3thsl3894ths sh -``
  49. 5. For Mac, Windows, and arch-specific linux distributions (e.g. ARM), `download the appropriate netclient for your system <https://github.com/gravitl/netmaker/releases/tag/latest/>`_ . Then, run "netclient join -t <your token>".
  50. 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.
  51. .. image:: images/nc-install-output.png
  52. :width: 80%
  53. :alt: Output from Netclient Install
  54. :align: center
  55. .. image:: images/nm-node-success.png
  56. :width: 80%
  57. :alt: Node Success
  58. :align: center
  59. 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).
  60. Once installed on all nodes, you can test the connection by pinging the private address of any node from any other node.
  61. .. image:: images/ping-node.png
  62. :width: 80%
  63. :alt: Node Success
  64. :align: center
  65. Manage Nodes
  66. ===============
  67. Your machines should now be visible in the control pane.
  68. .. image:: images/nodes.png
  69. :width: 80%
  70. :alt: Node Success
  71. :align: center
  72. 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.
  73. .. image:: images/node-details.png
  74. :width: 80%
  75. :alt: Node Success
  76. :align: center
  77. 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.
  78. Uninstalling the netclient
  79. =============================
  80. 1. To remove your nodes from the default network, run the following on each node: ``sudo netclient leave -n default``
  81. 2. To remove the netclient entirely from each node, run ``sudo rm -rf /etc/netclient`` (after running the first step)
  82. Uninstalling Netmaker
  83. ===========================
  84. 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.