David Anderson
4c61ebacf4
wgengine: move DNS configuration out of wgengine/router.
...
Signed-off-by: David Anderson <danderson@tailscale.com>
5 years ago
David Anderson
fcfc0d3a08
net/dns: remove ManagerConfig, pass relevant args directly.
...
Signed-off-by: David Anderson <danderson@tailscale.com>
5 years ago
David Anderson
0a84aaca0a
wgengine/router: remove unused wireguard *Device argument.
...
Signed-off-by: David Anderson <danderson@tailscale.com>
5 years ago
David Anderson
672731ac6f
many: gofmt.
...
Signed-off-by: David Anderson <danderson@tailscale.com>
5 years ago
David Anderson
9f7f2af008
wgengine/router/dns: move to net/dns.
...
Preparation for merging the APIs and whatnot.
Signed-off-by: David Anderson <danderson@tailscale.com>
5 years ago
Brad Fitzpatrick
d580b3f09e
wgengine/router: fix go vet failure on BSDs
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
5 years ago
Denton Gentry
bcea88da46
wgengine: support FreeBSD with IPv6.
...
Fixes https://github.com/tailscale/tailscale/issues/1307 for keepsies.
We cannot set the tun interface address as a /128 on FreeBSD,
due to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=218508
Instead we set the interface address as a /48, which is enabled
by commit 82edf94df7 .
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
5 years ago
Denton Gentry
c8af6bc009
Revert "freebsd: ignore IPv6 for now"
...
This reverts commit 061422affc .
We have a way to support IPv6 on FreeBSD now.
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
5 years ago
Denton Gentry
061422affc
freebsd: ignore IPv6 for now
...
FreeBSD tun devices don't work with the way we implement IPv6
https://github.com/tailscale/tailscale/issues/1307
At least for now, remove any IPv6 addresses from the netmap.
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
5 years ago
Brad Fitzpatrick
88ab0173a7
wgengine/router: fix BSD router to support multiple local addrs, IPv6
...
Fixes #1201
5 years ago
Josh Bleecher Snyder
2fe770ed72
all: replace wgcfg.IP and wgcfg.CIDR with netaddr types
...
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
5 years ago
Brad Fitzpatrick
6d14678009
wgengine/router: remove unnecessary newlines in log.Printf formats
6 years ago
Mike Kramlich
6fa7a9a055
wgengine/router/router_userspace_bsd: on Mac the route program syntax expects delete not del -- this had caused router reconfig to fail in some cases. Fixes #673
...
Signed-off-by: Mike Kramlich <groglogic@gmail.com>
6 years ago
Dmytro Shynkevych
28e52a0492
all: dns refactor, add Proxied and PerDomain flags from control ( #615 )
...
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
6 years ago
Dmytro Shynkevych
8c850947db
router: split off sandboxed path from router_darwin ( #624 )
...
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
6 years ago
Dmytro Shynkevych
2ce2b63239
router: stop iOS subprocess sandbox violations ( #617 )
...
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
6 years ago
Dmytro Shynkevych
30bbbe9467
wgengine/router: dns: unify on *BSD, multimode on Linux, Magic DNS ( #536 )
...
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
6 years ago
Reinaldo de Souza
a8635784bc
wgengine: add BSD userspace router to darwin
...
Darwin and FreeBSD are compatible enough to share the userspace router.
The OSX router delegates to the BSD userspace router unless `SetRoutesFunc` is set.
That preserves the mechanism that allows `ipn-go-bridge` to specify its own routing behavior.
Fixes #177
Signed-off-by: Reinaldo de Souza <github@rei.nal.do>
6 years ago
David Anderson
9ccbcda612
wgengine/router: rename config.Settings to config.Config, make pointer.
...
Signed-off-by: David Anderson <danderson@tailscale.com>
6 years ago
David Anderson
b01db109f5
wgengine/router: use inet.af/netaddr, not wgcfg.CIDR.
...
Signed-off-by: David Anderson <danderson@tailscale.com>
6 years ago
David Anderson
b8f01eed34
wgengine/router: remove wireguard-go config from settings.
...
Instead, pass in only exactly the relevant configuration pieces
that the OS network stack cares about.
Signed-off-by: David Anderson <danderson@tailscale.com>
6 years ago
David Anderson
8861bb5a19
wgengine/router: alter API to support multiple addrs, and use on linux.
...
FreeBSD and OpenBSD will error out with a complaint if we pass >1 address
right now, but we don't yet so that's okay.
6 years ago
David Anderson
1ac570def7
wgengine/router: split out from wgengine.
...
The router implementations are logically separate, with their own API.
Signed-off-by: David Anderson <danderson@tailscale.com>
6 years ago
Martin Baillie
8ae3ba0cf5
wgengine: define default tunname for each platform
...
The device name "tailscale0" will be used for all platforms except for
OpenBSD where "tun" is enforced by the kernel. `CreateTUN()` in
`wireguard-go` will select the next available "tunX" device name on the
OpenBSD system.
Signed-off-by: Martin Baillie <martin@baillie.email>
6 years ago
wardn
9390a3ef55
wgengine: properly clean up freebsd routes and interfaces on close
...
Signed-off-by: wardn <wardn@users.noreply.github.com>
6 years ago
David Crawshaw
45d687e213
wgengine: fix build on linux/freebsd/openbsd/windows
...
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
6 years ago
wardn
5d79530caa
wgengine: create freebsd-specific implementation
...
Signed-off-by: wardn <wardn@users.noreply.github.com>
6 years ago
Brad Fitzpatrick
7f5e3febe5
wgengine: move link monitor to be owned by the engine, not the router
...
And make the monitor package portable with no-op implementations on
unsupported operating systems.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
6 years ago
Brad Fitzpatrick
79295b1138
wgengine: simplify, change some signatures
...
* make RouterGen return an error, not take both tunname and tundev
* also remove RouteGen taking a wireguard/device.Device; currently unused
* remove derp parameter (it'll work differently)
* unexport NewUserspaceRouter in per-OS impls, add documented wrapper
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
6 years ago
Brad Fitzpatrick
2896be60db
Move "logger" package to under types, now that we have it.
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
6 years ago
wardn
58ce50389e
wgengine: build for freebsd
...
Signed-off-by: wardn <wardn@users.noreply.github.com>
6 years ago
David Anderson
36f5433476
wgengine: fix the build on darwin, windows, openbsd.
...
7e5e3277 changed the Router interface definition, but forgot to
fix up these platform files.
Signed-off-by: David Anderson <dave@natulte.net>
6 years ago
David Anderson
5c2deb66be
wgengine: remove MTU TODO.
...
The MTU is currently set when creating the tun device,
elsewhere in the code. Maybe someday we'll want some kind
of per-platform MTU configuration here, but not in the
short-medium term.
Signed-off-by: David Anderson <dave@natulte.net>
6 years ago
David Anderson
afa83358f7
wgenging: use logger.Logf type in openbsd router.
...
Signed-off-by: David Anderson <dave@natulte.net>
6 years ago
Martin Baillie
15f8c8dde4
wgengine: add initial rough OpenBSD implementation
...
Signed-off-by: Martin Baillie <martin@baillie.email>
6 years ago