You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---
module: firewall_rulesshort_description: This module is used to manage OPNSense firewall rulesversion_added: "1.0.0"description: This module is used to manage OPNSense firewall rules.options:
action:
description: Choose what to do with packets that match the criteria specified below.choices:
- pass
- block
- rejectdefault: passtype: strdisabled:
description: Set this option to disable this rule without removing it from the list.required: falsedefault: falsetype: boolipprotocol:
description: IP versionrequired: falsedefault: inetchoices:
- inet
- inet6
- inet46type: strquick:
description: | If a packet matches a rule specifying quick, then that rule is considered the last matching rule and the specified action is taken. When a rule does not have quick enabled, the last matching rule wins.required: falsedefault: truetype: boolinterface:
description: Choose on which interface packets must come in to match this rule.required: truetype: strdirection:
description: | "Direction of the traffic. Traffic IN is coming into the firewall interface, while traffic OUT is going out of the firewall interface. In visual terms: [Source] -> IN -> [Firewall] -> OUT -> [Destination]. The default policy is to filter inbound traffic, which means the policy applies to the interface on which the traffic is originally received by the firewall from the source. This is more efficient from a traffic processing perspective. In most cases, the default policy will be the most appropriate."choices:
- in
- outdefault: intype: strprotocol:
description: Choose which IP protocol this rule should match.choices:
- any
- tcp
- udp
- tcp/udp
- icmp
- esp
- ah
- gre
- igmp
- pim
- ospf
- ggp
- ipencap
- st2
- cbt
- egp
- igp
- bbn-rcc
- nvp
- pup
- argus
- emcon
- xnet
- chaos
- mux
- dcn
- hmp
- prm
- xns-idp
- trunk-1
- trunk-2
- leaf-1
- leaf-2
- rdp
- irtp
- iso-tp4
- netblt
- mfe-nsp
- merit-inp
- dccp
- 3pc
- idpr
- xtp
- ddp
- idpr-cmtp
- tp++
- il
- ipv6
- sdrp
- idrp
- rsvp
- dsr
- bna
- i-nlsp
- swipe
- narp
- mobile
- tlsp
- skip
- ipv6-icmp
- cftp
- sat-expak
- kryptolan
- rvd
- ippc
- sat-mon
- visa
- ipcv
- cpnx
- cphb
- wsn
- pvp
- br-sat-mon
- sun-nd
- wb-mon
- wb-expak
- iso-ip
- vmtp
- secure-vmtp
- vines
- ttp
- nsfnet-igp
- dgp
- tcf
- eigrp
- sprite-rpc
- larp
- mtp
- ax.25
- ipip
- micp
- scc-sp
- etherip
- encap
- gmtp
- ifmp
- pnni
- aris
- scps
- qnx
- a/n
- ipcomp
- snp
- compaq-peer
- ipx-in-ip
- carp
- pgm
- l2tp
- ddx
- iatp
- stp
- srp
- uti
- smp
- sm
- ptp
- isis
- crtp
- crudp
- sps
- pipe
- sctp
- fc
- rsvp-e2e-ignore
- udplite
- mpls-in-ip
- manet
- hip
- shim6
- wesp
- rohc
- pfsync
- divertrequired: falsedefault: anytype: strsource:
description:
- Specifies the source configuration.type: dictsuboptions:
address:
description:
- The IP address of the source.default: anytype: strnetwork:
description:
- The network of the source.default: anytype: strport:
description:
- The port of the source.default: anytype: strinvert:
description:
- Inverts the match logic.default: falsetype: booldestination:
description:
- Specifies the source configuration.type: dictsuboptions:
address:
description:
- The IP address of the source.type: strdefault: anynetwork:
description:
- The network of the source.type: strdefault: anyport:
description:
- The port of the source.type: strdefault: anyinvert:
description:
- Inverts the match logic.default: falsetype: boollog:
description: | "Log packets that are handled by this rule. Hint: the firewall has limited local log space. Don't turn on logging for everything. If you want to do a lot of logging, consider using a remote syslog server."required: falsedefault: falsetype: boolcategory:
description: You may enter or select a category here to group firewall rulesrequired: falsetype: strdescription:
description: Description for the rule.required: falsetype: strstate:
description: Weather rule should be added or removed.required: falsetype: strdefault: presentchoices: [present, absent]
Examples
- name: Block SSH in LAN Networkpuzzle.opnsense.firewall_rules:
interface: lansource:
destination:
port: 22action: block
Additional Notes (Optional)
The interface name could be verified against the device name its alias or the descriptive name once an interface related module provides an appropriate utility for it.
The text was updated successfully, but these errors were encountered:
Module Description
Add, modify or delete firewall rules on the OPNsense system.
Minimum Viable Product (MVP)
Express your minimal viable product in the form of
the Ansible
DOCUMENTATION
block format:Examples
Additional Notes (Optional)
The text was updated successfully, but these errors were encountered: