Home / info / Help

Country IP lists

We host current IPv4 range lists for all countries on the Rasanegaar mirror. Use stable URLs for firewalls, MikroTik, CDN policy, or automation — files are updated regularly. Browse the country index to pick a country.

Iran (featured)

Iran keeps backward-compatible flat URLs at /info/countries/IR/ir_ipv4_list.* so existing OPNsense aliases, MikroTik scripts, and automation keep working without changes.

Typical uses: firewall ACLs, domestic vs international traffic steering, CDN policy, MikroTik address-lists, monitoring, and research.

Other countries

Every other country is published under /info/countries/{CC}/ with filenames like {cc}_ipv4_list.txt — e.g. us_ipv4_list.txt or de_ipv4_list.p2p. Status page: {cc}_ipv4_list.info.html.

Searchable country index

Where the data comes from

Prefixes come from RIPE Stat per ISO country code in IPv4 CIDR form. The Rasanegaar mirror pulls that feed and updates the public files regularly.

If RIPE is briefly unreachable or returns nothing useful, previous files stay in place — an empty list never replaces a good one.

https://stat.ripe.net/data/country-resource-list/data.json?resource=IR&v4_format=prefix

What you can download

Beyond plain CIDR, JSON, and MikroTik, we publish ready-made exports for Apache, web servers (allow/deny), iptables, Cisco, Juniper, IIS Web.config, CSF, PeerGuardian2, .p2p, eMule .dat, and MaxMind GeoIP .geoip.dat. For Iran, ASN holder names (MikroTik and PeerGuardian2) come from RIPE prefix-overview with an incremental on-disk cache.

Quick fetch (Iran)

curl -fsSL https://mirror.rasanegaar.com/info/countries/IR/ir_ipv4_list.txt -o ir_ipv4_list.txt

For another country, replace {cc} with the lowercase ISO code:

curl -fsSL https://mirror.rasanegaar.com/info/countries/US/us_ipv4_list.txt -o us_ipv4_list.txt

Firewall recipes

Step-by-step guides and ready scripts for common platforms. Examples use Iran; the same pattern works with {cc}_ipv4_list.txt for any country.

Full guide: How to use · Iran status: last update