[SOLVED] Firewall rule nooit working

Started by gert23, February 25, 2023, 08:40:45 PM

Previous topic - Next topic
February 25, 2023, 08:40:45 PM Last Edit: February 26, 2023, 12:55:34 PM by AdSchellevis
Hi

I am a newbie in Opnsense.
I made an alias with the ip addresses of my ipcams.
They are al connected to a switch being lan2.

I like to prevent that they can connect to the internet.

What am i doing wrong? Had destination wlan but later any.

Best regards


Verstuurd vanaf mijn SM-G998B met Tapatalk


February 25, 2023, 10:11:15 PM #1 Last Edit: February 25, 2023, 10:15:21 PM by meyergru
Direction should be IN (from the LAN interface perspective, the packets come in) and destination should probably be ANY, as WAN net is only one of the ISPs networks.
Intel N100, 4 x I226-V, 16 GByte, 256 GByte NVME, ZTE F6005

1100 down / 770 up, Bufferbloat A

Unfortunately that didn't help.
I made an alias to a laptop to test it easier than with the cams.
But still no internet block



Verstuurd vanaf mijn SM-G998B met Tapatalk


Forget these screenshots

Verstuurd vanaf mijn SM-G998B met Tapatalk


Current situation
Still not working



Verstuurd vanaf mijn SM-G998B met Tapatalk


February 26, 2023, 12:03:14 PM #5 Last Edit: February 26, 2023, 12:20:00 PM by meyergru
In case your rules do not fire, you obviously have some rule(s) that are applied before those interface rules. You showed neither any of the automatic rules nor NAT rules.

Also, there are sections that are applied before the "interface" rules:

Please look at https://docs.opnsense.org/manual/firewall.html first and take a look at the "processing order" section. The "system" and "floating" rules are applied before the interface rules, even groups are higher in priority than interfaces. If there is any "quick" rule that allows LAN traffic, it will fire first.

From scratch, there is a special "Allow All" rule ONLY for the LAN interface that has to be disabled (but then, you have to define something equivalent yourself). It is mentioned in here: https://www.sunnyvalley.io/docs/network-security-tutorials/how-to-configure-opnsense-firewall-rules

Also, heed this warning:

Quote
NAT rules are always processed before filter rules! So for example, if you define a NAT : port forwarding rules without a associated rule, i.e. Filter rule association set to Pass, this has the consequence, that no other rules will apply!

Creating firewall rules on OpnSense can be tricky for beginners, there are some guides out that systematically show use cases like these:

https://www.sunnyvalley.io/docs/network-security-tutorials/how-to-configure-opnsense-firewall-rules

https://homenetworkguy.com/how-to/firewall-rules-cheat-sheet/
Intel N100, 4 x I226-V, 16 GByte, 256 GByte NVME, ZTE F6005

1100 down / 770 up, Bufferbloat A

Hi,

I received the device second hand but as freshly installed he said.
But there is a floating rule that I cannot explain for myself.



Quote from: gert23 on February 26, 2023, 12:34:10 PM
Hi,

I received the device second hand but as freshly installed he said.
But there is a floating rule that I cannot explain for myself.

That rule lets anything through from the LAN to (and also from) anywhere and as such, is very unsafe.
Intel N100, 4 x I226-V, 16 GByte, 256 GByte NVME, ZTE F6005

1100 down / 770 up, Bufferbloat A

I think, this did the trick.
Even connection to 192.168.0.1 didnt work anymore with the 4 rules

Quote from: meyergru on February 26, 2023, 12:40:07 PM
Quote from: gert23 on February 26, 2023, 12:34:10 PM
Hi,

I received the device second hand but as freshly installed he said.
But there is a floating rule that I cannot explain for myself.

That rule lets anything through from the LAN to (and also from) anywhere and as such, is very unsafe.
I don't know where this came from :-)

Verstuurd vanaf mijn SM-G998B met Tapatalk


Disabling that floating rule did the trick. Finally I reacts to my rules. And see the traffic in Live View.
Thanks.