- 论坛徽章:
- 0
|
关于iptables
恭喜你:)
其实geoip模块也很好,他可以用CN、JP等来表示国家的IP地址,你自己不用知道到底哪个国家的IP都是什么,GEOIP需要一个地址库
iptables geoip match
Author: Samuel Jean <sjean@cookinglinux.org>;; Nicolas Bouliane <nib@cookinglinux.org>;
Status: Testing
This patch makes possible to match a packet
by its source or destination country.
GeoIP options:
[!] --src-cc, --source-country country[,country,country,...]
Match packet coming from (one of)
the specified country(ies)
[!] --dst-cc, --destination-country country[,country,country,...]
Match packet going to (one of)
the specified country(ies)
NOTE: The country is inputed by its ISO3166 code.
The only extra files you need is a binary db (geoipdb.bin) & its index file (geoipdb.idx).
Both files are generated from a countries & subnets database with the csv2bin tool,
available at www.cookinglinux.org/geoip/. Both files MUST also be moved in /var/geoip/
as the shared library is statically looking for that pathname (ex.: /var/geoip/geoipdb.bin).
比如,你要限制日本人访问你的服务器,那就非常方便了^_^ |
|