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

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

Scheduled Pinned Locked Moved General pfSense Questions
7 Posts 5 Posters 2.8k 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.
  • M
    Marv21
    last edited by Jun 7, 2016, 10:05 PM Jun 7, 2016, 9:44 PM

    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 Jun 8, 2016, 5:35 PM

      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 Jun 8, 2016, 9:45 PM

        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 Jun 9, 2016, 8:35 PM

          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 Mar 17, 2018, 8:36 PM

            @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 Feb 18, 2019, 1:00 PM Reply Quote 0
            • K
              kraduk @vmaxx
              last edited by Feb 18, 2019, 1:00 PM

              @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 Mar 19, 2019, 10:52 AM

                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.
                  This community forum collects and processes your personal information.
                  consent.not_received