OPNsense Forum
Archive => 16.1 Legacy Series => Topic started by: macgvr 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.
-
I need to add that I am using the latest version, 16.1.13
-
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.
-
The anti-lockout rule for the lan is first. Should that be moved?
-
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?
-
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.
-
A ping is usually an ICMP echo request which is not filtered by your rule because you filter only TCP.
-
That makes sense. It appears that even choosing upd/tcp makes no difference.
-
Because ICMP is also not UDP traffic.
-
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.
-
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.
-
Isn't that option selected by default when creating a new rule?
-
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.
-
Right, ok, I will look into it. :)
-
Done, thanks!
https://github.com/opnsense/core/commit/cc9cede6d8e
-
That was really fast. Thanks!