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

    Convert / sort out Ips in Json File with PFsense to a IP-Table

    General pfSense Questions
    5
    7
    2.8k
    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.
    • M
      Marv21
      last edited by

      Hello :)
      Is it possible with PFsense to sort the IP´s from this Json File:
      https://ip-ranges.amazonaws.com/ip-ranges.json
      out, into a IPTable?
      So i can create a Alias and after that a Rule to Route Amazon services through a specific Gateway?

      Thank you

      1 Reply Last reply Reply Quote 0
      • B
        brandur
        last edited by

        You can do it with the package pfBlockerNG

        SG-4860 w/128GB SSD & 8GB RAM

        1 Reply Last reply Reply Quote 0
        • M
          Marv21
          last edited by

          Wow, that was easy and fast.
          Thank you for the good answer - worked very well!

          1 Reply Last reply Reply Quote 0
          • B
            brandur
            last edited by

            That's what the blue "Thank you" bottom on the top right is for  ;)
            No, but seriously. I'm glad I could help.

            SG-4860 w/128GB SSD & 8GB RAM

            1 Reply Last reply Reply Quote 0
            • V
              vmaxx
              last edited by

              @brandur:

              You can do it with the package pfBlockerNG

              I hate to be dense, but the ip ranges json link / file has both ip4 & ip6 data in it. Do I put it under ip4 lists or ip6 or both? Will pfSense freak out if it grabs ip6 data under an ip4 alias or is the differentiation of IP4 & ip6 in pfBlockerNG more for my (human) benefit?

              K 1 Reply Last reply Reply Quote 0
              • K
                kraduk @vmaxx
                last edited by

                @vmaxx

                A quick and dirty method is to cron this, after installing jq from the cli (need freebsd repo)

                curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq .prefixes| jq '.[]' | jq -r .ip_prefix | sort -u | pfctl -t aws -f - -T replace

                1 Reply Last reply Reply Quote 0
                • M
                  mjflower
                  last edited by

                  Hi.

                  Sorry to revive this old thread but this is exactly what I would like to do too but fear I have less skills to understand so quickly what the solution was.

                  I've got as far as creating a new feed with the json address in pfblockerng but how do I now use that as an alias? When attempting to create a new alias I'm not sure how to use that feed information or refer to it, the only option I have is the usual host,network,ip, url etc.

                  I am not a gun on this stuff so please be patient with me :)

                  Cheers

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