If a tablet cannot open a new page at bedtime but a video keeps playing, check which network the tablet joined, whether the rule covers both IP versions, and whether a connection was already open. Check DNS separately. A blocked query does not tell you what happened to a live connection.
I tested the schedule on an isolated OpenWrt 25.12.6 x86/64 router. During a 30-second pause, fresh IPv4 and IPv6 web requests and established TCP echo sessions timed out. The local lesson server kept returning HTTP 200. New internet requests recovered when the pause ended. The old sockets still timed out on the first retry.
1. Put study devices on their own network
Create a study SSID in Network → Wireless and bind it to a separate interface and firewall zone. On a managed switch or a second AP, carry the study VLAN across the trunk and check the access port's PVID. The screenshots show the actual LuCI lab. Its wired bridge reproduces the routing boundary, so verify wireless association on your own AP.

Find study and library under Network → Interfaces. The lab uses virtual wired ports. Open full-size image
Place the router's management access on a separate wired network. For the study zone, allow only the necessary DHCP, DNS and IPv6 discovery traffic to the router. Add a narrow forward rule from study to the lesson server with its actual IPv4 and IPv6 addresses and port. The lab allows TCP 80 to a single address per family. Private Wi‑Fi addresses can stay enabled when the policy follows the interface. Use DHCP reservations for inventory and network credentials for admission.

Study-to-library-HTTP allows the lesson endpoint. Study-to-local-DNS allows queries to the router. Open full-size image
2. Apply the pause before the established-flow rule
Find the bridge and every real internet egress device. The lab uses br-study, eth1, and eth4. Your PPPoE, VPN, or alternate uplink may have a different name. Check System → System for the clock and time zone. I ran the lab in UTC. Validate a short window in the router's own time configuration before relying on a bedtime schedule.

Check the local time and zone under System → System. This experiment runs in UTC. Open full-size image
In Network → Firewall → General Settings, set Flow offloading type to None for the baseline. An offloaded flow can skip the regular forward hook. If you later need offloading, verify that all managed traffic stays on the path where your policy runs.

Check Flow offloading type under Network → Firewall. The baseline uses None. Open full-size image
Save the following to /etc/nftables.d/60-study-hours.nft and substitute your actual devices and verified hours. The two rules split a recurring 22:00–07:00 pause at midnight. The table is already defined by fw4. The earlier priority lets the rule drop outgoing study traffic before fw4 accepts established connections. It matches both address families and leaves the lesson egress outside its scope. If you also require immediate filtering of downstream packets, add a scoped reverse rule and test both directions.
chain study_hours {
type filter hook forward priority -15; policy accept;
iifname "br-study" oifname { "eth1", "eth4" } meta hour >= "22:00:00" counter drop
iifname "br-study" oifname { "eth1", "eth4" } meta hour < "07:00:00" counter drop
}
date
date -u
ip -br link
fw4 check && /etc/init.d/firewall reload
nft list chain inet fw4 study_hours
Keep a separate management session. To roll back this addition, move the new include out of /etc/nftables.d/, run fw4 check, and reload. Test an existing session, a fresh connection, and the local lesson server before, during, and after the window.

Both new and established WAN probes timed out during the pause. The local lesson stayed reachable. Open full-size image
| Request from a managed client | Before the pause | During the pause | First check after the pause |
|---|---|---|---|
| New HTTP over IPv4 and IPv6 | 200 on both | Both timed out | 200 on both |
| Existing TCP echo over IPv4 and IPv6 | Echo on both | Both timed out | Both still timed out |
| Local lesson over IPv4 and IPv6 | 200 on both | 200 on both | 200 on both |
The lab left the two existing sockets and their conntrack state in place. New HTTP requests recovered first. Exact recovery time for an existing socket depends on TCP retransmission and how the application reconnects.
3. Add a DNS allowlist for managed learning devices
In the lab, dnsmasq-full 2.93 put the A and AAAA answers for the lesson domain in separate nftables sets. Before the DNS queries populated the sets, the external lesson fixture timed out. Afterwards, the allowed address pair returned HTTP 200. The other test address pair still timed out. The internal lesson was reachable throughout.
DNS over TLS commonly uses TCP 853 and DNS over QUIC commonly uses UDP 853. DNS over HTTPS can share 443 with regular web traffic. Manage the resolver in the browser or operating system for supervised devices. Use the platform's account controls for what a user can watch or purchase. An address allowlist applies to the destination IP and can cover multiple sites on a shared CDN.

Only the approved address pair became reachable after the queries populated both sets. Open full-size image
For extra time, record the approver, the device group, the specific service, and an expiry. I tested a temporary dual-stack permission for one HTTP fixture and verified that it expired while the local lesson stayed reachable. Mobile data and other Wi‑Fi networks need their own managed-device policy.

Both address families reverted to denying the second HTTP fixture after the 18-second exception. Open full-size image
Verify a daytime bandwidth cap separately from a nighttime pause
Write down the daytime upload limit and the nighttime access rule separately. Select one managed study device and one unrestricted control. Turn off mobile data. Note each device's SSID, address and gateway so both tests actually use this router.
During allowed hours, upload the same file to your own server from each device using the same path, duration and units. If only the study device approaches its limit and the control can exceed it, the result supports a device-specific cap. If both hit the same ceiling, check for a whole-WAN SQM limit.
During a short test pause, start fresh IPv4 and available IPv6 connections, check an already established connection and download a local lesson. If other devices also lose access, restore the schedule and inspect the source zone. At the end of the window, open fresh connections and repeat the upload. Confirm Internet access returns and the daytime cap still holds.
For class-based shaping, run tc -s class show dev DEVICE with the actual outgoing device. Compare byte counters before and after the upload. Fair sharing by a whole-WAN CAKE queue does not give one device a fixed maximum. Check downloads in the direction toward the client. Restore the normal schedule and previous time zone after testing.
The school site opens, but submitting homework fails
Use one study tablet and keep a separate management port. Back up firewall and DNS settings. With an authorized test account, sign in, open a lesson, play the material and submit a test assignment. Record which host first appears at the failing step. Login, media and upload services can use different addresses.
In LuCI open Network → Firewall. A broad study-to-WAN forwarding permission can still allow other traffic. Check local DHCP and DNS separately from forwarding to approved course destinations. Verify the source zone, address family, destination, protocol and port before applying any restriction.
From SSH, list the actual sets. Replace the example family, table and set names with those on this router. Compare elements before and after a fresh query. On a dual-stack LAN check both address families.
nft list sets
nft list set inet fw4 lesson4
nft list set inet fw4 lesson6
If the query succeeds but the set is empty, check the resolver the tablet used, the returned address family, the dnsmasq instance and the set mapping. A cached browser result need not generate a new query.
If the address is present but submission fails, temporarily allow only the identified upload host. Submit the same test, remove the exception and retry with a new connection. Add a permanent dependency only when the comparison is repeatable.
If an unapproved site still loads, rule out an old connection and compare its addresses with the approved site. An IP set cannot distinguish two sites on the same CDN address. Use a managed browser policy when exact site-level restrictions are required.
Keep a negative control. Test a normally reachable site outside the set over each available address family. The study tablet should submit its assignment but fail to open the control site. An unrestricted device should still reach it. If other devices are affected, restore the original forwarding and DNS settings. Avoid opening an entire CDN range for one lesson.
Why a MAC-only DHCP tag disappears from the OpenWrt dnsmasq configuration
Verify the finished setup from both networks
- Keep the management session open. From a study device, open the local lesson over each address family and verify that LuCI is unreachable from that device.
- Run one existing TCP flow, one fresh WAN request and one lesson request before, during and after a short pause. Check weekends and midnight as separate boundaries.
- Resolve the permitted domain for A and AAAA on the study device, check both sets and test an unapproved control. Repeat after a firewall reload.
- Try a brief extension. Verify automatic expiry and manual revocation, then confirm the main household network still follows its original policy.
Check the traffic rule that lets the study network reach local lessons.

Check the router clock and time zone. This lab uses UTC.

Compare new HTTP requests, established TCP echo sessions and local lessons in all three phases.

Comments