Firewall on WAN interface acts not as I expected
-
i have 2 locations with 2 different WAN IPs.
1 PC on location A
1 PC on location BI am at location A. i connect with Teamviewer (remote desktop software) to PC on location B.
from location B (through Teamviewer) I ping public WAN IP of location A. no response (default firewall rule) thats what I expect.then I change on pfSense firewall on Location A:
pass, ICMP traffic from WAN to any
save and apply
i check trough Teamviewer: from location B I ping public WAN IP of location A, ping is answering seconds after clicking on apply, thats what I expect.then i change on pfSense Firewall on location A:
block, ICMP traffic from WAN to any.
save and apply:
i check: from location B ping to public WAN IP of location A, i expect "no response", but indeed ping is still answering.then I had a 2nd thought: I change on pfSense Firewall:
delete rule "block, ICMP traffic from WAN to any" (so default deny rule on WAN should handle this)
save and apply:
I check: from location B ping to public WAN IP of location A: I expect "no response" but still ping is answering.Why?
but:
if I reboot pfSense firewall, after reboot pfSense is acting correctly.
ping from location B to public WAN IP of location A is now correct with "no response", as I expect.If I follow procedure again as discribed above (pass, block, delete) same behaviour.
ping is answering.
but I expect "no answer" after setting "block" rule or after "deleteing" ICMP WAN to any rule.
I can reproduce this behaviour.what are I am doing wrong?
-
Even though ICMP (ping) is stateless, pf still creates a state when a packet comes in that matches a pass rule. Then when later similar packets come in, they just match that state rather than every packet being processed by the rule set.
If no matching packets are received for a while (not sure how long that is - should look it up some time) then the state will be cleared.If you change firewall rules, existing states are not automatically cleared. So "pings" that worked will continue to work if you keep them running.
Diagnostics->States, Reset States - there is some explanation text there. After making rule changes like you describe, reset states and then test.