Netgate SG-1000 microFirewall

Author Topic: Filter rule association question  (Read 87 times)

0 Members and 1 Guest are viewing this topic.

Offline bl0bby

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Filter rule association question
« on: December 05, 2017, 02:33:55 pm »
I'm setting up pfsense with multiple Virtual IPs which I need to forward to several internal machines. For example, if I have the external IPs x.x.x.201, 202, and 203, I might want to forward port 80 to 8080, and port 22 to 22, from 202 to an internal machine at 192.x.x.100 and forward 500 and 4500 from 203 to 192.x.x.101.

When I set up the port forwarding, I tried "Add an associated filter rule" which created a firewall rule automatically. However, when I look at the rule it is not restricted to incoming port 80 (for example), but allows Any source, then restricts the destination to 8080.

Just so I'm clear, is the reason for this that the rule will allow any traffic to be seen by the forwarding rules, which will only allow traffic intended for port 80 to pass through and be redirected to 8080? Or do the forwarding rules come first, and then the firewall rules kick in?

Lastly, how exactly does the "Pass" option work, and would that be a better choice for me than "Add an associated filter rule" in this case?

Thanks for any advice!

Offline johnpoz

  • Hero Member
  • *****
  • Posts: 14484
  • Karma: +1343/-200
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Filter rule association question
« Reply #1 on: December 05, 2017, 02:57:54 pm »
You will notice that the dest is the IP of your port forward, and yes port forwards come before firewall rules

https://doc.pfsense.org/index.php/Firewall_Rule_Processing_Order
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.3.4_p1 (work)
1x SG-4860 2.4.2-RELEASE-p1 (home)

Offline bl0bby

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Filter rule association question
« Reply #2 on: December 05, 2017, 03:06:10 pm »
That makes sense, thanks for the clarification!