Movatterモバイル変換


[0]ホーム

URL:


tsaddr

package
v1.92.2Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2025 License:BSD-3-ClauseImports:8Imported by:77

Details

Repository

github.com/tailscale/tailscale

Links

Documentation

Overview

Package tsaddr handles Tailscale-specific IPs and ranges.

Index

Constants

View Source
const (TailscaleServiceIPString   = "100.100.100.100"TailscaleServiceIPv6String = "fd7a:115c:a1e0::53")

Variables

This section is empty.

Functions

funcAllIPv4added inv1.24.0

func AllIPv4()netip.Prefix

AllIPv4 returns 0.0.0.0/0.

funcAllIPv6added inv1.24.0

func AllIPv6()netip.Prefix

AllIPv6 returns ::/0.

funcCGNATRange

func CGNATRange()netip.Prefix

CGNATRange returns the Carrier Grade NAT address range thatis the superset range that Tailscale assigns out of.Seehttps://tailscale.com/s/cgnatNote that Tailscale does not assign out of the ChromeOSVMRange.

funcChromeOSVMRange

func ChromeOSVMRange()netip.Prefix

ChromeOSVMRange returns the subset of the CGNAT IPv4 range used byChromeOS to interconnect the host OS to containers and VMs. Weavoid allocating Tailscale IPs from it, to avoid conflicts.

funcContainsExitRouteadded inv1.76.0

func ContainsExitRoute(rrviews.Slice[netip.Prefix])bool

ContainsExitRoute reports whether rr contains at least one of IPv4 orIPv6 /0 (exit) routes.

funcContainsExitRoutesadded inv1.24.0

func ContainsExitRoutes(rrviews.Slice[netip.Prefix])bool

ContainsExitRoutes reports whether rr contains both the IPv4 andIPv6 /0 route.

funcContainsNonExitSubnetRoutesadded inv1.50.0

func ContainsNonExitSubnetRoutes(rrviews.Slice[netip.Prefix])bool

ContainsNonExitSubnetRoutes reports whether v contains SubnetRoutes other than ExitNode Routes.

funcExitRoutesadded inv1.24.0

func ExitRoutes() []netip.Prefix

ExitRoutes returns a slice containing AllIPv4 and AllIPv6.

funcFilterPrefixesCopyadded inv1.24.0

func FilterPrefixesCopy(inviews.Slice[netip.Prefix], f func(netip.Prefix)bool) []netip.Prefix

FilterPrefixes returns a new slice, not aliasing in, containing elements ofin that match f.

funcIsExitRouteadded inv1.76.0

func IsExitRoute(pnetip.Prefix)bool

IsExitRoute reports whether p is an exit node route.

funcIsTailscaleIP

func IsTailscaleIP(ipnetip.Addr)bool

IsTailscaleIP reports whether IP is an IP address in a range thatTailscale assigns from.

funcIsTailscaleIPv4added inv1.78.0

func IsTailscaleIPv4(ipnetip.Addr)bool

IsTailscaleIPv4 reports whether an IPv4 IP is an IP address thatTailscale assigns from.

funcIsViaPrefixadded inv1.24.0

func IsViaPrefix(pnetip.Prefix)bool

IsViaPrefix reports whether p is a CIDR in the Tailscale "via" range.See TailscaleViaRange.

funcMapViaadded inv1.24.0

func MapVia(siteIDuint32, v4netip.Prefix) (vianetip.Prefix, errerror)

MapVia returns an IPv6 "via" route for an IPv4 CIDR in a given siteID.

funcPrefixIs4added inv1.16.0

func PrefixIs4(pnetip.Prefix)bool

PrefixIs4 reports whether p is an IPv4 prefix.

funcPrefixIs6added inv1.16.0

func PrefixIs6(pnetip.Prefix)bool

PrefixIs6 reports whether p is an IPv6 prefix.

funcPrefixesContainsIPadded inv1.20.0

func PrefixesContainsIP(ipp []netip.Prefix, ipnetip.Addr)bool

PrefixesContainsIP reports whether any prefix in ipp contains ip.

funcSortPrefixesadded inv1.34.0

func SortPrefixes(p []netip.Prefix)

SortPrefixes sorts the prefixes in place.

funcTailscale4To6added inv1.2.0

func Tailscale4To6(ipv4netip.Addr)netip.Addr

Tailscale4To6 returns a Tailscale IPv6 address that maps 1:1 to thegiven Tailscale IPv4 address. Returns a zero IP if ipv4 isn't aTailscale IPv4 address.

funcTailscale4To6Placeholderadded inv1.6.0

func Tailscale4To6Placeholder()netip.Addr

Tailscale4To6Placeholder returns an IP address that can be used asa source IP when one is required, but a netmap didn't provideany. This address never gets allocated by the 4-to-6 algorithm incontrol.

Currently used to work around a Windows limitation when programmingIPv6 routes in corner cases.

funcTailscale4To6Rangeadded inv1.2.0

func Tailscale4To6Range()netip.Prefix

Tailscale4To6Range returns the subset of TailscaleULARange used forauto-translated Tailscale ipv4 addresses.

funcTailscale6to4added inv1.24.0

func Tailscale6to4(ipv6netip.Addr) (netip.Addr,bool)

Tailscale6to4 returns the IPv4 address corresponding to the giventailscale IPv6 address within the 4To6 range. The IPv4 addressand true are returned if the given address was in the correct range,false if not.

funcTailscaleEphemeral6Rangeadded inv1.8.0

func TailscaleEphemeral6Range()netip.Prefix

TailscaleEphemeral6Range returns the subset of TailscaleULARangeused for ephemeral IPv6-only Tailscale nodes.

funcTailscaleServiceIPadded inv1.0.1

func TailscaleServiceIP()netip.Addr

TailscaleServiceIP returns the IPv4 listen address of servicesprovided by Tailscale itself such as the MagicDNS proxy.

For IPv6, use TailscaleServiceIPv6.

funcTailscaleServiceIPv6added inv1.20.0

func TailscaleServiceIPv6()netip.Addr

TailscaleServiceIPv6 returns the IPv6 listen address of the servicesprovided by Tailscale itself such as the MagicDNS proxy.

For IPv4, use TailscaleServiceIP.

funcTailscaleULARangeadded inv1.2.0

func TailscaleULARange()netip.Prefix

TailscaleULARange returns the IPv6 Unique Local Address range thatis the superset range that Tailscale assigns out of.

funcTailscaleViaRangeadded inv1.24.0

func TailscaleViaRange()netip.Prefix

TailscaleViaRange returns the IPv6 Unique Local Address subset rangeTailscaleULARange that's used for IPv4 tunneling via IPv6.

funcUnmapViaadded inv1.24.0

func UnmapVia(ipnetip.Addr)netip.Addr

UnmapVia returns the IPv4 address that corresponds to the provided Tailscale"via" IPv4-in-IPv6 address.

If ip is not a via address, it returns ip unchanged.

funcWithoutExitRouteadded inv1.76.0

func WithoutExitRoute(rrviews.Slice[netip.Prefix])views.Slice[netip.Prefix]

WithoutExitRoute returns rr unchanged if it has 0 /0routes. If it has a IPv4 or IPv6 /0 routes, then it returnsa copy with all /0 routes removed.

funcWithoutExitRoutesadded inv1.76.0

func WithoutExitRoutes(rrviews.Slice[netip.Prefix])views.Slice[netip.Prefix]

WithoutExitRoutes returns rr unchanged if it has only 1 or 0 /0routes. If it has both IPv4 and IPv6 /0 routes, then it returnsa copy with all /0 routes removed.

Types

This section is empty.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp