I’m trying to block two /24 ranges. To make it tidy I’ve created an IPset in the Firewall, including the 2 ranges and then created firewall rule to drop forwarding (and in the Advanced tab of the rule I’ve included the IPset).
But the problem is, that the changes don’t seem to do anything.
I want to eliminate (drop) any connection from or to those ranges - from or to any device on my network and regardless of what protocol is being used.
I’ve tried to make rules with unspecified device, or with inbound and outbound devices matching the wan or the bridge - but none seems to actually come into force.
To clarify, I am testing outbound connection - which should also not be allowed per my rule - to these ranges, but I do have connection - I can ping or ssh to these ranges.
Perhaps, I need some trigger in my rule that is not there? Or too generic rules like in my case don’t work?
If you want to expand with an ipset later, this should work:
config ipset
option name 'EvilGnome'
option family 'ipv4'
list match 'net'
list entry '195.62.52.0/24'
list entry '195.62.53.0/24'
config rule
option name 'Deny-EvilGnome'
option src 'lan'
option dest 'wan'
option family 'ipv4'
option ipset 'EvilGnome dest'
option target 'REJECT'
list proto 'all'
Resulting firewall sections:
set EvilGnome {
type ipv4_addr
auto-merge
flags interval
elements = {
195.62.52.0/24,
195.62.53.0/24,
}
}
chain forward_lan {
meta nfproto ipv4 ip daddr @EvilGnome counter jump reject_to_wan comment "!fw4: Deny-EvilGnome"
BTW, you can simplify your 2 subnets to 195.62.52.0/23 since they are adjacent.