iptables-country-block
Interact with iptables
, block whole countries based on assigned ip blocks
Install
$ npm install [--global] iptables-country-block
Usage
CLI
Note: Most use cases requires --global
installation
$ [sudo] iptables-country-block ["<country iso codes, space delimited>"[ "<iptables chain name>"[ "<url template of ip block sources>"]]]
$ [sudo] iptables-country-block "ru cn" "countryipblock" "https://raw.githubusercontent.com/herrbischoff/country-ip-blocks/master/ipv4/{isoCode}.cidr"
Require
const createIptablesChain getCountryIPBlocks iptables } = ; await ;// or await createIptablesChain('somechain'); const ipBlocks = await ; forlet i = 0; i < ipBlockslength; ++i await ; await ;await ;await ;