Have an assigned IoT interface, a working WAN route and appropriate outbound NAT for its private IPv4 subnet before starting. Keep management access and a rollback path available. Build the IOT rules in order: permit required local services, block internal destinations, permit external destinations during the schedule, then block the rest. Remove any earlier pass to any that defeats that path. Apply this example to IPv4; add and test an equivalent IPv6 policy if the interface uses IPv6 before describing its routed access as isolated.

1. Check the Interface and Existing Rules

Use a separate IoT interface or VLAN with its own IPv4 subnet and DHCP scope. Replace IOT and 192.168.30.0/24 with your actual network, and confirm the test client receives an address there. Test traffic that crosses the firewall: these routed rules do not stop two clients communicating directly within the same VLAN. Use switch or wireless client-isolation controls if that is also required.

Use Firewall → Rules → IOT for the legacy interface-rule screen described here. If your release uses Firewall → Rules [new], select IOT there and inspect its effective rules instead of duplicating the policy in both screens. Read OPNsense’s processing order[1]: automatic, floating and group rules can precede interface rules, and new-screen interface rules precede legacy interface rules when both are present. Check relevant destination-NAT rules too; a NAT-associated Pass can bypass the filter rules. Record that effective path and the current IPv6 rules separately. You are done when the client is on IOT, the applicable rules are recorded and management access has a rollback path.

2. Create the Network Aliases

In Firewall → Aliases, create a Networks alias called IoT_Network containing your IoT subnet. Create another Networks alias called Internal_IPv4 containing the destinations you need IoT clients kept away from. Start with your actual LAN, management and other local routed subnets; include 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 if the intent is to block all RFC1918 destinations. Add any internally routed public-address range you use. OPNsense's alias guide[2] defines Networks entries as CIDR values and explains how an alias condenses rule changes.

Give any printer or camera needing a different rule a stable IP, then create a Hosts alias for that address. Do not put a MAC address in it; Hosts entries accept IP addresses or hostnames. You are done when the alias list shows both network aliases with the exact protected ranges and any required single-device alias.

3. Set and Test the Schedule

In the current OPNsense interface, schedules are under Firewall → Advanced → Schedules. Create IoT_Internet_Allowed for the days and local time window you want, then save it. For example, a 06:00–23:00 window means a scheduled pass rule is active during that interval. Check the firewall's time zone and clock so the window means what you think it means.

Check Schedule States under Firewall → Settings → Advanced against the advanced-settings manual[3]. By default, expiration removes the scheduled rule’s states; that option can preserve existing connections instead. In either case, the inactive rule is skipped and a later matching pass can permit a new flow. Keep the explicit off-hours block, then test both a new connection and one opened before expiration with a short temporary window. Restore the intended schedule without changing the system clock. You are done when the local-time window, existing-state behavior and off-hours block match your intended policy.

4. Arrange the IOT Rules

Add the table’s rules on the IOT interface, with IPv4, incoming direction and default Quick/first-match behavior selected. Set Source to IoT_Network and leave Source port as any. Set the protocol to TCP/UDP for DNS, UDP for NTP and any for rows 3–5 so the blocks and external policy cover more than TCP. Apply the ordered rules and inspect their effective position against the automatic, floating, group and other-screen rules.

Order Action Destination Port Schedule Purpose
1 Pass Your chosen DNS server TCP/UDP 53 None DNS only, if needed
2 Pass Your chosen NTP server UDP 123 None Time only, if needed
3 Block Internal_IPv4 Any None Stop internal destinations
4 Pass Invert Internal_IPv4 Any IoT_Internet_Allowed External access during the window
5 Block Any Any None Catch traffic after the window

For the DNS rule, choose the actual resolver address the IoT clients use: the firewall's IOT address, or a specifically approved server on another subnet. Use both TCP and UDP 53 if the resolver needs both. Add the NTP exception only if your devices actually use a local NTP server. These narrow passes belong above the internal block because the resolver or NTP server may have an internal IP. A service exception permits only that destination and port; it does not open the rest of the LAN.

The internal block's Destination is Internal_IPv4 with Destination / Invert left unchecked. It matches the local destinations you listed. The scheduled external pass is where you check Destination / Invert: it matches destinations outside Internal_IPv4 only. Never set a scheduled pass to any above the internal block; it would pass local traffic during the window. OPNsense documents destination inversion[1] as reversing the address match.

Keep the final block explicit so new external flows reach it when the scheduled pass is inactive, even if another interface rule follows. Inspect relevant old states in Firewall → Diagnostics → States after rule or alias edits; existing states can continue under their earlier policy. Reset only the test sessions that need reevaluation, and use the separate Schedule States check for expiration behavior. You are done with the rule order when the effective passes and blocks match the intended path and no earlier rule or retained state bypasses it.

5. Verify From an IoT Client

From a device on the IoT subnet, test the effective policy, not just the table's appearance:

  1. During the schedule, resolve a name through the approved DNS server and open a public site. Check the source address and that the connection really traverses the IOT interface.
  2. Attempt a new TCP connection to a known service on each protected LAN or management subnet, choosing a service outside the DNS, NTP and other explicit exceptions. It should fail during and outside the schedule. Ping alone is a weak proof because the target may ignore ICMP.
  3. Try an unauthorized internal DNS server. It should hit the internal block, while the approved resolver still works.
  4. During a short off-hours test window, open a new public connection; it should fail. Also check a connection opened before expiration against the chosen Schedule States behavior. Restore your intended schedule afterward.
  5. If IPv6 is enabled for IoT, repeat equivalent internal and external tests over IPv6. Until those pass against an IPv6 rule set, describe this as IPv4 isolation only.

Enable logging on both block rules, then open Firewall → Log Files → Live View and filter for the IoT client. Use current rule counters and fresh test flows to identify the matched rule. The logging manual[4] notes that an established state normally produces no further log lines for that flow; older rule labels can also become inaccurate after edits. Check states and the effective ruleset when the log appears incomplete. You are done when each fresh client test agrees with the intended rule and its current evidence.

6. Maintain and Recheck the Boundary

Update Internal_IPv4 when you add a protected subnet or a protected firewall address, including internally used public ranges. If you deliberately need cross-VLAN discovery, configure that discovery scope and add only the application-service exception the integration needs. Keep the internal block; a broad pass is not a substitute for checking the reflector and the device connection separately.

You are done when the tests confirm approved local services, blocked internal IPv4 destinations, scheduled external access and the off-hours catch-all. Repeat them after network changes, with IPv6 and higher-priority rules included in the same review.