We are setting up ZeroTier network rules to control communication between devices based on user roles and device types. Specifically, we want to achieve the following:
- SSAdmin Role: Users with the SSAdmin role (userrole 400) should have unrestricted access to all devices within the network.
- SuperAdmin Role: Users with the SuperAdmin role (userrole 300) should also have full access to all systems.
- Ventilation Role: Users with the Ventilation role (userrole 200) should be able to communicate only with devices classified as ventilationdev (devicetype 100).
- Device-to-Device Communication: Devices that share the same devicetype should be able to communicate with each other. For example, all devices with devicetype 100 (ventilationdev) should be able to communicate freely with each other.
The current rule configuration is causing communication to fail when both userrole and devicetype tags are set, even though they are supposed to match according to the rules. While simple device-to-device communication based on devicetype works, adding a userrole seems to break the expected behavior.
This should work…
# Define a tag for device types (devicetype)
tag devicetype
id 3
enum 100 ventilationdev # Ventilation System
enum 101 accountingdev # Accounting System
enum 102 integradev # Integra System
enum 103 maintenancedev # Maintenance Device
default 0;
# Define a tag for user roles (userrole)
tag userrole
id 2
enum 200 ventilation # User with access to Ventilation Systems
enum 201 accounting # User with access to Accounting Systems
enum 202 integra # User with access to Integra Systems
enum 203 maintenance # Maintenance user with access to Ventilation and Integra
enum 300 superadmin # SuperAdmin with full access to all systems
enum 400 ssadmin # SSAdmin with full access to everything
default 0;
# SSAdmin has full access to everything
accept teq userrole 400;
# SuperAdmin has access to all systems
accept teq userrole 300;
# Allow 'ventilation' userrole to communicate with 'ventilationdev' devices
accept tor userrole 200 teq devicetype 100;
# Allow 'ventilationdev' devices to communicate with other 'ventilationdev' devices
accept teq devicetype 100;
# Drop all non-IP-based traffic
drop
not ethertype ipv4
and not ethertype arp
and not ethertype ipv6
;
# Allow all other traffic (for testing purposes)
accept;
I hope someone can help me in the right direction