Skip to content

Instantly share code, notes, and snippets.

@laduke
Last active December 17, 2020 17:39
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save laduke/1cdced0b2eef86bdd6990c8474adfeb7 to your computer and use it in GitHub Desktop.
Save laduke/1cdced0b2eef86bdd6990c8474adfeb7 to your computer and use it in GitHub Desktop.
ZeroTier Rules Engine - Hub and Spoke - Client Isolation

Common ZeroTier Rules Engine question

  • Non-servers can talk to servers, but not each other
  • Kind of like Client Isolation on some WiFi controllers

Rules

# Allow only IPv4, IPv4 ARP, and IPv6 Ethernet frames. Typical default
drop
not ethertype ipv4
and not ethertype arp
and not ethertype ipv6
;

# Is this member a server?
tag server
id 2
enum 0 No
enum 1 Yes
default Yes
;

# if both members are not servers
break
not tor server 1
;

# Accept anything else. This is required since default is 'drop'.
accept;
  • After saving the rules, you'll see a Tags Matrix at the bottom of the Flow Rules section
@d21d3q
Copy link

d21d3q commented Jul 24, 2018

How about making one directional traffic from server to non server - so that only server can open connection to non-server?
Can tdiff be used for detecting direction together with chr tcp_syn?

@janjaapbos
Copy link

you can use capabilities for that

@filipeandre
Copy link

filipeandre commented Dec 11, 2018

Can you give an example @janjaapbos ?

@laduke
Copy link
Author

laduke commented Jan 2, 2019

As far as I know, gists don't send notifications to anyone unfortunately. Maybe someone should make a question on superuser.com or something like that. There's an example of blocking syn in the manual, if anyone wants to try to make it with with tags/caps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment