Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make userspace networking configurable #199

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tailscale/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ tags:
- tag:example
- tag:homeassistant
taildrop: true
userspace_networking: true
```

### Option: `accept_dns`
Expand Down Expand Up @@ -186,6 +187,22 @@ the default (`https://controlplane.tailscale.com`). This is useful if you
are running your own Tailscale control server, for example, a self-hosted
[Headscale] instance.

### Option: `userspace_networking`

The add-on uses [userspace networking mode][tailscale_info_userspace_networking]
to make your Home Assistant instance (and optionally the local subnets)
accessible within your tailnet.

When not set, this option is enabled by default.

If you need to access other clients on your tailnet from your Home Assistant
instance, disable userspace networking mode, which will create a `tailscale0`
network interface on your host.

If you want to access other clients on your tailnet even from your local subnet,
execute steps 2 and 3 as described on [Site-to-site
networking][tailscale_info_site_to_site].

### Option: `proxy`

When not set, this option is enabled by default.
Expand Down Expand Up @@ -325,3 +342,5 @@ SOFTWARE.
[tailscale_info_funnel]: https://tailscale.com/kb/1223/tailscale-funnel/
[tailscale_info_https]: https://tailscale.com/kb/1153/enabling-https/
[tailscale_info_key_expiry]: https://tailscale.com/kb/1028/key-expiry/
[tailscale_info_site_to_site]: https://tailscale.com/kb/1214/site-to-site/
[tailscale_info_userspace_networking]: https://tailscale.com/kb/1112/userspace-networking/
1 change: 1 addition & 0 deletions tailscale/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ schema:
proxy: bool?
tags: ["match(^tag:[a-zA-Z0-9]-?[a-zA-Z0-9]+$)?"]
taildrop: bool?
userspace_networking: bool?
10 changes: 10 additions & 0 deletions tailscale/rootfs/etc/s6-overlay/s6-rc.d/post-tailscaled/run
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,13 @@ if keyexpiry=$(/opt/tailscale status --self=true --peers=false --json | jq -rce
fi

bashio::log.info "Tailscale is running"

# Warn about userspace networking
if ! bashio::config.has_value "userspace_networking" || \
bashio::config.true "userspace_networking";
then
bashio::log.notice "The add-on uses userspace networking mode."
bashio::log.notice "If you need to access other clients on your tailnet from your Home Assistant instance,"
bashio::log.notice "disable userspace networking mode, that will create a \"tailscale0\" network interface on your host."
bashio::log.notice "Please check your configuration based on the add-on's Documentation under \"Option: userspace_networking\""
fi
7 changes: 7 additions & 0 deletions tailscale/rootfs/etc/s6-overlay/s6-rc.d/tailscaled/run
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ if ! bashio::debug ; then
options+=(--no-logs-no-support)
fi

# Use userspace networking by default when not set, or when explicitly enabled
if ! bashio::config.has_value "userspace_networking" || \
bashio::config.true "userspace_networking";
then
options+=(--tun=userspace-networking)
fi

# Run Tailscale
if bashio::debug ; then
exec /opt/tailscaled "${options[@]}"
Expand Down
8 changes: 8 additions & 0 deletions tailscale/translations/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,11 @@ configuration:
This option allows you to enable Taildrop, a file sharing service
that allows you to share files with other Tailscale nodes.
When not set, this option is enabled by default.
userspace_networking:
name: Userspace networking mode
description: >-
This option allows you to enable userspace networking mode.
If you need to access other clients on your Tailnet from your Home
Assistant instance, disable userspace networking mode, which will create a
`tailscale0` network interface on your host.
When not set, this option is enabled by default.