Generates an IPv4 list from VPN sources. Based on X4BNet's VPN list scripts.
Current sources:
- A custom ASN list
- ProtonVPN's public IP list
- Ensure
jq
andperl
are installed - e.g.apt install jq perl
on Ubuntu. - Download IP2Location™'s LITE IP-ASN Database and save it as
IP2LOCATION-LITE_ASN.CSV
in a working directory. - Create an ASN.txt file in the same working directory and fill it with one ASN per line. X4BNet's VPN ASN list might be a good start.
- Run
generate.sh
in this repo from the working directory. IP masks will be printed to stdout. Example:./ip-list/generate.sh > ipv4.txt
You can use the output of this tool to create an IP set for a firewall. For example, if you already have a hash:net
IP set called vpns
:
ipset create vpns-new hash:net
while read p; do
ipset add vpns-new "$p"
done < ./ipv4.txt
ipset swap vpns-new vpns
ipset destroy vpns-new
# if you have netfilter-persistent installed to persist ipsets across reboots
netfilter-persistent save