Skip to content

Provide mechanism for users to exclude interfaces from disco + endpoint advertisements #1552

Description

@bradfitz

User wishes to exclude an interface from being used for disco + endpoint advertisement:

https://forum.tailscale.com/t/limit-the-network-interfaces-that-are-sent-as-endpoints-for-a-device/88/4

Perhaps we could add TS_AVOID_PREFIX=10.5.4.0/24, which people could add to their /etc/default/tailscale. And then we could check that IPSet for discoverEndpoints and sending disco messages.

An IPSet is probably easier than an interface name. But I suppose we could also accept an interface name and map it to a prefix on start-up (or on a timer or major link change?).

@danderson, thoughts?

Activity

  1. danderson commented on Mar 21, 2021

    @danderson
    Member

    We already have a hack to skip ZeroTier interfaces - we should add Nebula interfaces to that as well.

    More flags, more options: not a huge fan, but if we're getting to a world with a nicer CLI that can blend with daemon flags, I guess it's okay.

  2. bradfitz commented on Mar 21, 2021

    @bradfitz
    MemberAuthor

    It could be just an environment variable for now. But that's hard for Windows users and doesn't work at all currently with netext/sysext macOS.

  3. bradfitz commented on Mar 21, 2021

    @bradfitz
    MemberAuthor

    But I agree there needs to be a plan for CLI and config overall. I guess ignored interfaces really is account specific. I could imagine difficult tailnets wanting that to differ.

  4. danderson commented on Mar 22, 2021

    @danderson
    Member

    I think we can get decent mileage out of a global option, although there's probably edge cases like "only use my static wireguard VPN on my personal account" or somesuch. But no way -> some way is an okay start.

  5. added
    vpn-interop
    on Jul 29, 2021
  6. DentonGentry commented on Sep 4, 2021

    @DentonGentry
    Contributor

    Some overlap with feature request in #1066 (where the discussion is mostly about multilink and/or bonding)

  7. timwhite commented on Dec 23, 2021

    @timwhite

    If we aren't adding a flag, just adding hacks to ignore things like Zerotier, can we ignore existing wireguard tunnels as well? I have a P2P Wireguard link that shouldn't be used for tailscale to also shuffle traffic, double encryption isn't very nice on the CPU.

  8. parasiteoflife commented on Nov 14, 2022

    @parasiteoflife

    In the meantime, is there any way to make Tailscale use a specific interface? I'm currently having this problem, Tailscale is trying to use an interface that has no Internet access.

  9. DentonGentry commented on Nov 14, 2022

    @DentonGentry
    Contributor

    Are you using 1.32.2? #5940 improved detection of which interface to use, and went into 1.32.2.

  10. parasiteoflife commented on Nov 14, 2022

    @parasiteoflife

    Yes, I'm using 1.32.2. The thing is this has not started to happen to me just now, I'm having this problem now because before the other network was "unidentified" but now that I've changed the config and that Windows has recognized it Tailscale wants to use it. I've posted in the forums but here are the interfaces:

      1          75  4294967295  connected     Loopback Pseudo-Interface 1
      7           5        1280  connected     Tailscale
     17          25        1500  connected     Ethernet
     19          35        2800  connected     ZeroTier One [xxxxxxxxxxxxxx]
     16          15        1500  connected     Mellanox
    

    I've managed to make Tailscale login by disabling the Mellanox adapter but after enabling it again it seems it wants to use it no matter what.

  11. atagen commented on Dec 30, 2022

    @atagen

    Tailscale is also routing packets through an unwanted interface for me - any wg tunnel I have seems preferred over the actual local ethernet.
    This has effects from unwanted latency to outright breaking magicDNS and/or tailscale depending on how else things are configured.

    In an odd twist, I've noticed tailscale netcheck shows my correct public IP, but tailscale status on other machines (and their latency) suggest I am connected over the wg tunnel. So at some point it has to be accessing the correct interface, but still ends up routing elsewhere.

  12. oscrx commented on Jan 2, 2023

    @oscrx

    I use tailscale to mesh my kubernetes cluster together. The nodes also get an ip from the CNI (cilium) and after a while tailscale prefers the internal link which causes routing loops and the consumpion of all the cpu. I think this feature where i can select an external interface for tailscale or exclude ip ranges will fix my issue.

    afbeelding

  13. 57 remaining items

  14. added 2 commits that reference this issue on Nov 4, 2025
    9f326c5
    6790022
  15. luckman212 commented on Dec 4, 2025

    @luckman212

    Noticed this today when I found Tailscale was bound to (and routing traffic over) what is supposed to be an internal iSCSI VLAN on one of my Proxmox nodes.

    Definitely a much needed feature!

  16. will4j commented on Dec 8, 2025

    @will4j

    It bite me for 2 days when using tailnet with k8s + calico, currently using patch #17762 to solve this problem.
    expecting a happy ending for this 4 years old issue, this indeed a essential feature for me and I am counting on it.

  17. pcn commented on Dec 22, 2025

    @pcn

    I think that something like #17762 would fix the problems we're seeing. We use unikraft to create about 10k interfaces and probing all of those interfaces is spinning tailscale's wheels. Unikraft is maintaining a fork, but it would be much nicer to have a configuration option to prevent this.

  18. will4j commented on Dec 29, 2025

    @will4j

    FYI, a new flag --relay-server-static-endpoints was added to support configuring static endpoint in tailscale version v1.92.1, see docs here.

    but the ability to exclude specific device by cidr is still needed in my use case.

  19. rem1niscence commented on Jan 7, 2026

    @rem1niscence

    I also ran into a use case where this is being a blocker for me and ended up here, is almost 5 years since this issue was made, is there any specific blocker into why it can not be implemented?

  20. larsyencken commented on Feb 4, 2026

    @larsyencken

    Ran into this issue now for a multi-cloud k8s cluster, where the default networking setup we have makes a vxlan interface over the tailscale connection, then tailscale discovers it and tries to route over it occasionally, breaking the connection and causing node issues. Would love to be able to exclude some interfaces, as in: #17762

  21. larsyencken commented on May 8, 2026

    @larsyencken

    Ran into this issue now for a multi-cloud k8s cluster, where the default networking setup we have makes a vxlan interface over the tailscale connection, then tailscale discovers it and tries to route over it occasionally, breaking the connection and causing node issues. Would love to be able to exclude some interfaces, as in: #17762

    Incidentally, we worked around this issue in our situation by adding a firewall rule to block discovery over the dispreferred interface:

    # These rules block Tailscale disco probes (UDP 41641) on vxlan.calico
    # to prevent path flapping caused by advertising unreachable overlay IPs
    /usr/sbin/nft insert rule ip filter INPUT iifname "vxlan.calico" udp dport 41641 counter drop
    /usr/sbin/nft insert rule ip filter OUTPUT oifname "vxlan.calico" udp dport 41641 counter drop
    
  22. J-Prince commented on May 12, 2026

    @J-Prince

    Incidentally, we worked around this issue in our situation by adding a firewall rule to block discovery over the dispreferred interface:

    Very good idea, but I tried the same thing on OpenWRT, and wasn't able to prevent Tailscale from using another Wireguard available on the same router.

  23. sedlund commented on Sep 14, 2026

    @sedlund

    Using this on NixOS RKE2 Kubernetes cluster with Cilium / WireGuard with WAN worker nodes. Tailscale on the hosts, and Tailscale K8S Operator with proxy pods.

    Took me a while to find this. Unusable performance before this change.

    # Tailscale can discover Cilium's host address as a direct peer
    # endpoint. Allowing UDP transport through cilium_host creates a
    # pathological overlay path, so force peer transport to use the
    # node's external endpoint instead. This is intentionally limited to
    # Tailscale's WireGuard port and does not block Cilium traffic.
    networking.nftables.ruleset = lib.mkIf config.networking.nftables.enable ''
      table inet tailscale_cilium {
        chain output {
          type filter hook output priority -100; policy accept;
          oifname "cilium_host" udp dport 41641 drop comment "avoid Tailscale transport over Cilium host interface"
        }
      }
    '';
  24. baditaflorin commented on Nov 17, 2026

    @baditaflorin

    A related operational case: on Linux hosts with many container bridge interfaces, bridge addresses can be advertised as peer endpoints even when other nodes cannot route to those networks. Peers may then send discovery probes for those addresses through their default route. An egress firewall can block the unwanted traffic, but it does not remove the candidates or stop the probes from being generated.

    A supported per-interface or CIDR exclusion for endpoint advertisement and discovery would help prevent this while preserving discovery on intended LANs. Is there a supported approach in current releases, or an update on the direction proposed in #17762? A synthetic network-namespace reproducer would be useful to test a fix.

  25. added theissue type on Nov 27, 2026
  26. changed the issue type fromtoon Nov 27, 2026
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

    L1 Very fewP2 AggravatingT0 New featurevpn-interop

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions