Background
I have a freebsd laptop at home but it doesn’t have a public ip so I can’t access it remotely, I also have a server so I’m trying to achieve access through tailscale networking.
Install Tailscale
Here I used pkg to install tailscale
Update pkg
|
|
Install Tailscale
|
|
Enable Tailscale
⚠️ It’s tailscaled not tailscale
|
|
Start Tailscale
⚠️ It’s tailscaled not tailscale
|
|
Check Tailscale
|
|
you should see tailscale is running like this:
|
|
Connect to server
I used headscale as my server, and I tried to connect to it with authkey. For more information on how to install and use headscale, please see the official documentation.
Generate authkey
We need to generate the authkey on the headscale server first.
|
|
Then the authkey is like this:
|
|
Connect to server
|
|
Now you have successfully connected to the server. This exposes only that node to other nodes.
Enable subnet routes
-
Setting up the configuration file
/etc/sysctl.conf
1 2
echo 'net.ipv4.ip_forward = 1' >> /etc/sysctl.conf echo 'net.ipv6.conf.all.forwarding = 1' >> /etc/sysctl.conf
-
Connect to the server, the subnet range for this node is
192.168.0.1/24
.1
tailscale up --login-server=http://<your-server-ip>:41641 --accept-routes=true --accept-dns=false --advertise-routes=192.168.0.1/24 --authkey=c9bdab8d415f53940f920ee9e729b79ee4e7298cb5acd27d
-
Get the node list on the server.
1
headscale node list --namespace default
You can see this node on the server. The id of this node is 3.
-
Enable subnet routes in the server.
1 2
# the id is 3, the subnet range is 192.168.0.1/24 headscale routes enable -i 3 -r "192.168.0.1/24"
-
Check if subnet is enabled successfully.
1
headscale routes list -i 3
we can see that the subnet is enabled like this:
1 2
Route | Enabled 192.168.0.1/24 | true
Viewing nodes on the server
|
|
You can see this node on the server.
Use ping to check connectivity between nodes
You can use ping
to check connectivity between nodes. My current node’s ip is 100.64.0.2
and another node’s ip is 100.64.0.1
. So I use ping 100.64.0.1
to check connectivity.
|
|
You can see that the ping is successful like this:
|
|
You can also use tailscale netcheck
to view the report of the connectivity.
|
|