Closed nerrehmit closed 3 months ago
I think I found the problem that I'm having on my instance.
I have two NAT rules on my instance to forward certain ports on my public IPv4 WAN Interface back into my network.
When I created those rules manually I had the option for Filter rule association
set to Add associated filter rule
which I think is the default setting.
This creates a matching firewall rule on the WAN interface to allow inbound access to the NAT'ed port.
Documentation: https://docs.opnsense.org/manual/nat.html#port-forwarding
The important snippet of my firewall rule XML config looks like this (some info redacted):
<filter>
-- ipv6 rules cut --
<rule uuid="ca0393b9-36b9-4dfc-869c-925c2db9c85c">
<source>
<any>1</any>
</source>
<interface>wan</interface>
<statetype>keep state</statetype>
<protocol>tcp</protocol>
<ipprotocol>inet</ipprotocol>
<destination>
<address>192.168.1.118</address>
<port>80</port>
</destination>
<descr>REDACTED</descr>
<category/>
<associated-rule-id>nat_64b50f451b5983.28976102</associated-rule-id>
<created>
<username>REDACTED@INTERNAL-IP</username>
<time>TIMESTAMP</time>
<description>/firewall_nat_edit.php made changes</description>
</created>
</rule>
That explains where this field comes from. Let me know if you need further info
HI @nerrehmit We have released the bugfix related to this issue in v1.2.1.
Describe the bug If I want to block some outgoing requests on my LAN interface for testing purposes I get an ansible error during module execution saying that there was an unexpected keyword argument 'associated-rule-id'
Currently it's only for testing so there are no other firewall rules on the LAN interface, despite the default rules. There are a few rules on the WAN interface that were added manually.
This is a fully upgraded OPNSense 24.1_9 installation that was probably upgraded from 22.1 if I had to guess.
To Reproduce Example playbook:
Module output:
Expected behavior Blocking rule is created on LAN interface without error during ansible run
Ansible ENV:
Additional context I can provide the full traceback if you like. Let me know if I can support debugging. :)