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

Get IP range by AS number

Scheduled Pinned Locked Moved pfBlockerNG
3 Posts 3 Posters 317 Views 3 Watching
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.
  • V Offline
    viktor_g Netgate
    last edited by Oct 10, 2019, 12:18 PM

    Found useful site for this https://hackertarget.com/as-ip-lookup/

    You can simply add IPv4 feed:
    https://api.hackertarget.com/aslookup/?q=AS15169

    But is more better to have native ability in pfBlockerNG, and get ip ranges from radb.net
    like this script:
    whois -h whois.radb.net -- '-i origin AS15169' | grep -Eo "([0-9.]+){4}/[0-9]+"

    1 Reply Last reply Reply Quote 1
    • N Offline
      NogBadTheBad
      last edited by Oct 10, 2019, 1:02 PM

      @viktor_g your script only does IPv4

      IPv4:-

      whois -h whois.radb.net -- '-i origin ASS15169' | grep ^route: | awk '{print $2}'

      IPv6:-

      whois -h whois.radb.net -- '-i origin AS15169' | grep ^route6: | awk '{print $2}

      Andy

      1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

      1 Reply Last reply Reply Quote 0
      • B Offline
        BBcan177 Moderator
        last edited by Oct 11, 2019, 12:39 AM

        pfBlockerNG-devel already has ASN support in the IP State setting. Also Radb registry isn't very accurate. The package is using bppview.io instead.

        https://api.bgpview.io/ip/<IP>
        

        "Experience is something you don't get until just after you need it."

        Website: http://pfBlockerNG.com
        Twitter: @BBcan177  #pfBlockerNG
        Reddit: https://www.reddit.com/r/pfBlockerNG/new/

        1 Reply Last reply Reply Quote 1
        3 out of 3
        • First post
          3/3
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
          This community forum collects and processes your personal information.
          consent.not_received