You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/util/linuxfw
Oliver Ford 0452b1d520
util/linuxfw: fix only implicitly accepted forward pkts
This rule appears intended to `ACCEPT` the packets `MARK`ed in the rule
immediately prior; for that to work though the `MARK` rule would need to
be in the `mangle` table, as it's here in the `filter` table it doesn't
match, the chain continues, and the packets happen to be accepted once
they fall-through and hit (rely on) the `FORWARD` table's default
`ACCEPT` policy.

This commit changes the `ACCEPT` rule to explicitly match the same as
`MARK`ed above, so as not to rely on this implicit behaviour (and have a
misleading no-op rule).

Note also - I have not found it documented - that for devices behind the
subnet router to be able to reach the tailnet (as opposed to vice
versa), there will need to be an additional rule added by the user, such
as:

    -t mangle -A FORWARD -s 192.168.88.0/24 -i veth-tailscale -o tailscale0 -j MARK --set-xmark 0x40000/0xff0000

where `192.168.88.0/24` is the subnet behind the subnet router (that
should be able to access the tailnet; not necessarily equivalent to the
advertised routes) and `veth-tailscale` is the LAN interface - or else
to ensure that these packets are equivalently accepted and masqueraded
as if marked.

A better fix (it would preserve the ability to handle LAN-initiated
routing with a single `MARK` rule as above) might be to instead move the
`MARK` rule to a (new) `ts-forward` chain in the `mangle` table, so that
it can be matched here with the existing rule.

Signed-off-by: Oliver Ford <dev@ojford.com>
1 week ago
..
linuxfwtest util/linuxfw: initial implementation of package 3 years ago
detector.go all: rename variables with lowercase-l/uppercase-I 2 months ago
fake.go util/linuxfw, feature/buildfeatures: add ts_omit_iptables to make IPTables optional 4 months ago
fake_netfilter.go cmd/containerboot,kube/ingressservices: proxy VIPService TCP/UDP traffic to cluster Services (#15897) 8 months ago
helpers.go util/slicesx: add FirstElementEqual and LastElementEqual 1 year ago
iptables.go util/linuxfw: fix 32-bit arm regression with iptables 3 months ago
iptables_disabled.go util/linuxfw: fix 32-bit arm regression with iptables 3 months ago
iptables_for_svcs.go util/linuxfw,wgengine/router: add new netfilter rules for HA ingresses (#15896) 8 months ago
iptables_for_svcs_test.go util/linuxfw, feature/buildfeatures: add ts_omit_iptables to make IPTables optional 4 months ago
iptables_runner.go util/linuxfw: fix only implicitly accepted forward pkts 1 week ago
iptables_runner_test.go util/linuxfw: fix only implicitly accepted forward pkts 1 week ago
linuxfw.go tsconst, util/linuxfw, wgengine/router: move Linux fw consts to tsconst 4 months ago
nftables.go util/linuxfw, feature/buildfeatures: add ts_omit_iptables to make IPTables optional 4 months ago
nftables_for_svcs.go util/linuxfw,wgengine/router: add new netfilter rules for HA ingresses (#15896) 8 months ago
nftables_for_svcs_test.go util/linuxfw,wgengine/router: add new netfilter rules for HA ingresses (#15896) 8 months ago
nftables_runner.go util/linuxfw,wgengine/router: add new netfilter rules for HA ingresses (#15896) 8 months ago
nftables_runner_test.go util/linuxfw: fix delete snat rule (#15763) 9 months ago
nftables_types.go util/linuxfw: add new arch build constraints 3 years ago