OPNsense Forum

Archive => 23.7 Legacy Series => Topic started by: Heiko910 on December 25, 2023, 09:16:04 PM

Title: Trying to block two IP addresses from accessing the network
Post by: Heiko910 on December 25, 2023, 09:16:04 PM
Hi there,
I am trying to block two IPs from access my network/the internet at a certain time a day.

I have created an Alias that includes the two IPs 192.168.2.7-192.168.2.8
I also created a schedule for Mon-Sun 21:00 - 23.59 and 0:00-08:00

I then went into Firewall rules in my Lan section and created a block rule for inbound traffic from source (the Alias) and I selected the schedule.
I applied all the changes but the two devices still have network access during the period of time.
What am I missing?
Thanks
Title: Re: Trying to block two IP addresses from accessing the network
Post by: Maurice on December 25, 2023, 09:43:42 PM
Did you place the block rule above the default allow rule?

Cheers
Maurice
Title: Re: Trying to block two IP addresses from accessing the network
Post by: Heiko910 on December 25, 2023, 09:56:38 PM
No, is that the problem? Let me try.
Thanks,
Merry Christmas
Title: Re: Trying to block two IP addresses from accessing the network
Post by: Maurice on December 25, 2023, 09:59:08 PM
Rule order is important because they are evaluated sequentially from top to bottom. If you have a quick "allow all" rule above the block rule, the block rule will never be evaluated.

Cheers & happy holidays
Maurice
Title: Re: Trying to block two IP addresses from accessing the network
Post by: Heiko910 on December 25, 2023, 10:07:47 PM
you are a rockstar. I put that rule at the top and it works. Thanks again