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 UDP port configurable #390

Merged
merged 2 commits into from
Sep 11, 2024
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
13 changes: 13 additions & 0 deletions tailscale/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,19 @@ your tailnet. This will prevent your Home Assistant instance from losing network
connection. This also means that using the same subnet on multiple nodes for load
balancing and failover is impossible with the current add-on behavior.

## Network

### Port: `41641/udp`

UDP port to listen on for WireGuard and peer-to-peer traffic.

Use this option (and router port forwarding) if you experience that Tailscale
can't establish peer-to-peer connections to some of your devices (usually behind
CGNAT networks). You can test connections with `tailscale ping
<hostname-or-ip>`.

When not set, an automatically selected port is used by default.

## Changelog & Releases

This repository keeps a change log using [GitHub's releases][releases]
Expand Down
2 changes: 2 additions & 0 deletions tailscale/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ devices:
- /dev/net/tun
map:
- share:rw
ports:
41641/udp: null
schema:
accept_dns: bool?
accept_routes: bool?
Expand Down
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 @@ -5,6 +5,7 @@
# Runs tailscale
# ==============================================================================
declare -a options
declare udp_port

bashio::log.info 'Starting Tailscale...'

Expand All @@ -16,6 +17,12 @@ if ! bashio::debug ; then
options+=(--no-logs-no-support)
fi

# Use configured UDP port
udp_port=$(bashio::addon.port "41641/udp")
if bashio::var.has_value "${udp_port}"; then
options+=(--port=${udp_port})
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";
Expand Down
4 changes: 4 additions & 0 deletions tailscale/translations/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,7 @@ configuration:
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.
network:
41641/udp: >-
UDP port to listen on for WireGuard and peer-to-peer traffic.
When not set, an automatically selected port is used by default.