- Update tailscale to version 1.36.0 - Patch iptables support Tailscale does not (yet) support nftables. Tailscale allows running with --netfilter=off allowing end-user to create his own firewall rules, but this affects only tailscale cli, not tailscaled daemon, so connection cannot be made without error telling that tailscaled was unable to determine execute iptables for determining it's version. There is a work-around for those who do not want nft-iptables compatibility package; they can create a script to /usr/bin/iptables which responds to --version argument and echos fake version string and on any other arguments or no arguments, just exits. After this procedure and starting tailscale cli with netfilter off- it works. Openwrt has moved on to nftables, so iptables manipulation seems unnecessary. Especially for other reasons, on Openwrt, firewall should be configured on it's own, because firewall rules made by other software, such as tailscale, loose their firewalling rules when firewall restarts. So I patched it to allow "fake" iptables pointing to executable /bin/false and ignoring version request. And I also set cli to default to netfilter off setting. If still end-user wants to use iptables, this patch does not make it impossible; just install iptables, or nft-iptables, and run tailscale with argument --netfilter=on and it works out as it did before, tailscaled daemon still matches with iptables if it is found in $PATH. Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>
53 lines
1.2 KiB
Diff
53 lines
1.2 KiB
Diff
--- a/go.mod
|
|
+++ b/go.mod
|
|
@@ -2,6 +2,8 @@ module tailscale.com
|
|
|
|
go 1.19
|
|
|
|
+replace github.com/coreos/go-iptables => ./patched/go-iptables
|
|
+
|
|
require (
|
|
filippo.io/mkcert v1.4.3
|
|
github.com/Microsoft/go-winio v0.6.0
|
|
--- a/patched/go-iptables/iptables/iptables.go
|
|
+++ b/patched/go-iptables/iptables/iptables.go
|
|
@@ -149,12 +149,39 @@ func New(opts ...option) (*IPTables, err
|
|
return ipt, nil
|
|
}
|
|
|
|
+func NewFake(opts ...option) (*IPTables, error) {
|
|
+
|
|
+ ipt := &IPTables{
|
|
+ path: "/bin/false",
|
|
+ proto: ProtocolIPv4,
|
|
+ hasCheck: false,
|
|
+ hasWait: false,
|
|
+ waitSupportSecond: false,
|
|
+ hasRandomFully: false,
|
|
+ v1: 0,
|
|
+ v2: 0,
|
|
+ v3: 0,
|
|
+ mode: "legacy",
|
|
+ timeout: 0,
|
|
+ }
|
|
+
|
|
+ for _, opt := range opts {
|
|
+ opt(ipt)
|
|
+ }
|
|
+
|
|
+ return ipt, nil
|
|
+}
|
|
+
|
|
// New creates a new IPTables for the given proto.
|
|
// The proto will determine which command is used, either "iptables" or "ip6tables".
|
|
func NewWithProtocol(proto Protocol) (*IPTables, error) {
|
|
return New(IPFamily(proto), Timeout(0))
|
|
}
|
|
|
|
+func NewFakeWithProtocol(proto Protocol) (*IPTables, error) {
|
|
+ return NewFake(IPFamily(proto), Timeout(0))
|
|
+}
|
|
+
|
|
// Proto returns the protocol used by this IPTables.
|
|
func (ipt *IPTables) Proto() Protocol {
|
|
return ipt.proto
|