mirror of
https://github.com/nickyeoman/docker-compose-cookbooks.git
synced 2026-10-22 20:16:22 +00:00
Move step-by-step guides into headscale/docs/, slim README to a quick reference, and use $HEADSCALE_CONTAINER for docker exec commands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
895 B
Markdown
29 lines
895 B
Markdown
# Subnet Routing (Optional)
|
|
|
|
[← Back to README](../README.md)
|
|
|
|
Commands below use `$HEADSCALE_CONTAINER`. Set it once per shell session on the dedicated server (change the value if your compose project name differs; find it with `docker ps`):
|
|
|
|
```bash
|
|
export HEADSCALE_CONTAINER=headscale-headscale-1
|
|
```
|
|
|
|
Lets tailnet devices reach *everything* on the LAN, not just the LAN node.
|
|
|
|
On the **LAN node**:
|
|
|
|
```bash
|
|
sudo tailscale up --login-server=https://headscale.example.com --advertise-routes=192.168.1.0/24
|
|
|
|
# enable IP forwarding
|
|
echo 'net.ipv4.ip_forward = 1' | sudo tee /etc/sysctl.d/99-tailscale.conf
|
|
sudo sysctl -p /etc/sysctl.d/99-tailscale.conf
|
|
```
|
|
|
|
Approve the route on the **dedicated server**:
|
|
|
|
```bash
|
|
docker exec -it "$HEADSCALE_CONTAINER" headscale nodes list-routes
|
|
docker exec -it "$HEADSCALE_CONTAINER" headscale nodes approve-routes -i <NODE-ID> --routes 192.168.1.0/24
|
|
```
|