summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs37
1 files changed, 37 insertions, 0 deletions
diff --git a/docs b/docs
new file mode 100644
index 0000000..7384a99
--- /dev/null
+++ b/docs
@@ -0,0 +1,37 @@
1# Headscale
2# exercise to assert that it works
3
4## 1. Create VMs
5python3 vm.py c mk testvm2-1 --image fedora42 --vcpu 6 --ram 4 --auto-download
6python3 vm.py c mk testvm2-2 --image fedora42 --vcpu 6 --ram 4 --auto-download
7
8## 2. Check available public IPs
9python3 vm.py n ipv4 --pool
10
11## 3. Attach public IP to server VM
12python3 vm.py n ipv4 --attach 37.27.166.243 testvm2-1
13
14## 4. SCP install.sh to server VM and run it
15scp -i ~/k/k1 -o StrictHostKeyChecking=no /root/hypervisor/vm-claude/headscale/install.sh user@<testvm2-1-private-ip>:/tmp/install.sh
16sshi testvm2-1.i "sudo bash /tmp/install.sh 37.27.166.243"
17# Output includes the auth key, e.g.:
18# hskey-auth-JK4Q793swFSJ-owovbUSFU1T71UyRiywcrIgERltcWq14h6vXT2LIFFA1naYkKLLGfL8E46cgUTOQ
19
20## 5. SCP client.sh to client VM and run it
21scp -i ~/k/k1 -o StrictHostKeyChecking=no /root/hypervisor/vm-claude/headscale/client.sh user@<testvm2-2-private-ip>:/tmp/client.sh
22sshi testvm2-2.i "sudo bash /tmp/client.sh 37.27.166.243 <AUTH_KEY>"
23
24## 6. Verify - ping server's tailscale IP from client
25sshi testvm2-2.i "ping -c 3 100.64.0.1"
26
27## Cleanup
28python3 vm.py n ipv4 --detach 37.27.166.243 testvm2-1
29echo "y" | python3 vm.py c rm testvm2-1
30echo "y" | python3 vm.py c rm testvm2-2
31
32## Useful commands on the headscale server VM
33headscale node list # list all registered nodes
34headscale users list # list users
35headscale preauthkeys create --user <USER_ID> --expiration 2160h --reusable # new auth key
36headscale preauthkeys list --user <USER_ID> # list auth keys
37curl http://<PUBLIC_IP>:8080/health # health check