mirror of
https://github.com/gravitl/netmaker.git
synced 2024-11-11 01:54:34 +08:00
2.1 KiB
2.1 KiB
Getting Started
This guide covers the fundamentals of using Netmaker.
Quick Start
Non-Docker Setup
Server Setup
- Get yourself a linux server and make sure it has a public IP.
- Deploy MongoDB
docker volume create mongovol && docker run -d --name mongodb -v mongovol:/data/db --network host -e MONGO_INITDB_ROOT_USERNAME=mongoadmin -e MONGO_INITDB_ROOT_PASSWORD=mongopass mongo --bind_ip 0.0.0.0
- Pull this repo:
git clone https://github.com/gravitl/netmaker.git
- Switch to the directory and source the default env vars
cd netmaker && source defaultvars.sh
- Run the server:
go run ./
Optional (For Testing): Create Networks and Nodes
- Create Network:
./test/networkcreate.sh
- Create Key:
./test/keycreate.sh
(save the response for step 3) - Open ./test/nodescreate.sh and replace ACCESSKEY with value from #2
- Create Nodes:
./test/nodescreate.sh
- Check to see if nodes were created:
curl -H "authorization: Bearer secretkey" localhost:8081/api/skynet/nodes | jq
UI Setup
Please see this repo for instructions on setting up your UI.
Agent Setup
On each machine you would like to add to the network, do the following:
- Confirm wireguard is installed:
sudo apt install wireguard-tools
- Confirm ipv4 forwarding is enabled:
sysctl -w net.ipv4.ip_forward=1
- Create a key or enable manual node signup at the network level
- Get the binary:
sudo wget 52.55.6.84:8081/meshclient/files/meshclient
- Make it executable:
sudo chmod +x meshclient
- Run the install command:
sudo ./meshclient -c install -g <network name> -s <server:port> -k <key value>
This will install netclient.service and netclient.timer in systemd, which will run periodically to call the netclient binary, which will check to see if there are any updates that it needs and update WireGuard appropriately.
BUILDING
Protoc command for GRPC Compilation:
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative grpc/node.proto
Build binary: go build ./