Skip to content

Commit

Permalink
refactor udp_port
Browse files Browse the repository at this point in the history
  • Loading branch information
lmagyar committed Aug 23, 2024
1 parent 474690b commit 6a904dc
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 21 deletions.
25 changes: 13 additions & 12 deletions tailscale/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ tags:
- tag:example
- tag:homeassistant
taildrop: true
udp_port: 12345
userspace_networking: true
```
Expand Down Expand Up @@ -312,17 +311,6 @@ When not set, this option is enabled by default.

Received files are stored in the `/share/taildrop` directory.

### Option: `udp_port`

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.

### Option: `userspace_networking`

The add-on uses [userspace networking mode][tailscale_info_userspace_networking]
Expand All @@ -345,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
3 changes: 2 additions & 1 deletion 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 All @@ -42,5 +44,4 @@ schema:
tags:
- "match(^tag:[a-zA-Z][a-zA-Z0-9-]*$)?"
taildrop: bool?
udp_port: port?
userspace_networking: bool?
7 changes: 4 additions & 3 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 @@ -17,9 +18,9 @@ if ! bashio::debug ; then
fi

# Use configured UDP port
if bashio::config.has_value "udp_port";
then
options+=(--port=$(bashio::config "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
Expand Down
9 changes: 4 additions & 5 deletions tailscale/translations/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ 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.
udp_port:
name: UDP port
description: >-
UDP port to listen on for WireGuard and peer-to-peer traffic.
When not set, an automatically selected port is used by default.
userspace_networking:
name: Userspace networking mode
description: >-
Expand All @@ -103,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.

0 comments on commit 6a904dc

Please sign in to comment.