Skip to content

Nuface Blog

隨意隨手記 Casual Notes

Menu
  • Home
  • About
  • Services
  • Blog
  • Contact
  • Privacy Policy
  • Login
Menu

OPNsense Firewall Schedules — Overview and Usage

Posted on 2025-11-122025-11-12 by Rico

🧭 1. Overview

In OPNsense, Firewall Schedules allow you to control when a firewall rule is active.
You can define specific days and time ranges during which a rule should apply.

Common use cases:

  • Restrict users’ Internet access to working hours;
  • Enable remote access only during weekdays;
  • Block downloads during weekends;
  • Automate nightly rule disabling.

Essentially, it’s a time-based control mechanism for your firewall rules.


⚙️ 2. How It Works

When a schedule is assigned to a firewall rule,
that rule is only active during the defined time window.
Outside of that window, it is automatically disabled.

Schedules are configured in:

Firewall → Settings → Schedules

🧩 3. Creating a Schedule

Step 1 – Define Schedule

Firewall → Settings → Schedules → +Add

FieldDescription
Namee.g., WorkHours
DescriptionExplain its purpose
Time RangeStart and end time (e.g., 08:00–18:00)
DaysSelect active days (e.g., Mon–Fri)
ColorVisual indicator for GUI display

You can add multiple time periods per schedule (e.g., weekdays + partial weekends).


Step 2 – Apply Schedule to a Rule

Go to:

Firewall → Rules → [Interface]

Add or edit a rule, then under Advanced Options, set:

Schedule: WorkHours

The rule will automatically enable and disable based on this schedule.


Step 3 – Verify

Outside of the schedule, the rule is shown greyed out and inactive.
State entries associated with expired schedules are automatically removed.


💡 4. Example Use Cases

Example 1: Restrict Internet Access for Students

Schedule: Student_Network
Days: Mon–Fri
Time: 07:00–22:00

Applied to rule:

Source: 192.168.50.0/24
Action: Pass
Schedule: Student_Network

→ Students can access the Internet only between 7 AM and 10 PM.


Example 2: Allow VPN Access Only During Work Hours

Schedule: Office_VPN
Days: Mon–Fri
Time: 08:00–18:00

→ The VPN rule on WAN is active only during office hours.


Example 3: Block P2P Traffic on Weekends

Schedule: Block_P2P_Weekend
Days: Sat–Sun
Time: 00:00–23:59

→ Automatically blocks torrent ports every weekend.


🧠 5. Advanced Tips

TipDescription
Multiple time rangesOne schedule can have multiple daily segments.
Combine with AliasesTarget specific users, IPs, or groups.
Logging & InsightSchedule transitions appear in logs and can be analyzed.
Auto session cleanupWhen a schedule expires, related sessions are cleared automatically.

✅ 6. Summary

Firewall Schedules bring automation and precision to your OPNsense rule management.
They allow administrators to:

  • Control access based on time;
  • Reduce manual rule toggling;
  • Improve security and compliance.

Perfect for environments such as schools, offices, and shared networks.

Recent Posts

  • Postfix + Let’s Encrypt + BIND9 + DANE Fully Automated TLSA Update Guide
  • Postfix + Let’s Encrypt + BIND9 + DANE TLSA 指紋自動更新完整教學
  • Deploying DANE in Postfix
  • 如何在 Postfix 中部署 DANE
  • DANE: DNSSEC-Based TLS Protection

Recent Comments

  1. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on High Availability Architecture, Failover, GeoDNS, Monitoring, and Email Abuse Automation (SOAR)
  2. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on MariaDB + PostfixAdmin: The Core of Virtual Domain & Mailbox Management
  3. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Daily Operations, Monitoring, and Performance Tuning for an Enterprise Mail System
  4. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Final Chapter: Complete Troubleshooting Guide & Frequently Asked Questions (FAQ)
  5. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Network Architecture, DNS Configuration, TLS Design, and Postfix/Dovecot SNI Explained

Archives

  • December 2025
  • November 2025
  • October 2025

Categories

  • AI
  • Apache
  • Cybersecurity
  • Database
  • DNS
  • Docker
  • Fail2Ban
  • FileSystem
  • Firewall
  • Linux
  • LLM
  • Mail
  • N8N
  • OpenLdap
  • OPNsense
  • PHP
  • QoS
  • Samba
  • Switch
  • Virtualization
  • VPN
  • WordPress
© 2025 Nuface Blog | Powered by Superbs Personal Blog theme