Pfsense in Stateless mode



  • Can we run pfsense as a complete stateless firewall? Please help....


  • Rebel Alliance Developer Netgate

    Yes, but it isn't something most people would need to do.

    You can either disable pf entirely, or you can add floating rules using State Type of None to pass traffic in every direction. You will need a ton of rules to act in that way, however. Four for any single action. For example (in LAN, out WAN, in WAN, out LAN).



  • Thanks....I tried the second option.I have a test setup in which i usually login firewall via LAN ip. As soon as i added the rules with state type of none the firewall become unreachable... unable to figure out why...



  • @jimp If i want to allow all the traffic to my internal network from the internet, I only need four rules right?

    Please correct me if my configuration is wrong
    Eg....
    In LAN-Source any to destination LAN segment(x.x.x.x/23)
    Out WAN-Source Public subnet (y.y.y.y/z) to destination any
    In WAN-Source any to destination Public Subnet (y.y.y.y/z)
    Out LAN- Source LAN Segment (x.x.x.x/23) to Destination Any


  • LAYER 8 Global Moderator

    What exactly are you trying to accomplish? Why would you want/need a stateless firewall.. Is this the early 90s with old school packet filter?

    Do you mean you want a router? That doesn't firewall?



  • @thoufiq Similar problem. Adding 'allow all' rules, with state type of none, stopped all tcp connections on that LAN subnet. There must be something special about floating rules that you and I don't understand.


  • Rebel Alliance Developer Netgate

    @thoufiq said in Pfsense in Stateless mode:

    @jimp If i want to allow all the traffic to my internal network from the internet, I only need four rules right?

    Please correct me if my configuration is wrong
    Eg....
    In LAN-Source any to destination LAN segment(x.x.x.x/23)

    This is backwards. Traffic inbound on LAN is from your LAN segment, not to.

    Out WAN-Source Public subnet (y.y.y.y/z) to destination any

    That is OK

    In WAN-Source any to destination Public Subnet (y.y.y.y/z)

    That is OK

    Out LAN- Source LAN Segment (x.x.x.x/23) to Destination Any

    This is backward. Traffic exiting the LAN is going to your LAN.



  • @jimp Thanks...

    Yes i tried..but it still keeps the states for the particular traffic.



  • @johnpoz 😆 We have pfsense firewalls to allow/restrict the external access.We configure ACLs on the switches to restrict the internal access and the ACLs are becoming large and unable to manage. So We want to install pfsense firewall to restrict the internal access (Easy rules management) and act as a packet filter without holding any state...


  • LAYER 8 Global Moderator

    @thoufiq said in Pfsense in Stateless mode:

    act as a packet filter without holding any state...

    Why would not just use it as a stateful firewall? Trying to manage firewall rules at a L3 switch is going to be a PITA!!! Use a real firewall-router if you need to make anything but the most sweeping sort of restrictions at your L3 switch..

    Someone should prob step back and look at the network design to make it easier to manage!!



  • @johnpoz My problem is a piece of equipment that does something that pfSense detects as a state failure, so it shuts down all tcp connections on that subnet. In order to get the equipment going, I need an 'allow all' rule for both the subnet and IPsec, but that still doesn't prevent pfSense from blocking traffic. So the question of how to eliminate stateful inspection on one or more subnets is quite relevant.


  • Rebel Alliance Developer Netgate

    @thoufiq said in Pfsense in Stateless mode:

    @jimp Thanks...

    Yes i tried..but it still keeps the states for the particular traffic.

    Then your rules were not right. Maybe you didn't check 'quick' on the floating rules, or maybe some part of the traffic isn't matching them. Make sure they are at the top of the interface rule list (and floating rules list)

    @telserv said in Pfsense in Stateless mode:

    @johnpoz My problem is a piece of equipment that does something that pfSense detects as a state failure, so it shuts down all tcp connections on that subnet. In order to get the equipment going, I need an 'allow all' rule for both the subnet and IPsec, but that still doesn't prevent pfSense from blocking traffic. So the question of how to eliminate stateful inspection on one or more subnets is quite relevant.

    So fix the other device so it doesn't do that :)

    Or don't go stateless, but setup sloppy state rules:

    https://docs.netgate.com/pfsense/en/latest/firewall/troubleshooting-blocked-log-entries-due-to-asymmetric-routing.html



  • @jimp said in Pfsense in Stateless mode:

    So fix the other device so it doesn't do that :)
    Yea, don't I wish. Step 1 would be to define the problem, which I haven't been able to do yet.
    Or don't go stateless, but setup sloppy state rules:
    Unfortunately, sloppy state rules don't work either.

    My current goal is to get this working in stateless mode, and then slowly add firewall rules to protect things. I tried it the other way around (firewall rules first), but couldn't get pfSense to work long enough to get any work done. So the question remains, after I've tried 'allow all' rules that have the state set to either keep, sloppy, or none, and that doesn't work, and I can't throw out the oddball product, what do I try next to allow traffic thru.


Log in to reply