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

    Using floating rules to set gateway (group)

    Scheduled Pinned Locked Moved Routing and Multi WAN
    3 Posts 3 Posters 1.6k 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.
    • E
      ercpe
      last edited by

      I have the following setup:

      • WAN 1 with GW 1

      • WAN 2 with GW 2

      • Gateway group "Failover" with GW2 in Tier1 and GW1 in Tier2

      • LAN 1

      • LAN 2

      • LAN 3

      GW2 is the default gateway. I'm trying to configure the following rules in the less error-prone way:

      • All traffic from LAN 1 and LAN 2 should use the "Failover" gateway group

      • All traffic from LAN 3 must always use GW1

      It works when i set

      | Source | Destination | Gateway |
      | LAN 1 | * | Failover |
      | LAN 2 | * | Failover |
      | LAN 3 | * | GW1 |

      Unfortunately, i don't have simple "Pass all" rules - there are 10-20 rules per interface, which can lead to errors if either the Failover gateway isn't set on LAN1 / LAN2 (traffic would not fail over) or GW1 isn't set on LAN3 (traffic would leave the wrong interface).

      I tried to use floating rules to set the gateway in this way:

      | Interfaces | Direction | Action | Gateway |
      | LAN1, LAN2 | in | Match | Failover |
      | LAN3 | in | Match | GW1 |

      leaving the Pass actions on the interface pages. However, this does not work as expected. It seems that the "default" gateway option on the Pass rules in the interface tabs do set the gateway using the systems routing table and not "use whatever been set before or use the system routing table".

      Is there another way to set the gateway without specifying it on every rule?

      1 Reply Last reply Reply Quote 0
      • H
        heper
        last edited by

        Unfortunately, i don't have simple "Pass all" rules - there are 10-20 rules per interface, which can lead to errors if either the Failover gateway isn't set on LAN1 / LAN2 (traffic would not fail over) or GW1 isn't set on LAN3 (traffic would leave the wrong interface).

        nobody that uses pfsense in a non-home environment has "simple PASS all" rules ….
        what kind of difficulty do you have that allow for errors ?
        the easiest way to prevent stuff like that is to put you pass rules (with GW) at the bottom, and all the block rules above them.

        I tried to use floating rules to set the gateway in this way

        you probably could do that if you really wanted to …. looks like swatting a fly with a bulldozer to me.
        if you still wanted to go that route, i guess you have to do it on WAN-interface with direction out

        1 Reply Last reply Reply Quote 0
        • DerelictD
          Derelict LAYER 8 Netgate
          last edited by

          Unfortunately, i don't have simple "Pass all" rules - there are 10-20 rules per interface, which can lead to errors if either the Failover gateway isn't set on LAN1 / LAN2 (traffic would not fail over) or GW1 isn't set on LAN3 (traffic would leave the wrong interface).

          Make your rules correct and it'll work.  It's probably easier and less error-prone to have everything related to traffic from a LAN interface in one place than to have it in multiple places.

          Chattanooga, Tennessee, USA
          A comprehensive network diagram is worth 10,000 words and 15 conference calls.
          DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
          Do Not Chat For Help! NO_WAN_EGRESS(TM)

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