Convert / sort out Ips in Json File with PFsense to a IP-Table
-
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
-
You can do it with the package pfBlockerNG
-
Wow, that was easy and fast.
Thank you for the good answer - worked very well! -
That's what the blue "Thank you" bottom on the top right is for ;)
No, but seriously. I'm glad I could help. -
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?
-
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
-
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