Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    WAN Firewall rule destination unexpectedly had to be the LAN ip???

    Scheduled Pinned Locked Moved Firewalling
    2 Posts 2 Posters 369 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      AmosK
      last edited by

      I have a 5 port PFSense firewall with 4 public IP's and 4 LAN subnets.

      I have port forwarding for h.323/SIP working for one of the public IP's to the associated LAN subnet but use pfBlockerNG to blacklist most overseas IP's.

      I needed to whitelist a specific overseas WAN network so I added a rule of source <x.x.x.x 24="">and destination: <public_ip>BEFORE the pfBlockerNG rules and assumed the traffic would pass through the firewall and that the NAT translation would occur. It DID NOT and the logs showed the IP as blocked and the h.323/SIP connection would not establish from the overseas IP.

      To make it work I had to change the destination IP in the firewall rule to the LAN subnet IP, then I could successfully make a connection. Can someone explain to me why, when the TCP packet coming from the WAN will definitely have the public IP address in the destination?

      Thanks in advance!</public_ip></x.x.x.x>

      1 Reply Last reply Reply Quote 0
      • K
        kpa
        last edited by

        That's how it works in PF, the NAT or RDR rules are always applied first before the traffic is filtered. This can't be changed. The effect on filter rules associated with port forwards  is exactly what you observed, the destination address in the firewall rule has to be the address after the address translation.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.