OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 16.1 Legacy Series »
  • [SOLVED] Firewall rules not working
« previous next »
  • Print
Pages: [1] 2

Author Topic: [SOLVED] Firewall rules not working  (Read 10007 times)

macgvr

  • Newbie
  • *
  • Posts: 13
  • Karma: 1
    • View Profile
[SOLVED] Firewall rules not working
« on: May 13, 2016, 10:46:19 pm »
I am having trouble getting the firewall rules to actually work. Trying to block outgoing traffic to a particular ip address but it doesn't seem to work. Attached is a screen shot of the rule I am trying to use. The gateway setting is default. Not sure what is wrong.
« Last Edit: May 18, 2016, 07:55:29 am by franco »
Logged

macgvr

  • Newbie
  • *
  • Posts: 13
  • Karma: 1
    • View Profile
Re: Firewall rules not working
« Reply #1 on: May 13, 2016, 10:48:35 pm »
I need to add that I am using the latest version, 16.1.13
Logged

fabian

  • Hero Member
  • *****
  • Posts: 2768
  • Karma: 199
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Firewall rules not working
« Reply #2 on: May 14, 2016, 07:23:58 pm »
Are your rules in the correct order? Block rules should be before the pass rules.
Because you want to block this host completely, you should block any protocol and not only TCP.
Logged

macgvr

  • Newbie
  • *
  • Posts: 13
  • Karma: 1
    • View Profile
Re: Firewall rules not working
« Reply #3 on: May 16, 2016, 02:59:35 pm »
The anti-lockout rule for the lan is first. Should that be moved?
Logged

fabian

  • Hero Member
  • *****
  • Posts: 2768
  • Karma: 199
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Firewall rules not working
« Reply #4 on: May 16, 2016, 10:21:06 pm »
no - the anti-lockout rule cannot be moved and it does not affect your issue.

Have you reloaded the filter rules and how do you test if it is working?
Logged

macgvr

  • Newbie
  • *
  • Posts: 13
  • Karma: 1
    • View Profile
Re: Firewall rules not working
« Reply #5 on: May 16, 2016, 10:26:03 pm »
At this point I have upgraded to the latest version and did a reboot afterward. I have tested by pinging the ip address. Since the ping still works I assume the rule isn't working. Not sure how to reload the filter rules.
Logged

fabian

  • Hero Member
  • *****
  • Posts: 2768
  • Karma: 199
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Firewall rules not working
« Reply #6 on: May 16, 2016, 11:15:40 pm »
A ping is usually an ICMP echo request which is not filtered by your rule because you filter only TCP.
Logged

macgvr

  • Newbie
  • *
  • Posts: 13
  • Karma: 1
    • View Profile
Re: Firewall rules not working
« Reply #7 on: May 17, 2016, 03:57:13 pm »
That makes sense. It appears that even choosing upd/tcp makes no difference.
Logged

fabian

  • Hero Member
  • *****
  • Posts: 2768
  • Karma: 199
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Firewall rules not working
« Reply #8 on: May 17, 2016, 06:18:16 pm »
Because ICMP is also not UDP traffic.
Logged

macgvr

  • Newbie
  • *
  • Posts: 13
  • Karma: 1
    • View Profile
Re: Firewall rules not working
« Reply #9 on: May 17, 2016, 09:10:54 pm »
Feeling a bit dense about now. I had forgotten that icmp is another protocol. Kind of just considered it to be something that used UDP. Not sure where that came from. It seems I am forgetting things I learned a very long time ago, kind of scary.  I now see that I can setup a rule to block icmp but it isn't really necessary in this case.  I have now tested using a web browser since the ip addresses were tied to websites and I figure by blocking both TCP and UDP, which I have now done, I should be covered for any unwanted traffic.  Thanks for your help.
Logged

macgvr

  • Newbie
  • *
  • Posts: 13
  • Karma: 1
    • View Profile
Re: [SOLVED] Firewall rules not working
« Reply #10 on: May 18, 2016, 06:42:48 pm »
I looked at the settings for the rules a bit more and found that there is an any option for filtering protocols. I didn't notice it at first because it is way down the list. I actually thought there should be an any option but missed it. It might make sense to have the any at the top of the list instead of buried down where it is. Just a thought.
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13679
  • Karma: 1176
    • View Profile
Re: [SOLVED] Firewall rules not working
« Reply #11 on: May 18, 2016, 07:34:02 pm »
Isn't that option selected by default when creating a new rule?
Logged

macgvr

  • Newbie
  • *
  • Posts: 13
  • Karma: 1
    • View Profile
Re: [SOLVED] Firewall rules not working
« Reply #12 on: May 18, 2016, 07:43:19 pm »
It is but if you clone an existing rule then you have to go looking for it and that is where I missed it. It has been awhile since I created a rule from scratch and I forgot that the any option existed. My fault I suppose. Just thought that having that option always at the top of the list might be helpful.
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13679
  • Karma: 1176
    • View Profile
Re: [SOLVED] Firewall rules not working
« Reply #13 on: May 18, 2016, 07:44:23 pm »
Right, ok, I will look into it. :)
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13679
  • Karma: 1176
    • View Profile
Re: [SOLVED] Firewall rules not working
« Reply #14 on: May 18, 2016, 07:47:44 pm »
Done, thanks!

https://github.com/opnsense/core/commit/cc9cede6d8e
Logged

  • Print
Pages: [1] 2
« previous next »
  • OPNsense Forum »
  • Archive »
  • 16.1 Legacy Series »
  • [SOLVED] Firewall rules not working
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2023 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2