Skip to content

Firewall Rules ​

This chapter covers MSST-Net's firewall rules.

What Are Firewall Rules ​

Firewall rules control which devices can access which ports and services on this device.

Each rule specifies:

  • Source (principal): who can (or cannot) access
  • Target (protocol and port): which traffic is allowed or denied
  • Action: allow or deny

MSST-Net uses a default-deny policy: inbound access that matches no rule is always denied (and may trigger interactive authorization depending on the situation).

Rules are stored and enforced by the client core; the controller only creates, displays and manages them.


Managing Rules ​

On the controller's Defense page you can:

  • New Rule: pick a source, target and action step by step in a wizard, then check the rule's summary in the final Confirm step
  • Enable / Disable a rule: disabled rules stay in the list but don't take part in matching
  • Edit: change anything in a permanent rule — source, services or ports, action, note
  • View: see the details of a temporary rule
  • Duplicate as New Rule: use an existing rule as a template for a new one
  • Delete a rule, or Clear all rules

When a rule's ports are exactly those of some common services, the list shows the service names (such as "Minecraft (MCJE)") and lists any other ports as they are.

Permanent and temporary rules ​

Permanent ruleTemporary rule
What it isA rule without an expiry, including those created by "Always allow / Always deny" in interactive authorizationA rule with an expiry, such as those created by "Allow / Deny" in interactive authorization or temporary rules added from the access log
In the listEnable switch + Edit button"Temporary" tag + View button
What you can doEdit everything, enable / disable, deleteView and delete only; it is deleted automatically when it expires

When you edit a permanent rule, the wizard starts with the rule's current content (ports that are exactly some common services show as those services), and the rule keeps its ID. Connections the rule had admitted are re-checked against the edited rule.

On mobile (Android) only a rule's note and enabled state can be changed; edit the source, ports or action on the desktop controller or the WebUI.

Command line ​

With the command-line controller, use the list, add, edit, enable, disable, comment, delete and clear subcommands of msst-net-cli rules, for example:

bash
msst-net-cli rules add --device pc.alice --service minecraft-java              # allow one device to reach Minecraft Java Edition
msst-net-cli rules add --user bob --port tcp/8080 --deny                         # deny a user TCP 8080
msst-net-cli rules add --room-members --port udp/19132 --comment bedrock-lan     # room-level rule
msst-net-cli rules edit 1a2b --group friends --service ssh --action allow        # change a rule's source, target and action
msst-net-cli rules edit 1a2b --comment ""                                        # clear the note

rules edit replaces only what you give (source, target, --action, --comment) and keeps the rest; temporary rules can't be edited. Rules covering all ports (--all-ports) come with the same security warning and need confirmation. rules list marks temporary rules.

On mobile (Android), rules can't be created manually through the wizard, but they can be added:

  • When handling an interactive authorization request
  • From an entry in the access log
  • By long-pressing a room member card

Connection Tracking ​

The MSST-Net firewall performs stateful connection tracking.

When this device initiates an outbound connection, the system automatically records the connection state. Return packets from the peer are allowed automatically, with no extra rules needed.

This means:

  • Return traffic for connections you initiate doesn't need its own rule
  • Rules only control inbound connections initiated by the peer

Once a rule lets an inbound connection in, this device's replies are tracked too, so later packets needn't be matched against the rules every time. The core remembers which rule allowed the connection, so revoking a permission takes effect at once:

ActionEstablished connections
Deleting, disabling or clearing rulesCut immediately; the peer's next packet is judged by the rules again
Leaving a room, or the other member leavingConnections allowed only by a room-level rule (or by sharing the room) are cut immediately
A rule expiringNot cut (for example, a game started after an "Allow" authorization can go on)
Another rule still allows itUnaffected

Rule Priority ​

When multiple rules match the same packet, the system takes the first matching rule in this priority order:

  1. Device-level deny (highest priority)
  2. Device-level allow
  3. User-level deny
  4. User-level allow
  5. Room-level deny
  6. Room-level allow
  7. Default deny (when no rule matches)

Device-level rules take precedence over user-level rules, and user-level rules over room-level rules; within the same level, deny takes precedence over allow; among multiple rules with the same level and action, the one created first wins.


Source (Principal) ​

A rule's source (principal) specifies which devices, users or room members the rule applies to.

Source Types ​

TypeDescription
DeviceThe rule applies only to the specified devices
UserThe rule applies to all devices of that user
RoomThe rule applies to all members currently in the same room as this device

All sources in a single rule must be of the same type.

How to Specify a Source ​

In the rule wizard, you can:

  • Use a named permission group: pick from groups you've created (recommended). The rule is linked to the group and follows its members when they change; see Permission Groups
  • Specify sources manually: enter device or user mnemonics or IDs
  • For Room Mode: match all current room members without specifying individual members

Source Identifiers ​

When specifying sources manually, you can use the following identifiers:

IdentifierExampleDescription
Device IDdevice-a7f29b3eMatches the specified device exactly
User IDuser-1a2b3c4dMatches all devices of that user
Device mnemonicarchlinuxMatches the device with that name under the current user
Combined mnemonicarchlinux.abjustMatches the specified device under the specified user
User mnemonicabjustMatches all devices of the specified user
Wildcard*Matches all devices or all users

Mnemonics are resolved to fixed IDs when they are added: after you enter an identifier in the wizard and click "Add", the client core looks up the device or user it refers to — locally first, then with the coordinator — and shows its name (such as "Bob's PC (pc.bob)"), so you can check you picked the right one. The rule stores the ID. Therefore:

  • If the other party later changes their mnemonic or name, the rule still points to the original device or user
  • An identifier that can't be recognized can't be added, and the rule isn't created
  • The rule list still shows the mnemonic entered at creation time, for easier recognition

When the coordinator only returns an ID (for example, the other device has never connected to this one), only the mnemonic or ID is shown.

Room-level rules don't need specific IDs; the system matches current room members dynamically when a packet arrives.

For details on identifiers, see:

Identifiers


Protocols and Ports ​

A rule's target can be specified in one of the following ways:

MethodDescription
Service (simple)Pick from a list of common services
Protocol/port (advanced)Specify the protocol and port manually
All protocols and ports (not recommended)Matches every port on this device

When you choose "All protocols and ports" or all ports of a protocol, the controller shows a security warning: if the action is "allow", the rule's sources will be able to reach every listening service on this device, including remote desktop, file sharing, databases, debugging interfaces and more. We recommend choosing only the services or ports you actually need.

Protocols ​

Supported protocols:

ValueDescription
tcpMatches TCP traffic only
udpMatches UDP traffic only
tcp+udpMatches both TCP and UDP (stored as two protocol/port groups)

Ports ​

Ports can be specified as:

FormatExampleDescription
Single port25565Matches only that port
Port range8000-9000Matches all ports in the range
Wildcard*Matches all ports (1–65535)

A single rule can contain multiple services or multiple protocol/port groups.


Common Services ​

MSST-Net has built-in protocol and port presets for common services to make rule setup quick:

Games ​

ServiceProtocol / port
Minecraft (Java Edition)tcp/25565
Minecraft (Bedrock Edition)udp/19132
Rusted Warfaretcp/5123
MSST Card Battletcp/9178
Terrariatcp/7777
Factorioudp/34197

Web Services ​

ServiceProtocol / port
HTTPtcp/80
HTTPStcp/443
HTTP/3 (QUIC)udp/443

File Services ​

ServiceProtocol / port
FTPtcp/21
FTPStcp/990
NFStcp/2049
SMB/CIFStcp/445

Databases ​

ServiceProtocol / port
MySQLtcp/3306
PostgreSQLtcp/5432
MongoDBtcp/27017
Redistcp/6379
MSSQLtcp/1433
Oracle DBtcp/1521

Remote Access ​

ServiceProtocol / port
SSHtcp/22
RDPtcp/3389
RDP (UDP)udp/3389
VNCtcp/5900

Other ​

ServiceProtocol / port
SMTPtcp/25
DNSudp/53, tcp/53

Action ​

Each rule's action is one of:

ActionDescription
Allow (allow)Let traffic matching this rule through
Deny (deny)Block traffic matching this rule

Direction ​

The current version only enforces inbound rules, that is, it controls traffic initiated by the peer to access this device. All rules created by the controller are inbound rules.


Expiry ​

Rules can have an expiry time, after which they expire automatically and are removed from the list. Connections established before the expiry are not cut by it; new connections need a new authorization.

Without an expiry time, a rule is valid permanently.

Expiry is commonly used for temporary authorization: when you choose "Allow" or "Deny" (rather than "Always") in interactive authorization, the system creates a rule that expires after 10 minutes.

A rule with an expiry is a temporary rule: it can be viewed and deleted, but not edited or disabled.


Ping (ICMP) ​

ICMP echo requests (ping) aren't controlled by regular rules; instead, they're controlled by the Ping (ICMP) toggle on the Defense page, which is off by default.

When it's on, devices on the network can ping this device's virtual IP.

Other ICMP messages don't go through the rules either, but only the kinds a peer can legitimately send are accepted:

  • Echo replies when this device pings the peer
  • Error messages about a packet this device sent to that device (port unreachable, fragmentation needed, time exceeded, …)

Redirects, router and neighbor discovery, timestamps and the like, and error messages about this device's other connections, are dropped. The same applies to ICMPv6.


Rule Matching Flow ​

When an inbound packet arrives, the system processes it in this order:

  1. A decrypted packet must come from the peer's own virtual IP and be addressed to this device's virtual IP, otherwise it is dropped (ICMP is handled as above)
  2. Check whether it's a return packet for a tracked connection → if so, allow it
  3. Check the unauthenticated restriction: if either side is unauthenticated and the two aren't in the same room → deny
  4. Walk all enabled, unexpired rules in priority order and find the first match
  5. If a matching rule is found, allow or deny according to its action
  6. If no rule matches, either trigger interactive authorization or silently drop, depending on the source

Every decision is recorded in the access log.

See:


Designed by the MSST-Net Developers, built with Claude Code