create_firewall_rule
Define new firewall rules on OPNSense by specifying action, interface, direction, protocol, source, and destination. Configure traffic control for enhanced network security and management.
Instructions
Create a new firewall rule
Input Schema
Name | Required | Description | Default |
---|---|---|---|
action | Yes | Rule action (pass/block/reject) | |
description | No | Rule description | |
destination | Yes | Destination address/network or "any" | |
destinationPort | No | Destination port (for TCP/UDP) | |
direction | Yes | Traffic direction | |
enabled | No | Enable rule | |
interface | Yes | Interface name | |
protocol | Yes | Protocol (any/tcp/udp/icmp) | |
source | Yes | Source address/network or "any" | |
sourcePort | No | Source port (for TCP/UDP) |
Input Schema (JSON Schema)
{
"properties": {
"action": {
"description": "Rule action (pass/block/reject)",
"enum": [
"pass",
"block",
"reject"
],
"type": "string"
},
"description": {
"description": "Rule description",
"type": "string"
},
"destination": {
"description": "Destination address/network or \"any\"",
"type": "string"
},
"destinationPort": {
"description": "Destination port (for TCP/UDP)",
"type": "string"
},
"direction": {
"description": "Traffic direction",
"enum": [
"in",
"out"
],
"type": "string"
},
"enabled": {
"default": true,
"description": "Enable rule",
"type": "boolean"
},
"interface": {
"description": "Interface name",
"type": "string"
},
"protocol": {
"description": "Protocol (any/tcp/udp/icmp)",
"type": "string"
},
"source": {
"description": "Source address/network or \"any\"",
"type": "string"
},
"sourcePort": {
"description": "Source port (for TCP/UDP)",
"type": "string"
}
},
"required": [
"action",
"interface",
"direction",
"protocol",
"source",
"destination"
],
"type": "object"
}