Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    Create a rule to match odd or even ip addresses

    Scheduled Pinned Locked Moved Firewalling
    5 Posts 2 Posters 1.4k 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.
    • I Offline
      ivarh
      last edited by

      Hi, I am trying to set up routing to seperate wan links based on the source ip address and in that regards I need a rule to distinguish between odd and even ip addresses. Is this possible in pfsense?

      1 Reply Last reply Reply Quote 0
      • johnpozJ Offline
        johnpoz LAYER 8 Global Moderator
        last edited by

        with aliases filled with the different IPs sure.

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 26.03.1 | Lab VMs 2.8.1, 26.03.1

        1 Reply Last reply Reply Quote 0
        • I Offline
          ivarh
          last edited by

          @johnpoz:

          with aliases filled with the different IPs sure.

          I was kind of hoping to avoid all that typing by creating a simpler rule

          1 Reply Last reply Reply Quote 0
          • johnpozJ Offline
            johnpoz LAYER 8 Global Moderator
            last edited by

            well you could do it real easy with a cidr ie via using /24 use /25 this would cut your /24 in half but it would not be odd even, it would be first half and second half.

            I your /24 is close to full this gives you the same sort of load balance across your 2 different wans.

            But you can import into your aliases.. Just create your list in excel or something and copy paste using the import feature.

            edit: this took all of 10 seconds to do.  In excel did 10.10.10.1, 10.10.10.3 highlighted both drag it down to copy counting by 2 and then copy paste the whole thing into alias.. Then repeat for your even ones.

            bulkimport.png
            bulkimport.png_thumb

            An intelligent man is sometimes forced to be drunk to spend time with his fools
            If you get confused: Listen to the Music Play
            Please don't Chat/PM me for help, unless mod related
            SG-4860 26.03.1 | Lab VMs 2.8.1, 26.03.1

            1 Reply Last reply Reply Quote 0
            • I Offline
              ivarh
              last edited by

              @johnpoz:

              well you could do it real easy with a cidr ie via using /24 use /25 this would cut your /24 in half but it would not be odd even, it would be first half and second half.

              I your /24 is close to full this gives you the same sort of load balance across your 2 different wans.

              But you can import into your aliases.. Just create your list in excel or something and copy paste using the import feature.

              edit: this took all of 10 seconds to do.  In excel did 10.10.10.1, 10.10.10.3 highlighted both drag it down to copy counting by 2 and then copy paste the whole thing into alias.. Then repeat for your even ones.

              Thanks for that tip. I never use excel so i forgot about it's ability to extend sequences. That combined wiht import aliases solved the typing problem. Thanks a bunch.

              -Ivar

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