From c0e80820010cc5b0fdea1eb69bafef7f575e3201 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 8 Feb 2026 20:23:31 +0800 Subject: first --- docs | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 docs (limited to 'docs') diff --git a/docs b/docs new file mode 100644 index 0000000..7384a99 --- /dev/null +++ b/docs @@ -0,0 +1,37 @@ +# Headscale +# exercise to assert that it works + +## 1. Create VMs +python3 vm.py c mk testvm2-1 --image fedora42 --vcpu 6 --ram 4 --auto-download +python3 vm.py c mk testvm2-2 --image fedora42 --vcpu 6 --ram 4 --auto-download + +## 2. Check available public IPs +python3 vm.py n ipv4 --pool + +## 3. Attach public IP to server VM +python3 vm.py n ipv4 --attach 37.27.166.243 testvm2-1 + +## 4. SCP install.sh to server VM and run it +scp -i ~/k/k1 -o StrictHostKeyChecking=no /root/hypervisor/vm-claude/headscale/install.sh user@:/tmp/install.sh +sshi testvm2-1.i "sudo bash /tmp/install.sh 37.27.166.243" +# Output includes the auth key, e.g.: +# hskey-auth-JK4Q793swFSJ-owovbUSFU1T71UyRiywcrIgERltcWq14h6vXT2LIFFA1naYkKLLGfL8E46cgUTOQ + +## 5. SCP client.sh to client VM and run it +scp -i ~/k/k1 -o StrictHostKeyChecking=no /root/hypervisor/vm-claude/headscale/client.sh user@:/tmp/client.sh +sshi testvm2-2.i "sudo bash /tmp/client.sh 37.27.166.243 " + +## 6. Verify - ping server's tailscale IP from client +sshi testvm2-2.i "ping -c 3 100.64.0.1" + +## Cleanup +python3 vm.py n ipv4 --detach 37.27.166.243 testvm2-1 +echo "y" | python3 vm.py c rm testvm2-1 +echo "y" | python3 vm.py c rm testvm2-2 + +## Useful commands on the headscale server VM +headscale node list # list all registered nodes +headscale users list # list users +headscale preauthkeys create --user --expiration 2160h --reusable # new auth key +headscale preauthkeys list --user # list auth keys +curl http://:8080/health # health check -- cgit