Skip to content

Feature request: allow specifying the UDP listen port #143

Open

Description

@jpovixwm

Instead of relying on UPnP/NAT-PMP/PCP, I'd rather just port forward manually. Currently, this isn't feasible because the port Tailcat listens on is randomized with every invocation.
I was able to get the desired behavior by building Tailcat with a hardcoded ListenPort in createEngine(logf logger.Logf, lb *locoBackend):

tailcat/tailcat.go

Lines 1879 to 1885 in b4dc28e

func createEngine(logf logger.Logf, lb *locoBackend) (err error) {
sys := &lb.sys
conf := wgengine.Config{
ListenPort: 0,
NetMon: sys.NetMon.Get(),
Dialer: sys.Dialer.Get(),
SetSubsystem: sys.Set,

Compared to the default behavior, this makes both of the UDP listeners (IPv4 and IPv6) use the same port number, whereas the published v0.7.0 build tends to listen on two adjacent ports N (IPv4) and N-1 (IPv6) on my system.

So it looks like all the internals are already there, Tailcat just needs to wire a global --listen-port flag and possibly add some validation around tailcat forward arg parsing and such to reject "funky" configurations that would attempt to forward the port or something.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions